Table of Contents
Raspberry Pi iGate Setup
Assumptions
- You are running this on a Raspberry Pi with built-in WiFi
- Running Raspberry OS Lite 32 Bit (Bullseye 2022-09-22).
- DireWolf DEVELOPMENT version 1.7 E (Jan 7 2023)
- This system will run headless, without a monitor or external display connected.
- You will be using a USB RTL-SDR dongle connected to your Pi.
- We will be using the default user pi for everything. Please change this to meet your requirements.
- There is no GPS connected. The Pi will rely on NTP for accurate timekeeping.
Before You Begin
Download Raspberry OS Lite 32 Bit Lite from https://www.raspberrypi.org/downloads/raspbian/ Not tested on 64 Bit (if anyone has tested please update to say Tested and Works on 64 Bit Lite
Get an APRS Password from http://apps.magicbug.co.uk/passcode/
Extract the downloaded tar file. Using Raspberry Pi Imager https://www.raspberrypi.com/software/ using the “Operating System” button select “Use Custom” and select the extracted img file. In this example, it is “2022-09-22-raspios-bullseye-armhf-lite.img” Be sure to select the correct Storage device. Click the Setting, cogwheel, button. These settings may change in future versions. These are current as of v1.7.3
Raspberry Pi Imager Advanced Menu
- Set hostname: igate
- [x] Enable SSH
- [x] Use password authentication
- [x] Set username and password
- Username: pi
- Password: raspberry
- [x] Configure wireless LAN
- SSID: <your wireless network>
- Password: <your wireless network password>
- Wireless LAN country: GB (change to match your location)
- [x] Set locale settings
- Time zone: Europe/Dublin
- Keyboard layout: gb
- [ ] Play sound when finished
- [x] Eject media when finished
- [ ] Enable telemetry
Verify your Operating System, Storage and Advnaced Settings are all correct and Write the image to SD Card. Once complete insert the SD Card in to your Pi and power it up. It may take a few minutes.
Update System
Logon to your Pi via ssh and preform a system update
sudo apt update && sudo apt full-upgrade -you
Depending on the number of updates this may take a few minutes. Reboot your pi when all the updates are installed
sudo reboot
Set Static IP
This is best contoled via a dhcp reservation on your router or on your dhcp server. If you choose to manually configure this on your pi please follow the steps below. Adjust IP address to match your networks configuration.
Manually Set Raspberry Pi IP Address
sudo nano /etc/dhcpcd.conf
# Example static IP configuration: interface wlan0 static ip_address=192.168.0.30/24 #static ip6_address=fd51:42f8:caae:d92e::ff/64 static routers=192.168.0.1 static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
Installing Direwolf From Source
Install Dependencies
sudo apt install git build-essential libasound2-dev libudev-dev rsyslog logrotate
Get Direwolf Source Code and build it
cd ~ git clone https://github.com/wb2osz/direwolf.git cd direwolf git checkout dev mkdir build && cd build cmake -DUNITTEST=1 .. make -j4 make test sudo make install make install-conf
Direwolf First Test
cd ~ direwolf
You should see something like this
Dire Wolf version … Audio device for both receive and transmit: default Could not open audio device default for input No such file or directory Pointless to continue without audio device.
The default configuration files created in youi home directory provide a good starting point. Since we are setting up a receive only iGate using a RTL-SDR Dongle we will be using the sdr.conf file.
Edit the sdr.conf file
cd ~ sudo nano sdr.conf
We need to update a few lines. Change MYCALL xxxxx to your callsign plus SSID. For example
MYCALL EI5IEB-10
Update IGSERVER to one in your region. For example
IGSERVER euro.aprs2.net
In order for send received pactked to the internet we need to update IGLOGIN with our login details. Callsign-SSID and passcode. Passcode can be generated here https://apps.magicbug.co.uk/passcode/ Please use your callsign. For example. xxxxx is my passcode.
IGLOGIN EI5IEB-10 xxxxx
If you want your iGate to disply on aprs.fi add the following line to the end of the sdr.conf file. Modify lat and long to your location.
PBEACON sendto=IG delay=0:30 every=10:00 symbol="igate" overlay=R lat=53.000000 long=-06.000000 comment="144.800MHz IGate | RPi | RTL-SDR"
We want to log what packets we receive for future analysis and to get an indication of the area covered by our iGate. Add the following lines to the end of the sdr.conf file.
# Logging LOGDIR /var/log/direwolf/
We need to create the log directory referanced the the sdr.conf file and make sure that it is writable by the pi user.
cd ~ sudo mkdir /var/log/direwolf sudo chown -hR pi:pi /var/log/direwolf
The main parts of Direwolf are now configured.
Install RTL-SDR Software From Source
cd ~ sudo apt install cmake build-essential libusb-1.0-0-dev git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON make sudo make install sudo ldconfig
Modify raspi-blacklist.conf If Required
In my setup the dongle “just worked” however this is not always the case. The Pi may be using a different device driver. To prevent this from happening we need to blacklist the undesired driver.
sudo nano /etc/modprobe.d/raspi-blacklist.conf
The file is empty by default. Add the following lines.
blacklist dvb_usb_rtl28xxu blacklist dvb_usb_v2 blacklist rtl_2830 blacklist rtl_2832 blacklist r820t
Reboot the Pi
sudo reboot
Starting Direwolf On Boot
Next we need to create a systemd service so direwolf starts on boot. We also redirect stdout and stderr to syslog, so we can treat it as a log file.
Create direwolf.service file
sudo nano /lib/systemd/system/direwolf.service
With following content
[Unit] Description=Direwolf Daemon Wants=network-online.target After=sound.target syslog.target network-online.target [Service] User=pi ExecStart=/bin/sh -c 'rtl_fm -f 144.8M - | direwolf -c /home/pi/sdr.conf -r 24000 -D 1 -' StandardOutput=syslog StandardError=syslog SyslogIdentifier=direwolf [Install] WantedBy=multi-user.target
Symlink the service
sudo ln -s /lib/systemd/system/direwolf.service /etc/systemd/system/direwolf.service
Reload systemctl. Enter your password when prompted.
systemctl daemon-reload
Enable the direwolf service. Enter your password when prompted.
systemctl enable direwolf
Enable the systemd-networkd-wait-online service so Direwolf starts after the network is up. . Enter your password when prompted.
systemctl enable systemd-networkd-wait-online
Reboot the Pi
sudo reboot
If all went to plan Direwof should have started automatically. You can verify this with
ps aux | grep direwolf
You should see a line with the following content.
direwolf -c /home/pi/sdr.conf -r 24000 -D 1 -
Next, we can configure logging application-level messages and errors from the Direwolf application. This is optional.
Optional
Configure Direwolf Web Log Viewer
You might be interested in an easy way of showing what stations you are hearing. Direwolf outputs its logs in a delimited format which can be opened and parsed by a variety of applications. However, sometimes a web GUI is much nicer. Alfredo, IZ7BOJ, has developed a PHP web statistics viewer which parses the logs and displayed the results on a nicely formatted table presented on a self-hosted website. This is detailed here Direwolf Web Log Viewer
Configure Application Level Logging
Earlier we configured the direwolf systemd service file to redirect all stdout and stderr to syslog. So it's easier to read we need to redirect the log entries to their own file.
Create a .conf file for rsyslog
nano /etc/rsyslog.d/direwolf.conf
And enter the following
if $programname == 'direwolf' then /var/log/direwolf/direwolf.log & stop
Then create a logrotate configuration file
nano /etc/logrotate.d/direwolf
And enter the following. Feel free to edit the parameters to suit your needs
/var/log/direwolf/aprs.log { rotate 5 daily missingok } /var/log/direwolf/direwolf.log { rotate 5 daily missingok postrotate invoke-rc.d rsyslog rotate > /dev/null endscript }
Reference
APRS SSID Recommendations 6 Feb 2012
From http://www.aprs.org/aprs11/SSIDs.txt
0 Your primary station usually fixed and message capable 1 generic additional station, digi, mobile, wx, etc 2 generic additional station, digi, mobile, wx, etc 3 generic additional station, digi, mobile, wx, etc 4 generic additional station, digi, mobile, wx, etc 5 Other networks (Dstar, Iphones, Androids, Blackberry's etc) 6 Special activity, Satellite ops, camping or 6 meters, etc 7 walkie talkies, HT's or other human portable 8 boats, sailboats, RV's or second main mobile 9 Primary Mobile (usually message capable) 10 internet, Igates, echolink, winlink, AVRS, APRN, etc 11 balloons, aircraft, spacecraft, etc 12 APRStt, DTMF, RFID, devices, one-way trackers*, etc 13 Weather stations 14 Truckers or generally full time drivers 15 generic additional station, digi, mobile, wx, etc