Friday, May 10, 2013

APRX running on a Raspberry PI using a sound card

Here are the steps to take to get APRX (as a receive only I-Gate)  to run on a Raspberry PI using a sound card.  Special thanks to Bob, KB8ZXE for providing the info.

This approach is cheap as it doesn't require a TNC or hardware tracker board.  You should be able to throw together everything minus a radio (The Pi, power supply, sound FOB, case etc) for less than $60.

This is assuming that you have taken the steps to make your usb soundcard your default soundcard.  You should refer to my earlier post about how to get that going.  Since then (using the latest Wheezy), I have been successful with USB other FOBs.  I did not need to manually provision /etc/asound.conf

Once you have that going, install the following:

1.) apt-get install libax25 libax25-dev ax25-apps ax25-tools soundmodem screen

2.) Then edit /etc/ax25/soundmodem.conf.  Here is an example:

 <?xml version="1.0"?>  
 <configuration name="AX25">  
 <chaccess txdelay="150" slottime="100" ppersist="40" fulldup="0" txtail="10"/>  
 <audio type="alsa" device="plughw:0,0" halfdup="1" capturechannelmode="Mono"/>  
 <ptt file="none" hamlib_model="" hamlib_params="" gpio="0"/>  
 <channel name="sm0"><mod mode="afsk" bps="1200" f0="1200" f1="2200" diffenc="1" inlv="8" fec="1" tunelen="32" synclen="32"/><demod mode="afsk" bps="1200" f0="1200" f1="2200" diffdec="1" inlv="8" fec="3" mintune="16" minsync="16"/><pkt mode="MKISS" ifname="sm0" hwaddr="W1AW-14" ip="" netmask="" broadcast="" file="/dev/soundmodem0" unlink="1"/></channel></configuration>  

3.) Next, edit /etc/ax25/axports
 # /etc/ax25/axports  
 # The format of this file is:  
 # name callsign speed paclen window description  
 #1     W1AW-14     1200     255     2     144.390 MHz (1200 bps)  
 sm0 W1AW-14 1200 255 2 VHF APRS (1200bps)  

At this point soundmodem should be installed and ready to run. To test this you can feed a radio or test audio file into your soundcard. If you start soundmodem in the background (soundmodem &) and then run axlisten -c -a you should see packets being received.

4.) Download aprx and compile it, (I am using version 2.07 SVN 539) Grab the latests tarball from here:
untar, run the configure script, make, make install.

5.) Edit /etc/aprx.conf  ( I have included a very simple conf file for aprx rx-only i-gate)
 # Simple sample configuration file for the APRX-2 -- an APRS iGate and Digipeater  
 # This configuration is structured with Apache HTTPD style tags  
 # which then contain subsystem parameters.  
 # For simple case, you need to adjust 4 things:  
 #  - Mycall parameter  
 #  - Select correct type of interface (ax25-device or serial-device)  
 #  - Optionally set a beacon telling where this system is  
 #  - Optionally enable digipeater with or without tx-igate  
 mycall W1AW-14  
 pidfile /var/run/  
 # rflog defines a rotatable file into which all RF-received packets  
 # are logged. The host system can rotate it at any time without  
 # need to signal the aprx that the file has been moved.  
 rflog /var/log/aprx/aprx-rf.log  
 # aprxlog defines a rotatable file into which most important   
 # events on APRS-IS connection are logged, namely connects and  
 # disconnects. The host system can rotate it at any time without  
 # need to signal the aprx that the file has been moved.  
 aprxlog /var/log/aprx/aprx.log  
   ax25-device $mycall  
 #  #tx-ok   false # transmitter enable defaults to false  
 beaconmode aprsis  
 cycle-size 20m  
 beacon symbol "R&" lat "4427.28N" lon "08756.22W" comment "sound modem"  

At this point your soundmodem is running and when you start aprx everything should work.  You may want to create scripts that will start soundmodem and aprx on boot. If you run mheardd you can use the command mheard to display recently heard stations.

No comments: