TCP/IP Only Direwolf Tracker

So I am about to head to the USA for a few weeks for a holiday.
I am quite keen to track my driving around Texas and LA but I am not that keen to take a large radio with me to do APRS tracking…

I have done this before and quite frankly it was just too annoying to take Radio, Tiny Track 4, Antenna, Mag Base, Cables and all the other stuff that is required to make it work.

So I decided to build a raspberry Pi with a GSM modem and GPS module in an effort to cut down on the required hardware to take for this.

So Raspberry Pi 3+ , Sierra Wireless 4G GSM Modem, GPS Module is the hardware that I needed to take with me..

I intend to 3D print a case for it all so it’s nicely presented, but that might done in the next few weeks.

But on to the setup:


I setup wvdial to establish the 4G connection on the GSM network .

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = AT+CGDCONT=1,"IP","internet"

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Password = { }
New PPPD = yes
Username = { }
Modem = /dev/ttyUSB3
Baud = 9600

I needed to make wvdial start on boot – so its really headless so had to set the following up.

On raspbian create a file /etc/network/interfaces.d/pppd
And copy the following code into that file.. this will enable the ppp0 interface on boot, and dial your internet connection, once its established OpenVPN will connect and allow you to connect to the unit with a known IP address.

auto ppp0
iface ppp0 inet wvdial

I also added ufw firewall and only allowed port 22 for SSH to be able to connect to the Raspberry Pi – this is fairly self explanatory so will not document it here, and only because its running on a public IP address, its best to keep it locked down as much as you can.

GPS Module

Because the Sierra Wireless modem take 3 tty devices, sometime the GPS module would not be /dev/ttyUSB0 at times, and not cause tracking properly.

I had to create a symlink so I always had a consistent device so chose the logical /dev/gps

I created the file : /etc/udev/rules.d/99-usbserial.rules and included details from the following.

udevadm info --query=property --name=/dev/ttyUSB0 | grep SERIAL

This will give you results similar to the following – this is full output without the grep as suggested in the previous line.

Because my GPS unit has no serial number, or a short code, I had to use the full name of the device, which I found from the following.

ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc.
DEVLINKS=/dev/gps /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0-port0

But as I mentioned, I had no ID_SERIAL_SHORT or anything unique for my device so had to use ID_SERIAL full name – put the following with your settings into your file /etc/udev/rules.d/99-usbserial.rules


Once that was set, every reboot makes the GPS module appear as /dev/gps which is good for Direwolf.

Direwolf Tracker

So I built a minimal Direwolf config as previously documented here, and many places, for gpsd support and enabled Smart Beaconing and GPS with a Custom Beacon advising of my Mobile number and the fact I was on Holiday in the US.

ADEVICE - default 
MYCALL *** Your Call Sign ***
MODEM 1200
GPSNMEA /dev/gps
SMARTBEACONING 48 0:45 5  0:90 0:05 15 25
CBEACON SENDTO="IG" COMPRESS=1 info="> Some Text telling you what I am up to"
IGLOGIN *** Your Call Sign *** *** APRS Password ***

As you can see it is a fairly basic config, no digipeating and only a TBeacon for Tracker and a CBeacon for custom note sent every 30 minutes.

Because Direwolf expects to find a Sound card, and the raspberry Pi does not have an input one, and I don’t need one anyway, I had to run Direwolf with some funny shell code to make it start on boot, with no standard in existing when no user is logged in.

This is the code I found to run some software with standard in with temporary nothingness.

fifo=$(mktemp -u) &&
  mkfifo "$fifo" &&
  (rm "$fifo" && direwolf -c /etc/direwolf/direwolf.conf -  <&3 3<&- &) 3<> "$fifo"

I can’t think of much more to put here for this config.
Just modify your smartbeaconing settings, I am still playing with it over the next while before holiday, so I would not recommend using them, but they work, just not sure if they are ‘the best’.

Once I have printed the 3D case, I will take some photos but am looking forward to only having to take the Pi with me as my intention it to build a case with the printout for the GPS puck to sit in – so will only need to take a power cable to power the pi and have no excess wires hanging around.

Leave a Reply