APRS RX only iGate Direwolf Raspberry Pi usb soundcard dongle

In continuation with the APRS iGate experiments, next on the list was an iGate on raspberrypi with a soundcard.

Required:
Rapberrypi 1 connected to internet
3d Sound usb dongle
download g6nhu custom built Raspberry Pi image (from https://sourceforge.net/projects/amateur-radio-aprs-igate/files/)
2m HT
3.5mm mono to 3.5mm stereo audio cable (from HT speaker port to usb sound dongle mic port)



Lets get busy:


g6nhu custom built Raspberry Pi image is a 1.6Gb file which will expand to approximately 4Gb when you decompress it.  Unzip it and write it to an SD card.  You don’t need a high capacity SD card, this image will fit on a 4Gb card and work perfectly

connect the usb sound and network to raspberry and boot it up. You would need to know what your internet gateway has assigned the RPI IP over DHCP by logging into the gateway and looking at the DHCP table. SSH to the ip using putty (can be downloaded form internet for free) and login to the RPI using user pi and password raspberry.

I have experienced that when direwolf was run, the following error was encountered

Signal caught, exiting!
User cancel, exiting…
Illegal instruction


to correct this, following procedure

cd ~
sudo cp sdr.conf sdr.old
git clone https://www.github.com/wb2osz/direwolf
cd ~/direwolf
make
sudo make install
make install-rpi
make install-conf
cd ~


now need to see what card and device number the usb sound card has been assigned by running aplay -l



we can see that the card is 1 and device is 0, now to the config files. 

nano direwolf.conf

look for below and change RED as per your setup/callsign 

ADEVICE  plughw:1,0
MYCALL YOUR-CALL-SIGN
PBEACON delay=1  every=30 overlay=S symbol="digi" lat=33^35.78N long=073^01.78E power=50 height=20 gain=4 comment="RWP-PAKISTAN-PIGATE-144.800" via=WIDE1-1,WIDE2-1

IGLOGIN AP2CJ-2 PASSCODE
PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=33^35.78N long=073^01.78E comment="RWP-PAKISTAN-PIGATE-144.800

save and exit


nano dw-start.sh

un-comment 
DWCMD="direwolf -a 100"


comment out 
#DWCMD="bash -c 'rtl_fm -f 144.80M - | direwolf -c sdr.conf -r 24000 -D 1 -'"

save and exit

now to set the mic level of usb sound card, run alsamixer

press F6 and select the USB sound card, then press F5 and select CAPTURE, using up/down arrow key set the mic level and exit


The last thing to do is to configure the system so that the APRS iGate starts automatically whenever you reboot the Raspberry Pi.  Enter the following command:

crontab -e

Scroll down to the bottom and you will see the following line.
#* * * * * /home/pi/dw-start.sh >/dev/null 2>&1

Delete the # at the start of that line.
Save the file by pressing ctrl-x, then hit the Y key and then press enter.

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 your status on aprs.fi by searching for the callsign you entered (including SSID).  You don’t even need to log into the Raspberry Pi, the gateway will start automatically within ninety seconds of rebooting.



IMPROVEMENT:


Overlay filesystem

One of the best ways to mitigate both these issues is to change the root file system to read-only. This would be fine except for all those files that actually need to be written and modified during the normal execution! There is however a neat solution to this problem – Overlay Filesystem – which is now built into the Linux kernel. This is a slightly complex, but very useful capability which creates essentially a merged filesystem with an “upper” and “lower” layer. In our case, we can set the “lower” layer to be the read-only root filesystem and the “upper” layer to be a RAM-based temporary filesystem to store those files that are changed during operation. When the power is cycled, the system will come up in the state of the “lower” file system which is in a clean state.
The final component needed is somewhere to store persistent data that needs to remain across reboots (such as log files and a small number of other variables).
Fortunately, there are a number of scripts around that simplify the creation of such an environment. For this project, I’ve used one created by Pavel Pisa from Czech Technical University, Prague. Here’s a presentation describing it: init-overlay. Setting this up is fairly straight forward:

$cd /sbin
$sudo wget https://github.com/ppisa/rpi-utils/raw/master/init-overlay/sbin/init-overlay
$sudo wget https://github.com/ppisa/rpi-utils/raw/master/init-overlay/sbin/overlayctl
$sudo chmod +x init-overlay overlayctl
$sudo mkdir /overlay 
$sudo overlayctl install 
$sudo reboot
 
This is all that’s needed! Read the contents of the two scripts to understand what they are doing if you are interested. Once the overlay filesystem is active, you can’t update the underlying base system (as it’s read-only). So when you need to make changes, you need to deactivate the overlay filesystem. This is simply accomplished using the ‘overlayctl’ script:
 
$ sudo overlayctl disable $ sudo reboot

Similarly, it can be re-enabled:
 
$ sudo overlayctl enable $ sudo reboot
 

 


While testing the usb sound dongle on my laptop, the first thing I noticed was how bad it sounded then my earphones got hot. I looked at the voltage output on the left and right channel and saw just over 2v DC on both. Time to take this thing apart! What I found was missing DC blocking capacitors. C9 and C20.


Now its time to add a capacitor to each side to block the DC voltage. I used 16v 100uF electrolytic capacitors. This is just what I had to hand and they are small enough so I can close the case back up. I tested another sound card with a 220uF capacitor and it sounded the same. So anything 100-220uF should work fine. Note the capacitor polarity. C9 and C20 are marked with + – on the PCB. They are infarct wrong. The + on the capacitor should be connected to – on the PCB. You can put the capacitors on the top of the PCB and solder on the underside.
That’s it.. Put it back together and test. No more DC on either channel and it sounds much better. Done.

NEXT PHASE - RTL Dongle instead of soundcard







Please note – I am not claiming originality for this setup method, I’ve simply followed what’s already available out there on the internet and created an article with my experience based on those instructions for your convenience (http://leeds49.co.uk/2013/12/13/usb-3d-sound-card-fix/ - http://qso365.co.uk/2017/02/setting-up-an-aprs-rx-only-igate-using-a-raspberry-pi-and-a-pre-built-image/ - http://vk3il.net/projects/raspberry-pi-based-aprs-trackerdigipeaterigate/)

Comments