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:


WVDIAL

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.

DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB0/tty/ttyUSB0
DEVNAME=/dev/ttyUSB0
MAJOR=188
MINOR=0
SUBSYSTEM=tty
USEC_INITIALIZED=19091176
ID_VENDOR=Prolific_Technology_Inc.
ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.\x20
ID_VENDOR_ID=067b
ID_MODEL=USB-Serial_Controller_D
ID_MODEL_ENC=USB-Serial\x20Controller\x20D
ID_MODEL_ID=2303
ID_REVISION=0400
ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller_D
ID_TYPE=generic
ID_BUS=usb
ID_USB_INTERFACES=:ff0000:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=pl2303
ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc.
ID_MODEL_FROM_DATABASE=PL2303 Serial Port
ID_PATH=platform-3f980000.usb-usb-0:1.2:1.0
ID_PATH_TAG=platform-3f980000_usb-usb-0_1_2_1_0
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
TAGS=:systemd:

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

ACTION=="add",ENV{ID_BUS}=="usb",ENV{ID_SERIAL}=="Prolific_Technology_Inc._USB-Serial_Controller_D",SYMLINK+="gps"

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 
ACHANNELS 1
CHANNEL 0
MYCALL *** Your Call Sign ***
MODEM 1200
GPSNMEA /dev/gps
TBEACON SENDTO="IG" COMPRESS=1 VIA=WIDE1-1,WIDE2-1 SYMBOL=car
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"
IGSERVER noam.aprs2.net
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.

#!/bin/bash
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