VnutZ Domain
Copyright © 1996 - 2022 [Matthew Vea] - All Rights Reserved

2022-04-29
Featured Article

Direwolf on a Raspberry Pi for Mobile APRS

[index] [392 page views]
Tagged As: APRS, HAM Radio, How To, and Raspberry Pi

Introduction

One of the first things I experimented with after getting my HAM license was APRS (Automatic Packet Reporting System). It was created more than 30 years ago by Bob Bruninga, call sign WB4APR, as one of the few positive things out of the Naval Academy. A HAM can do lots of things with APRS like sending position, exchanging messages, providing weather reports, etc.

I began using a Baofeng UV-5R handheld transceiver and APRSdroid on a tablet. While that worked okay for local purposes, it's transmission range was short in urban environments and often not picked up by my local digipeater and I was rarely patched through to the APRS databases by an IGate. I found on long road trips that while my general path was picked up by digipeaters and IGates near cities, there were huge swaths of travel where nothing heard me. Initially I solved this using my IC-2730As cross-band repeater feature where my Baofeng handled the APRS on a UHF frequency that was repeated at 50W high-power on the 144.390 MHz VHF frequency with the ICOM.

While it worked, that was not an elegant solution. Surely I could handle pushing packet radio through the all analog IC-2730A and tucking everything away underneath a seat. Fortunately, it was not hard and using a Raspberry Pi allows for some more advanced software than APRSdroid like Direwolf. Not only could Direwold handle digipeating for any drivers local to me with handhelds, but if I patched the Raspberry Pi's WiFi adapter into my phone, then I could provide mobile an IGate for the quiet areas I drove through.

Credit

I largely got my system to work based on the "APRS Digipeater/iGate with Direwolf (Entry Level)" article by KI5GTB and "Raspberry Pi based APRS Tracker/Digipeater/iGate" by VK3IL. Additionally, the Direwolf user manual expounds on all the configuration options that are possible and allowed me to easily adapt from KI5GTB's guide into a dynamic solution for mobile use.

Requisite Hardware

Not a lot of equipment is necessary for creating a mobile APRS station capable of beaconing, digipeating, and serving as an IGate. For my application, I used an ICOM-2730A capable of transmitting at 50W which was hardwired into my Jeep. Any suitable VHF antenna will do ranging from magnetic mounted Nagoya UT-72 or a more permanent solution like a NOMO mount Nagoya NMO-72 using a 2-axis Diamond K400S-NMO Lip mount. For the sake of this guide, the installation of a radio into the vehicle will be assumed.

  • VHF Radio
  • VHF Antenna
  • Raspberry Pi
  • Easy Digi interface
  • GPS Dongle
  • USB Sound Card
  • Portable Battery
  • [optional] USB Hub
Image linked from: Adafruit product website

Raspberry Pis are easily acquired from a variety of locations like Amazon or Adafruit. Running without the graphical interface reduces the processing demands and a Model 3+ or better Pi will be sufficient. Make sure to get a portable USB battery charger of some kind otherwise you'll have a lot of inert equipment that looks cool.

It's optional, but recommended, to get a USB hub that attaches devices vertically. Due to the compact nature of the Raspberry Pi, the plug ends of the Easy Digi and the USB sound card "bleed over" and block use of the ports above/below and to their sides. A vertical hub allows these devices to not interfere with one another.

Easy Digi Interface by KF5INZ

The Easy Digi is available from CliffordWareHAM, KF5INZ, on his eBay store. When purchasing, just specify the radio you'll use and he'll include the matching cables for audio in, audio out, and triggering PTT. For my application, I specified the IC-2730A which resulted in a cable connecting the radio's audio-output directly to the Easy Digi and a cable handling both PTT and audio-input into the radio's control port.

USB GPS Dongle

There are a variety of NMEA-0183 compatible GPS dongles available that plug directly into a USB port. Although the "thumbdrive form factor" UBlox units are extremely popular, there are two reasons not to use it. The first is the dongle's size may inhibit the installation of other USB plugs. The second is that if the Raspberry Pi is under a seat, for instance, it may struggle to receive the GPS signal. A UBlox GPS receiver on a cable like the VK-162 G-Mouse offers unobstructed plugs and the ability to place the antenna in a more optimal location using its magnetic mount. NOTE: Many of these GPS dongles also receive position data from the Russian GLONASS constellation of satellites as well.

USB Audio Dongle

There are also many USB sound cards available but the adapter by Sabrent is cheap and functional. It's simple and small offering the USB connection, an audio input, and an audio output. It's not necessary to purchase any audio cables as they come with the Easy Digi.

Installing the GPS

Just plug it in. Once attached, verify the device is seen by the Raspberry Pi. Generally, it can be found by looking at the devices for one named like ttyACM0, looking for it's activation in the system message queue, or by listing the attached USB devices.


pi@APRS:~ $ls /dev/ttyA*
/dev/ttyACM0

pi@APRS:~ $ lsusb
Bus 001 Device 004: ID 1546:01a7 U-Blox AG [u-blox 7]

pi@APRS:~ $ dmesg
[146215.390810] usb 1-2: new full-speed USB device number 4 using ohci-pci
[146215.930468] usb 1-2: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[146215.930476] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[146215.930480] usb 1-2: Product: u-blox 7 - GPS/GNSS Receiver
[146215.930482] usb 1-2: Manufacturer: u-blox AG - www.u-blox.com
[146215.943836] cdc_acm 1-2:1.0: ttyACM0: USB ACM device

You can watch the NMEA-0183 strings scroll past by monitoring the output, usually on /dev/ttyACM0.


pi@APRS:~ $ sudo cat /dev/ttyACM0
$GPTXT,01,01,02,u-blox ag - www.u-blox.com*50

$GPTXT,01,01,02,HW  UBX-G70xx   00070000 FF7FFFFFo*69

$GPTXT,01,01,02,ROM CORE 1.00 (59842) Jun 27 2012 17:43:52*59

$GPTXT,01,01,02,PROTVER 14.00*1E

$GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20

$GPTXT,01,01,02,ANTSTATUS=OK*3B

$GPTXT,01,01,02,LLC FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFD*2C

$GPRMC,014346.00,A,3919.62422,N,09454.98659,W,0.098,,300422,,,D*60

$GPVTG,,T,,M,0.098,N,0.182,K,D*2C

Installing GPSd

The GPS service daemon makes everything extremely easy. Instead of having to manually interpret the NMEA-0183 strings or identify changed device names, the daemon basically handles everything. Downstream software that uses gpsd can make immediate use of location and timing data.


pi@APRS:~ $ sudo apt install gpsd gpsd-tools

The chrony daemon can handle getting the Raspberry Pi's clock synchronized properly. With an Internet connection, it will grab from NTP servers. With gpsd, it can set the clock from the GPS.


pi@APRS:~ $ sudo apt install chrony

Edit the /etc/chrony/chrony.conf file and add this line to the end in order to pull time from the GPS.


refclock SHM 0 offset 0.5 delay 0.2 refid NMEA

Finally, make sure both the chrony and gpsd services automatically run.


pi@APRS:~ $ sudo systemctl enable gpsd
Synchronizing state of gpsd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable gpsd

pi@APRS:~ $ sudo systemctl enable  chrony
Synchronizing state of chrony.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable chrony
Created symlink /etc/systemd/system/chronyd.service → /lib/systemd/system/chrony.service.

pi@APRS:~ $ systemctl is-active gpsd
active

pi@APRS:~ $ systemctl is-active chrony
active

Now confirm that the GPS is being interpreted properly using cgps utility. It may take awhile for the dongle to begin displaying location information if it does not have a recent cache of ephemeris data.


pi@APRS:~ $ cgps -s
┌───────────────────────────────────────────┐┌──────────────────Seen 19/Used  7┐
│ Time:        2022-04-30T01:49:43.000Z (18)││GNSS   PRN  Elev   Azim   SNR Use│
│ Latitude:         39.32718100 N           ││GP  5    5  33.0   56.0  33.0  Y │
│ Longitude:        94.91645280 W           ││GP 10   10  12.0  251.0  34.0  Y │
│ Alt (HAE, MSL):    731.138,    825.614 ft ││GP 13   13  45.0   69.0  32.0  Y │
│ Speed:             0.09 mph               ││GP 15   15  67.0  131.0  28.0  Y │
│ Track (true, var):     0.0,   1.7     deg ││GP 18   18  62.0  325.0  39.0  Y │
│ Climb:             0.00 ft/min            ││GP 23   23  41.0  262.0  30.0  Y │
│ Status:         3D FIX (1 secs)           ││GP 29   29  55.0  190.0  24.0  Y │
│ Long Err  (XDOP, EPX):  0.80, +/- 39.5 ft ││GP  2    2   6.0  115.0  21.0  N │
│ Lat Err   (YDOP, EPY):  1.21, +/- 59.3 ft ││GP 11   11   0.0  110.0  21.0  N │
│ Alt Err   (VDOP, EPV):  1.83, +/- 36.5 ft ││GP 16   16   9.0  307.0   0.0  N │
│ 2D Err    (HDOP, CEP):  1.45, +/- 27.8 ft ││GP 20   20   8.0   68.0   0.0  N │
│ 3D Err    (PDOP, SEP):  2.34, +/-  109 ft ││GP 24   24   3.0  150.0  25.0  N │
│ Time Err  (TDOP):       1.31              ││GP 30   30   0.0   37.0   0.0  N │
│ Geo Err   (GDOP):       2.68              ││SB133   46  32.0  227.0   0.0  N │
│ ECEF X, VX:    -423422.940 m   -0.010 m/s ││SB135   48  35.0  222.0   0.0  N │
│ ECEF Y, VY:   -4922385.560 m   -0.010 m/s ││SB138   51  43.0  199.0  32.0  N │
│ ECEF Z, VZ:    4020624.050 m    0.010 m/s ││QZ  1  193   n/a    0.0   0.0  N │
│ Speed Err (EPS):       +/-  1.0 mph       ││QZ  2  194   n/a    0.0   0.0  N │
│ Track Err (EPD):        n/a               ││QZ  3  195   n/a    0.0   0.0  N │
│ Time offset:            0.024121106 s     ││                                 │
│ Grid Square:            EM29nh08          ││                                 │
└───────────────────────────────────────────┘└─────────────────────────────────┘

Installing the USB Sound Card

Just plug it in. Once attached, verify the device is seen by the Raspberry Pi. For the Direwolf configuration file, you will need the device identifiers. These can be found using the aplay and arecord commands or by listing the attached USB devices.


pi@APRS:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: I82801AAICH [Intel 82801AA-ICH], device 0: Intel ICH [Intel 82801AA-ICH]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
pi@APRS:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: I82801AAICH [Intel 82801AA-ICH], device 0: Intel ICH [Intel 82801AA-ICH]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: I82801AAICH [Intel 82801AA-ICH], device 1: Intel ICH - MIC ADC [Intel 82801AA-ICH - MIC ADC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

pi@APRS:~ $ lsusb
Bus 001 Device 006: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)

pi@APRS:~ $ sudo dmesg
[156688.382091] usb 1-2: new full-speed USB device number 6 using ohci-pci
[156688.890425] usb 1-2: New USB device found, idVendor=0d8c, idProduct=0014, bcdDevice= 1.00
[156688.890430] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[156688.890433] usb 1-2: Product: USB Audio Device
[156688.890434] usb 1-2: Manufacturer: C-Media Electronics Inc.
[156688.906715] input: C-Media Electronics Inc. USB Audio Device as /devices/pci0000:00/0000:00:06.0/usb1/1-2/1-2:1.3/0003:0D8C:0014.0002/input/input8
[156688.966044] hid-generic 0003:0D8C:0014.0002: input,hidraw1: USB HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on usb-0000:00:06.0-2/input3
[156689.157446] mc: Linux media interface: v0.10
[156689.711082] usbcore: registered new interface driver snd-usb-audio

Make note of the card number and device number as these will be used later.

Installing the Easy Digi

Just plug it in. Once attached, verify the device is seen by the Raspberry Pi in either the system messages or in the device hierarchy. Generally, unless there are other serial USB devices installed, it will appear as /dev/ttyUSB0. Make note of the device name as it will be used in the Direwolf configuration for triggering the radio's Push To Talk (PTT) circuit.


pi@APRS:~ $ ls /dev/ttyUSB*
/dev/ttyUSB0

pi@APRS:~ $ lsusb
Bus 001 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

pi@APRS:~ $ sudo dmesg
[ 1177.031076] usb 1-1.1.3: new full-speed USB device number 7 using dwc_otg
[ 1177.183584] usb 1-1.1.3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[ 1177.183598] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1177.183608] usb 1-1.1.3: Product: FT232R USB UART
[ 1177.183617] usb 1-1.1.3: Manufacturer: FTDI
[ 1177.183626] usb 1-1.1.3: SerialNumber: A9ZZUW1L
[ 1177.236024] usbcore: registered new interface driver usbserial_generic
[ 1177.236102] usbserial: USB Serial support registered for generic
[ 1177.247940] usbcore: registered new interface driver ftdi_sio
[ 1177.248015] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 1177.248501] ftdi_sio 1-1.1.3:1.0: FTDI USB Serial Device converter detected
[ 1177.248649] usb 1-1.1.3: Detected FT232RL
[ 1177.251783] usb 1-1.1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1194.185744] w1_master_driver w1_bus_master1: Attaching one wire slave 00.680000000000 crc a7
[ 1194.190785] w1_master_driver w1_bus_master1: Family 0 for 00.680000000000.a7 is not registered.

Installing Direwolf

There are two fundamental ways to install Direwolf. The first is directly from the source code repository and the second is from the package repository. For brevity, the output from these commands is omitted. In summary, the source is downloaded from github, configured via cmake, built with make and installed.


pi@APRS:~ $ git clone https://github.com/wb2osz/direwolf.git/
pi@APRS:~ $ cd direwolf
pi@APRS:~ $ mkdir build && cd build
pi@APRS:~ $ cmake ..
pi@APRS:~ $ make -j4
pi@APRS:~ $ sudo make install
pi@APRS:~ $ make install-conf

For the less sadist HAM radio operators, just install it from the package repository. It may not be the most bleeding edge version, but unless you are doing something extremely fancy, you won't need bleeding edge features.


pi@APRS:~ $ sudo apt install direwolf

Configuring Direwolf

When installing Direwolf from repositories, it often does not include a baseline configuration file. The following can be pasted into /etc/direwolf.conf to get started.


#############################################################
#                                                           #
#               Configuration file for Dire Wolf            #
#                                                           #
#                   Linux version                           #
#                                                           #
#############################################################

#############################################################
#                                                           #
#               FIRST AUDIO DEVICE PROPERTIES               #
#               (Channel 0 + 1 if in stereo)                #
#                                                           #
#############################################################

ADEVICE  plughw:1,0
ACHANNELS 1

#############################################################
#                                                           #
#               GPS Device PROPERTIES                       #
#                                                           #
#############################################################

GPSD

#############################################################
#                                                           #
#               CHANNEL 0 PROPERTIES                        #
#                                                           #
#############################################################

CHANNEL 0
MYCALL KD3BUG-9
MODEM 1200
PTT /dev/ttyUSB0 RTS DTR

#############################################################
#                                                           #
#               BEACONING PROPERTIES                        #
#                                                           #
#############################################################

TBEACON SYMBOL=jeep COMMENT="[Direwolf] Be Excellent to Each Other" VIA=WIDE1-1,WIDE2-1
SMARTBEACONING 45 2:30 5 10:00 0:30 30 255

#############################################################
#                                                           #
#               DIGIPEATER PROPERTIES                       #
#                                                           #
#############################################################

DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE

#############################################################
#                                                           #
#               INTERNET GATEWAY                            #
#                                                           #
#############################################################

IGSERVER noam.aprs2.net
IGLOGIN KD3BUG-9 5-digit code

TBEACON SENDTO=IG SYMBOL=jeep COMMENT="Direwolf mobile iGate" VIA=WIDE1-1,WIDE2-1

#############################################################
#                                                           #
#                LOGGGING PROPERTIES                        #
#                                                           #
#############################################################

LOGDIR /var/log/direwolf/

What do all of these configurations mean?


ADEVICE  plughw:1,0
ACHANNELS 1

These first two are related to the audio interface. Direwolf is a program that converts digital data into AFSK audio and therefore it needs to know where to send those sounds. The ADEVICE directive informs Direwolf of the card number and device number. For my installation, the Sabrent card was 1 and it's corresponding device was 0. The ACHANNELS directive could be either 1 or 2 meaning mono or stereo respectively.


GPSD

This GPSD directive is quite simple and directs Direwolf to obtain location information from the GPS daemon configured earlier. If Direwolf was installed from the package repository, there should be no issues. There is a chance that compiling from source may not include the necessary gpsd interfaces. If errors arise, reference this guide "Adding a USB GPS Receiver to Direwolf to create an APRS Tracker" for recompilation.


CHANNEL 0
MYCALL KD3BUG-9
MODEM 1200
PTT /dev/ttyUSB0 RTS DTR

Except for the PTT directive, these are pretty static. The CHANNEL directive is used if Direwolf is going to utilize more than one audio connection and allows it to direct actions. For most use cases, this will be set to 0. The MYCALL directive is set to your callsign and SSID. The SSID typically ranges from 0-15 where the numbers had legacy meanings from the early days of APRS. It is common for handhelds to use -7 and mobiles to use -9. The MODEM directive instructs Direwolf to use 1200 baud AFSK for VHF instead of 9600 baud GMSK for UHF.

There are many variations for how the PTT directive is used. For the Easy Digi, /dev/ttyUSB0 RTS DTR instructs Direwolf to use the embedded USB serial device's RTS and DTR lines for triggering the PTT. Without an Easy Digi, there are many people that will use the Raspberry Pi's GPIO pins using techniques like those documented in this article with Direwolf configurations setup in accordance with section 9.2.9.2 PTT with General Purpose I/O (GPIO) of the User Guide. Other implementations use a popular USB sound card that features GPIO pins and they are configured in accordance with section 9.2.9.5 PTT with C-Media CM108/CM119 GPIO of the User Guide.


TBEACON SYMBOL=jeep COMMENT="[Direwolf] Be Excellent to Each Other" VIA=WIDE1-1,WIDE2-1
SMARTBEACONING 45 2:30 5 10:00 0:30 30 255

Stationary APRS sites will use the PBEACON directive for reporting position while mobile sites will use the TBEACON directive. They are generally identical in terms of syntax except that TBEACON can omit manually including the geographic coordinates. Simply choose the symbol and optional comment you wish to be included in your transmission along with a propagation path. WA8LMF provides an excellent overview of traditional and contemporary APRS paths as does the article "How APRS paths work."

Adding the optional SMARTBEACONING directive allows Direwolf to transmit location information more dynamically based on movement rather than at fixed intervals. The first numbers 45 2:30 establish a "high movement speed" of 45mph over which Direwolf will beacon every two minutes and thirty seconds. The second numbers 5 10:00 instruct Direwolf to beacon every ten minutes when moving less than 5mph. Direwolf will use a proportional beacon interval when moving at speeds between the high and low settings. The final numbers 0:30 30 255 tell Direwolf to beacon no more than thirty seconds apart, to beacon again if the travel bearing changes by 30 degrees, and lastly to beacon at lower speeds only if the travel bearing changes significantly. More information on Smart Beaconing can be read at "What Is Smart Beaconing."


DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE

Basically, unless you are a wizard with Regular Expressions and really know what you're doing, utilize the default DIGIPEAT directive. This line will match APRS paths and repeat the received packets from your station.


IGSERVER noam.aprs2.net
IGLOGIN KD3BUG-9 5-digit code

These two directives control Direwolf's access to the Internet APRS databases allowing it to serve as an IGate. Each user needs their own five digit access code which can be obtained from http://apps.magicbug.co.uk/passcode/. The first directive instructs Direwolf which of the various APRS regional servers to interact with. The second directive authenticates Direwolf's access.


TBEACON SENDTO=IG SYMBOL=jeep COMMENT="Direwolf mobile iGate" VIA=WIDE1-1,WIDE2-1

This TBEACON is different than the previous entry. It includes SENDTO=IG which instructs Direwolf to send items to the IGate instead of only out the radio interface. From the prior GPSD directive, this one will also utilize the GPS daemon to obtain geographic coordinates for advertising itself.


LOGDIR /var/log/direwolf/

This final directive instructs Direwolf where to save it's activity log. By default, the files will be named in accordance with a YYYY-MM-DD.log convention. At this time, it's not possible to set the name to anything else but you can direct where to save them. Make sure the directory exists and you have write permissions to that path.

Configuring Wireless Connection

Your IGate will be useless if the Raspberry Pi is not connected to the Internet. Fortunately, you only need to add one or two entries to the /etc/wpa_supplicant/wpa_supplicant.conf file to allow the Raspberry Pi to connect to available WiFi stations. Add lines similar to the following but tailor them to match your own mobile hotspot.


network={
        ssid="KD3BUG iPhone"
        key_mgmt=WPA-PSK
        psk="NotMyRealPasswordSilly"
}

It makes sense to add an additional set of lines for the Raspberry Pi to connect to any open WiFi. Setting the key_mgmnt=NONE directive matches non-WEP, non-WPA SSIDs. The priority=-999 directive just makes it the last one used in case a preferred access point, like your mobile hotspot, is available.


network={
        key_mgmt=NONE
        priority=-999
}

Connecting the IC-2730A

This particular step is specific to the IC-2730A but is conceptually identical to any other radio. The nice part about the Easy Digi, like its more expensive cousin the Signalink, is that it basically adapts the computer side to any possible radio.

This side of the Easy Digi is simple. The blue cable has a USB connector ... that goes into the USB port. The audio connectors are also easy, but easy to mix up accidentally. Connect the "TX AUDIO FROM PC" cable to the green colored port on the USB sound card - that is the sound output. Connect the "RX AUDIO TO PC" cable to the purple or pink colored port on the USB sound card - that is the microphone input.

For an IC-2730A, the radio side of the Easy Digi is pretty easy. The white cable labeled "Radio Mic Jack" can connect to two locations. Either the mic jack on the front panel display or the mic jack on the radio unit itself. Obviously using the front panel display will prevent you from using your actual mic so the better choice is on the radio unit. The radio has two ports (that would be covered by the front panel). The port on the left should already be in use connecting the front panel which leaves the one on the right - which if you read the manual, is a mic port.

For an IC-2730A, you have a choice of two audio output ports on the back of the radio. Using the left audio output port will result in BOTH channels of the radio getting sent to the Raspberry Pi. You don't want this. Using the right audio output port will send only the right band audio for processing by Direwolf. This is ideal because 1) you don't have to hear the AFSK sounds of APRS and 2) you can still monitor the audio from the left band.

Running Direwolf

With the hardware installed and the configuration file prepared, it's time to run Direwolf. Using the -c directive instructs Direwolf which configuration file to load. This can be handy for having multiple configurations for different use cases - just transmitting, just digipeating, just IGating, etc. The -t 0 directive tells the application not to use fancy colors in output which can help to avoid the Raspberry Pi's display getting funky.


pi@APRS:~ $ direwolf -t 0 -c /etc/direwolf.conf

Of course, for a mobile application, you're unlikely to have a keyboard and monitor attached to the Raspberry inside your vehicle. I added a custom line to the /home/pi/.profile file in order to pause for the GPS to synchronize and set the Raspberry's clock. Then, knowing Direwolf would write to a log file named after the date, I quickly touch that log file to create it and then tail the file in case I do happen to attach a small monitor for watching. Lastly, I put a small script together to check if Direwolf is already running and execute it if the process is not detected. This script is run every five minutes from a cronjob to restore it in the event of a crash so that no interaction is necessary while driving.

The lines added to the bottom of the /home/pi/.profile file:


printf "\nCTRL-C to cancel automatically following the APRS Direwolf log.\n"
sleep 120
touch /var/log/direwolf/`date +%F`.log
tail -f /var/log/direwolf/`date +%F`.log

The quick auto_aprs.sh script to run Direwolf if it's not detected:


#! /bin/bash

echo "[*] searching for Direwolf process"

if ps -A | grep direwolf; then
   echo "[*] direwolf detected - no action"
else
   echo "[!] direwolf missing - starting APRS"
   direwolf -t 0 -c /etc/direwolf.conf
fi

Lastly, the line to add via crontab -e to keep Direwolf running:


*/5 * * * * /home/pi/auto_aprs.sh

Conclusion

This guide should get you 99% to your end solution. After setting everything up, I embarked on an 1100 mile drive and my family was able to follow my progress easily even in regions without IGate coverage. Sure, it could have been done directly with the APRSdroid or APRS.fi apps directly inputting to the databases, but that isn't any fun and also does not provide functionality to the areas you pass through (my station processed 286 unique APRS stations).

de KD3BUG



More site content that might interest you:

Orrrrr ... it's an excuse to play video games at work under the guise of "work."


Try your hand at fate and use the site's continuously updating statistical analysis of the MegaMillions and PowerBall lotteries to choose "smarter" number. Remember, you don't have to win the jackpot to win money from the lottery!


Tired of social media sites mining all your data? Try a private, auto-deleting message bulletin board.


coinbase