TNC-Pi and Pi-Star Together

Melissa, TX

As I am the author of javAPRSSrvr and DStarMonitor, I took on the project of expanding DStarMonitor's reach from the Icom gateway world to the ircddbgateway world. This was done because there has been a proliferation of ircddbgateway distributions with various modems and hotspots. The APRS support in those distributions has deviated greatly from the original D-PRS specification developed for the D-STAR world (and now in the D-STAR specification from the JARL). I felt we needed to get back to basics and DStarMonitor (which is based on javAPRSSrvr) was the way to go.

I decided I needed a test bed even though John K7VE did most of the test "heavy lifting". I have been running javAPRSSrvr as an APRS IGate, object generator, and weather station for years on a Raspberry Pi (first a 1B and now a 2B). So I ran down to my friendly, neighborhood ham store and got what I thought would be a great testbed for the ircddbgateway support, the ZUMSpot with a Pi Zero included. I was right!  Here are the steps I have taken to bring the 2 devices together into one box. My target Pi is the RPi 2 because it has more horse power and I/O than the Zero.

The ZUMSpot RPi HAT (their RPi radio/modem) fits on the 40 pin GPIO bus. It uses the async pins, from what I gather (I could not find any other documentation on it) and i2cdetect showed nothing on the I2C bus 1. So I needed to move my TNC-Pi from the async port to the I2C pins. This turned out to be easier than originally thought (documentation was a bit obscure). What was confusing was the descriptions of the pitnc_getparams and pitnc_setparams bus and device numbers. If talking to the async port on the GPIO bus, the bus and device number will always be zero. This includes using pitnc_setparams to set the I2C address to something equal to or higher than 3 (always check your target device with i2cdetect to ensure there is nothing already on that address). Once you have set the I2C address, you can use pitnc_getparams and pitnc_setparams to view the TNC-Pi's settings using 1 (the Pi's I2C bus) and the device number you programmed (running i2cdetect should show the address occupied). You will use i2ckiss instead of kissattach to make use of the built-in Raspbian kernel support of AX.25. To use the TNC-Pi with the kernel AX.25, be sure to have installed (apt-get install) libax25, ax25-tools, and ax25-apps. I also found the best IP address to use with i2ckiss is (a local loopback address) so nothing will try to send out via the ax0 socket interface.

Ok, so now the TNC-Pi is off using its own address on the I2C bus so we can look at the Pi-Star unit. You must have access to the async pins on the GPIO connector to put the TNC-Pi into I2C mode (changing the address) so no other async device (the MMDVM for instance) can be attached. Once you have the TNC-Pi running in I2C mode (you must run i2ckiss once to change its mode), you can copy the files off to another computer because you will need them to put on the Pi-Star image.

The Pi-Star is a complete Raspbian image (minus a number of pieces) which is preconfigured as a multi-mode hotspot/repeater. Since I had purchased a separate Pi Zero which came with a Pi-Star SD, I decided to move forward with installing DStarMonitor on that unit, configure it, put the IGate files from the other Pi on it, and shut both Pi's down to transfer the SD card. I started up the Pi-Star and configured for my environment which was D-STAR only (after running the Pi-Star update from the web interface and pistar-upgrade from SSH). I disabled APRS and then ran pistar-expand to make the main disk take up the full SD. This gives us plenty of room for DStarMonitor and any other software. Pi-Star comes with the disk in read-only mode. However, running rpi-rw on the SSH command line puts it into read/write mode for a period of time (I have seen it revert back to read-only but running rpi-rw again puts it right back into read/write mode). If you follow the instructions at for Pi-Star, you will have a working DStarMonitor in just a few minutes.

I next executed the following commands to get AX.25 support into the Pi-Star:

  1. sudo su
  2. rpi-rw
  3. apt-get install libax25 ax25-tools ax25-apps
  4. configure axports so that the TNC-Pi is set for 19200 bps (very important).

I created the following shell script and replaced the ExecStart= data in DStarMonitor.service to point to the script instead of running Java directly. After modifying DStarMonitor.service, I reran 'systemctl enable DStarMonitor.service' to apply the change.

        #Start the javAPRSSrvr daemon
        ./i2ckiss 1 3 symlink /tmp/tnc_pi
        kissattach /tmp/tnc_pi APRS
        java -server -XX:+UseConcMarkSweepGC -jar DStarMonitor4.jar
Now copy your configuration files (and javAPRSSrvr LinuxAX25Intf and javax25 jars) from the RPi2 over to the RPi Zero. Add '' to your file. With this done, all you need to do now is move the ZUMSpot card and the SD card over to your more powerful RPi 2 (the Zero would work but the TNC-Pi dwarfs it :-)). Run 'shutdown -h now' on both Pi's. Unplug both Pi's from power, move the cards , power up the RPi 2. When you SSH in, you should see DStarMonitor running. You may need to modify /etc/iptables.rules to open up ports if you want to view your status page remotely or connect other clients to your javAPRSSrvr.

Here is a picture of the entire unit with APRS radio (not pretty but effective):

RPi with TNC-Pi and ZUMSpot