APRS iGate RTL dongle on Orange or Raspberry Pi Zero

Instructions mostly lifted from  G6NHU. If you want a quick and easy setup use his prebuilt image.

Initially I installed on an Orange Pin Zero but then I wanted to free that for another project so I reinstalled on a Raspberry Pi zero that had been sitting unused following the same instructions.

For Orange Pi zero I installed Armbian Buster. There are many different variants of OrangePi so check carefully to find the version of Ambian that matches your Pi.

For raspberry pi zero I installed Stretch lite

Extract and copy to microSD card.
Prepare micro SD card by deleting all partitions (no need to format) then use Etcher  I used 8GB Kingston Class 10

Put an empty file called ssh on boot partition to allow ssh access.
Boot pi , log into home hub or equivalent find ip address assigned to pi  and connect via terminal or ssh

sudo fs_resize (Not needed for pi zero it atomatically resized on first boot

)

reboot

sudo apt-get update

sudo apt-get dist-upgrade

sudo apt-get install libasound2-dev

sudo apt-get install git

sudo apt-get install cmake build-essential libusb-1.0-0-dev

cd ~

git clone https://www.github.com/wb2osz/direwolf

cd ~/direwolf
make
sudo make install
make install-conf

cd ~
git clone git://git.osmocom.org/rtl-sdr.git             –Got this  :  “fatal: read error: Connection reset by peer” when I tried 20 May 2019 so I used this mirror on github instead: 
git clone https://github.com/osmocom/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
sudo cp ../ -DDETACH_KERNEL_DRIVER=ON
make
sudo make install
sudo ldconfig

cd ~
sudo nano sdr.conf
Change the xxx to your callsign (including SSID)

In the section below, edit the line starting with IGSERVER to be the correct one for your region.  I’m in Europe so my line reads IGSERVER euro.aprs2.net
Scroll further down and you’ll find a line that starts with IGLOGIN.  Change the xxx to be the same as the callsign you entered above (including SSID) and then change the numbers 123456 to your passcode.

You now need to add an extra line at the bottom of the file.
PBEACON sendto=IG delay=0:30 every=15:00 symbol="igate" overlay=R lat=xx.xxxxxx long=yyy.yyyyyy COMMENT="Callsign iGate | DireWolf 1.5 on RPiZero+RTL-SDR"

Note that although it’s spanned over two lines above, you should enter this as one continual line in your file. Replace xx.xxxxxx with your latitude, yyy.yyyyyy with your longitude and  callsign with your callsign (including SSID). Be aware that there is a space between the lat and long values.

Reboot.

Test:
rtl_fm -f 144.80M - | direwolf -c sdr.conf -r 24000 -D 1 -

The last thing to do is to set everything to start automatically
cd ~
sudo nano dw-start.sh

Find the line containing the radio frequency and edit it to remove the hash at the start and change the frequency to whatever is appropriate in your area.  In the UK, APRS is on 144.800 MHz .

Save the file and then run the following command to make the script executable.
sudo chmod +x dw-start.sh

test the start up script

pi@raspizero:~ $ ./dw-start.sh
Direwolf in GUI mode start up
DISPLAY=:0
Did not find an X terminal emulator. Reverting to CLI mode
———————–
Error: screen is not installed but is required for CLI mode. Aborting
pi@raspizero:~ $ sudo apt install screen

Finally, add a line to cron which will run once a minute to check whether Dire Wolf is running and if not, it will restart it.
crontab -e

If this is the first time you’ve edited the crontab, you’ll get a prompt asking which editor to use – Just hit enter to select nano as the default.

Scroll down to the bottom and paste the following line.

* * * * * /home/pi/dw-start.sh >/dev/null 2>&1
This will run every minute of every hour, every day etc  I changed it to very 5 mins as I think Ipswich can live without this service for up to 5 mins and it’s 1/5 of the load on the the APRSIS network if there is a recurring fault:
*/5 * * * * /home/pi/dw-start.sh >/dev/null 2>&1

Reboot your Raspberry Pi and once it’s restarted, it will automatically connect to the APRS network and operate as a receive only iGate. Nothing will be echoed to the display while it’s running like this so you can check the status on aprs.fi or login in and run
sudo journalctl -o cat -af -u direwolf

Direwolf  installed on OrangePi zero

Marrold provides instructions for a raspberry pi . I followed them verbatim on Armbian_20.02.1_Orangepizero_buster_current_5.4.20.7z

Running as a service:

Create user:

sudo adduser --system --no-create-home --group direwolf
sudo usermod -g audio -G audio direwolf

Copy .service files from direwolf/systemd to /lib/systemd/system

sudo cp ~direwolf/systemd/dir*                    /lib/systemd/system

To check Direwolf is running run the following:

systemctl status direwolf

To restart Direwolf, run the following:

systemctl restart direwolf

To view the logs in real time:

tail -n 100 -f /var/log/direwolf/direwolf.log