APRS IGate/Repeater based on DixPRS


APRS Operation

Active DixPRS stations

Click to enlarge

Example:
I have tested the APRS reception of my Spanish IGate by means of a mobile station.
It was able to receive DO6FA/mobile from Cartagena, even with a small hill in between.

 

Another example: EA4GIM

DixPRS in Los Angeles
Refer also to the YouTube video at the end of this page


Material

Raspberry Pi
Material List
TNC-Pi




Raspberry PI came from conrad.ch together with the SD card having the preinstalled linux debian operating system version "wheezy"
Also I bought a nano size WIFI adapter for this, Edimax brand.

Menge Artikel Bezeichnung Einzelpreis Summe
1 Stück 874675 Mainboard (Motherboard) Raspberry PI Model B Prozessor ARM1176JZFS (1x 700 MHz) CHF 59.95 CHF 59.95
1 Stück 993655 Edimax WLAN-Stick N150 Nano EW-7811UN CHF 19.95 CHF 19.95
1 Stück 409207 Betriebssystem WHEEZY für Rapberry CHF CHF 19.95 CHF 19.95
1 Stück   TNC-Pi (TNC-X for Raspberry Pi) Kit   $ 40
1 Stück   D-Link DUB H7 - Hub - 7 x Hi-Speed USB - Desktop   CHF 32.40
1 Stück Argent Data Systems 1 x Speaker Mic Cable - Kenwood Type $ 6.00  
         

I have ordered a TNC-Pi (TNC-X for Raspberry Pi) Kit ($40) from the States from this webshop: http://tnc-x.com/TNCPi.htmParts list below

As for the radio, I bought a Wouxun KG-818 2M 136-174MHz 5W Handfunkgerät, it costs only 50EUR from ebay.de

Power supply: The PI needs an active USB hub as normally it takes about 450mA and in case you connect some USB devices for eg WIFI adapter the current can go up to 500-600mA. Best is the have a USB hub that can provide 1-1.2A DC on 5Volt.
I bought the USB-Hub from http://www.techmania.ch/

Parts List: (most of the parts are standard components)
C1 10uf electrolytic (polarized)
C2, C4, C5,
C6, C11, C14,
C15, C21 .1 uf monocap
C7, C8 .01 uf 2.5% (red and yellow)
C9, C10 18 pf ceramic disk
C12, C13 22 pf ceramic disk
C3 100 pf ceramic disk
R1, R2, R3 100K resistor (brown, black, yellow)
R4, R17, R19 1K resistor (brown, black, red)
R5, R11, R14,
R16, R18 10K resistor (brown, black, orange)
R8 24.9K resistor (red, yellow, white, red, brown)
R9 9.31K resistor (white, orange, brown, brown, brown)
R10 18.7K resistor (brown, grey, purple, red, brown)
R6, R7 10K trimmer potentiometer (orange)
X1 3.57 MHz crystal
X2 20.00 MHz crystal
D4 Red LED (polarized)
D5 Yellow LED (polarized)
Q1 PN2222 transistor
U1 MCP1700-33 or MCP1700-30 Regulator (3 pin, flat side)
U2 CML MX-614 Modem 16 pin IC
U3 PIC16F1847 18 pin IC
U4 MCP6023 Op Amp 8 pin IC
U5 23K640 Memory 8 pin IC
Sockets for U2, U3, U4, U5
JP3, JP4 Combined into one 2x2 pin header
JP7 2 x 1 pin header
9 Pin D-Sub connector
2 x 13 extra long header
Printed Circuit Board
3 shorting jumpers

Assembling the TNC-Pi

Step 1 Preparation
Step 2 Smaller Components
Step 3 Larger Components
Step 3 Final TNC

TNC-Pi Assembly for Raspberry Pi


Preparation for the assembly of the TNC-Pi on a rainy Sunday morning.
First I made an inventory if I have all the components available

TNC-Pi Assembly for Raspberry P


Starting with the smaller components, capacitors and resistors.
I was using a knife to clear the legs of the components from oxidation and for easier soldering.
I prefer the faster but higher temperature (350C) soldering in general


After soldering all resistors and capacitors, I continued with the crystals and larger components, like LEDs, trimmer resistors, IC sockets, D-Sub connector, jumpers, etc. When soldering the PN2222 transistor and MCP1700-30 regulator make sure to do it quickly without overheating them.
Next step is the connect to the Raspberry Pi and check the voltage pin 5 (negative) and pin 14 (positive) on the PIC16 socket. Must show 3.3V

The Raspberry Pi has not arrived yet, waiting for Swiss Post to deliver it. Conrad.ch is extremely slow in delivery. 2 weeks ago I ordered the Raspberry Pi from conrad.ch and the TNC-Pi from the USA and the TNC-Pi arrived in about a week only!


TNC-PI with Raspberri Pi

Video TNC-Pi Assembly for Raspberry Pi [29'278 KB]


 


Configuration for the TNC-Pi

Step 1 Install the ax25 wrapper
Step 2 Installing the APRS software "dixprs"
Step 3 Starting the dixprs
Step 4 Auto Start-up
Step 5 Installing WLAN
Step 6 Connecting the Radio


Step 1
Install the ax25 wrapper
On LINUX DIXPRS can communicate to a KISS TNC directly via a serial interface. However it is advised to use TNC's and modems via AX.25 stack. It makes other type modems, like USCC card, BAYCOM modem, etc. usable with DIXPRS. It requires an additional Python module installed, developed for
DIXPRS, called pyax25.

Download pyax25.tar.gz from https://sites.google.com/site/dixprs/downloads and extract to a temporary folder. (tar –xzvf pyax25.tar.gz)
You can do this by either using the command $ wget https://sites.google.com/site/dixprs/downloads/pyax25.tar.gz
Or download it to your pc and transfer using an ftp server or a usb stick….

Then from that directory….
sudo ./compile_ax25.py build
sudo ./compile_ax25.py install


Note: procedure requires libax25, Python development files and basic development toolchain with GCC installed.

Check installation by starting python and type

import _ax25

If everything is OK, only prompt displayed, no error message.


Step 2
Installing the APRS software "dixprs"


Create the dixprs directory and cd into it
$ mkdir –p /usr/local/dixprs && cd /usr/local/dixprs

Download the source code from using wget…..
$ wget https://sites.google.com/site/dixprs/downloads/dixprs-2.2.2.tar.gz
or from the download page on the website

Unpack the tarball
$ tar -xvzf dixprs-2.2.2.tar.gz

Now chmod all files
$ chmod 755 *


The process looks like this:

pi@raspberrypi /usr/local/dixprs $ sudo wget https://sites.google.com/site/dixprs/downloads/dixprs-2.2.2.tar.gz
--2013-06-05 02:15:48-- https://sites.google.com/site/dixprs/downloads/dixprs-2.2.2.tar.gz
Resolving sites.google.com (sites.google.com)... 74.125.232.135, 74.125.232.131, 74.125.232.137, ...
.
.
.
HTTP request sent, awaiting response... 200 OK
Length: 38477 (38K) [application/x-gzip]
Saving to: `dixprs-2.2.2.tar.gz'

100%[======================================>] 38,477 --.-K/s in 0.07s

2013-06-05 02:16:04 (507 KB/s) - `dixprs-2.2.2.tar.gz' saved [38477/38477]

pi@raspberrypi /usr/local/dixprs $ ls -la
total 48
drwxr-sr-x 2 root staff 4096 Jun 5 02:16 .
drwxrwsr-x 11 root staff 4096 Jun 5 02:14 ..
-rw-r--r-- 1 root staff 38477 Sep 5 2012 dixprs-2.2.2.tar.gz
pi@raspberrypi /usr/local/dixprs $ sudo tar -xvzf dixprs-2.2.2.tar.gz
CHANGES.txt
LICENCE.txt
README.txt
config-agwpe.txt
config-ax25.txt
config-kiss.txt
dixdrvax25.py
dixdrvudp.py
dixlibaprs.py
dixlibax25.py
dixlibcommon.py
dixlibgeo.py
dixlibmsg.py
dixlibsql.py
dixp1.htm
dixpagwpe.py
dixpax25.py
dixpcommon.py
dixpigate.py
dixpkiss.py
dixprs.py
dixprscfg.py
dixprscommon.py
dixpwebserver.py
hdump.py
pi@raspberrypi /usr/local/dixprs $ sudo chmod 755 *
pi@raspberrypi /usr/local/dixprs $



Now it’s time to adjust the dixprs config file
It is located at /usr/local/dixprs and we use the config-kiss.txt sample.
Rename it to config.txt and you will call this config.txt file when startup of dixprs.

NOW THIS IS THE PART WHEN THE TNC-PI HAS TO BE CONNECTED TO THE RASPBERRY PI.
As we are no going to communicate via Serial to the TNC PI, after making the following configurations in config.txt


Here is the part of that specific for TNC-PI config.txt file

####################

[RADIO]
# Mandatory parameters
# Interface type
INTERFACE=KISS
# Serial port
PORT=/dev/ttyAMA0
# Serial port speed
SPEED=19200



After adapting your personal data, such as call sign etc, pay attention to the radio part. It should look as follows:

Changes marked as %%%% FILL YOUR DATA HERE %%%%

[GENERAL]

# Mandatory parameters

# Your callsign with SSID
CALLSIGN= %%%% FILL YOUR DATA HERE %%%%

# Degrees; West is negative, East is positive
LONGITUDE= %%%% FILL YOUR DATA HERE %%%% easy to do from aprs.fi – use the decimal like LONGITUDE=06.7580 SAME FOR LATITUDE

# Degrees; South is negative, North is posittive
LATITUDE= %%%% FILL YOUR DATA HERE %%%%

# Optional parameters

# Station height abvove the see level in meters; no default
#ASL= %%%% FILL YOUR DATA HERE %%%%

# Owner name and contact; no default
#OWNER=<str>


# Spool directory to import packets; no default
#SPOOL=<path>

# Station symbol; default is S#
# SYMBOL

# UDP port base number; default is 31110
#UDPBASE=<n>

# Beacon frequency in minutes; default is 30
#BCNTIME=<n>

# Beacon text; %v replaced with actual version string; default is %v
# Used as default for ISGW and RADIO
#BCNTXT=<str>


# Select km/mi on monitor and in DX list; default is y (km)
#METRIC=<y/n>

# Max number of digis passed for local stations
# Used as message gating condition for gating to Rf
# Default value is 2
#LOCALHOPS=<n>

# Range in km within messages gated to Rf
# If defined, checked after hop count (local) check
# No default
#MSGRANGE=<fv>


#################################################################
# #
# IS gateway settings; remove this section to disable GW #
# #
#################################################################

[ISGW]

# Mandatory parameters

# Domain name of IS server to connect
host=euro.aprs2.net %%%% HOST SHOULD BE LIKE THIS %%%%

# Optional parameters

# Port number; default is 14580
#PORT=<n>

# Filter; default is r/@/150
# @ is replaced with station position
#FILTER=<str>


#################################################################
# #
# WRB server settings; remove this section to disable it #
# #
#################################################################

[WEBSERVER]

# Mandatory parameters

# WEB server port, no default
port=9999

#################################################################
# #
# Radio port configuration settings; repeat section for #
# multiple ports #
# #
#################################################################

[RADIO]

# Mandatory parameters

# Interface type
INTERFACE=KISS %%%% SHOULD BE LIKE THIS %%%%

# Serial port
PORT=/dev/ttyAMA0 %%%% SHOULD BE LIKE THIS %%%%

# Serial port speed
SPEED=19200 %%%% SHOULD BE LIKE THIS %%%%



# Optional parameters
# Modem speed, default is 1200
#SIGNALRATE=1200
# Enable/disable NWS WX bulletin and object gating from IS to Rf
# Disabled by default
#GATENWS=<y/n>
# Enable/disable BOM WX bulletin and object gating from IS to Rf
# Disabled by default
GATEBOM=y
# Descripton of port; no default
DESCRIPTION=TNC-PI %%%% CAN BE LIKE THIS %%%%
# Via used to send locally generated packets; default is WIDE1-1,WIDE2-2
#AXVIA=<lst>
# Digipeaters processed with WIDEn-n algorithm; default is WIDE1,WIDE2
#WIDEN=<lst>
# Blacklisted stations; they are not digipeated, not gated; default is NOCALL,N0CALL
#BLACKLIST=<lst>
# PHG string, do not mix with range; no default
#PHG=<str>
# Range value in miles, do not mix with PHG; no default
RNG=30
# Enable/disable transmission; change it to PTTON=1 to enable trasmission; default is no
PTTON=y %%%% CAN BE LIKE THIS %%%%
# Gate locally generated frames to IS gateway; default is no
# Useful for rx-only radio ports
# Experimental, use carefully
GATELOCAL=y %%%% CAN BE LIKE THIS %%%%
# Gate digipeated frames to IS gateway; default is no
# Experimental, use carefully
GATEDIGI=y %%%% CAN BE LIKE THIS %%%%
# Beacon text; %v replaced with actual version string; default is %v
#BCNTXT=<str> make your own beacon string here
# Enable/disable digipeater; default is enabled
#DIGIPEATER=<y/n>
# KISS TNC setup parameters 0...255; no defaults
# Use to setup TNC by DIXPRS
#TXD=<n>
#PPERSIST=<n>
#SLOTTIME=<n>
#TXTAIL=<n>
#DUPLEX=<n>
# Below these are the traffic shaping settings for gating messages
# From IS to Rf
#
# For advanced users only; do not change if you do not know how
# traffic shaping works and if you do not have good reason !!!

# Traffic shaping high treshold, default is 0.75
#TRAFFICHIGH=<fv>

# Traffic shaping low treshold, default is 0.5
#TRAFFIClow=<fv>

# Traffic shaping transmission delay, default is 5.0 sec
#TRAFFICDELAY=<fv>

# Comma separated list of addresses to send receveid/transmitted frames
# in hostip:port format. No default.
UDPCC=udplog1.dixprs.net:8889,udplog2.dixprs.net:8889 %%%% SHOULD BE LIKE THIS %%%%

Save the modified config.txt file and now you can test it


back

Step 3
Starting the dixprs


root@raspberrypi:~# /usr/local/dixprs/dixprs.py -c /usr/local/dixprs/config.txt

*** DIXPRS 2.2.2 - 05-09-2012 - (pid=1996)

*** AIR0 process started [No description] (pid=1999))
*** IGATE process started [host=euro.aprs2.net, port=14580] (pid=2000)
*** WEBSR process started [port=9999] (pid=2001)
*** Connection established

08:36:33z AIR0 <- LOCL HA6QZ-2>APDI22,WIDE1-1,WIDE2-2:>DIXPRS 2.2.2 u p and running
*** Connection successful to T2HUN
08:36:38z AIR0 <- LOCL HA6QZ-2>APDI22,WIDE1-1,WIDE2-2:>Connected to T 2HUN count 1/0
08:37:31z AIR0 <- LOCL HA6QZ-2>APDI22,WIDE1-1,WIDE2-2:=S6l2*PG`G# sTDIXPRS 2.2.2
08:37:31z AIR0 <- LOCL HA6QZ-2>APDI22,WIDE1-1,WIDE2-2:<IGATE,MSG_CNT=0,LOC_CNT=0,DIR_CNT=0,RF_CNT=0,RFPORT_ID=0



After this you should be able to find your igate on aprs.fi
Also you should see the APRS data coming in if your radio is connected and the TNC-PI receives APRS data.


back

Step 4
If you want the dixprs run in its own screen, and you would like to get back the linux shell and would like the dixprs would start when you power on the Raspberry PI (or reboot it), the following should be done:

The next little script will take care of it, but before that you have to install screen apt-get install screen
cd /etc/init.d

Then create the dixprs startup file
nano dixprs

Copy the content below and write it to file

#! /bin/sh
# /etc/init.d/dixprs

######################## BEGIN INIT INFO
# Provides: dixprs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start dixprs at boot
# Description: A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
######################## END INIT INFO

# If you want a command to always run, put it here
cd /usr/local/dixprs

# Carry out specific functions when asked to by the system
case "$1" in


start) echo "Starting dixprs in a screen"

# run application you want to start

screen -dmS dixprs /usr/local/dixprs/dixprs.py -c /usr/local/dixprs/config.txt

;; stop) echo "Stopping dixprs screen"

killall screen

;;

*)

echo "Usage: /etc/init.d/dixprs {start|stop}"

exit 1

;;
esac
exit 0

Then chmod 755 dixprs and now test it, the script should work

./dixprs start

screen –r dixprs, should show you the previous start-up information.

*** DIXPRS 2.2.2 - 05-09-2012 - (pid=8473)
*** AIR0 process started [TNC-PI] (pid=8476))
*** IGATE process started [host=euro.aprs2.net, port=14580] (pid=8477)
*** WEBSR process started [port=9999] (pid=8478)
*** Connection established


Leave the screen by Ctrl-a-d (but note that dixprs will be still running in the background but now you have the linux console back).
Kill it by ./dixprs stop but from outside the screen with the name dixprs
To register your script to be run at start-up and shutdown, run the following command:
sudo update-rc.d dixprs defaults

Note - The header at the start is to make the script LSB compliant and provides details about the start up script and you should only need to change the name. If you want to know more about creating LSB scripts for managing services, see http://wiki.debian.org/LSBInitScripts
If you ever want to remove the script from start-up, run the following command:
sudo update-rc.d -f dixprs remove


back

Step 5
I have bought a mico size Edimax WLAN-Stick N150 Nano EW-7811UN from Conrad.ch This one is recognised by the Raspberry Pi, so I do not need a LAN cable any longer.
If you have a WIFI routed using WPA2 encription here is the way to make the WIFI connection enabled.

Configuring WPA2 using wpa_supplicant on the Raspberry Pi

To use WPA2 pre-shared key on the Raspberry Pi, you will first need to add a network configuration to “/etc/wpa_supplicant/wpa_supplicant.conf”.

Note the lack of space in “network={“.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Your SSID Here"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YourPresharedKeyHere"
}

After you have modified wpa_supplicant.conf, you will need to change the “wlan0&#8243; section of “/etc/network/interfaces”.
For a static IP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 10.1.2.20
netmask 255.255.255.0
network 10.1.2.0
gateway 10.1.2.1

For DHCP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


After that, you will need to bring up the “wlan0&#8243; interface using “ifup”:

# sudo ifup wlan0

You may have to bring the interface down and then back up:

# sudo ifdown wlan0
# sudo ifup wlan0

You can check your wireless connection using iwconfig:

# iwconfig
lo no wireless extensions.
eth1 no wireless extensions.
wlan0 IEEE 802.11bg ESSID:"Your SSID Here" Nickname:"<WIFI@REALTEK>"
eth0 no wireless extensions.


After this every time you start the Raspberry PI, it will automatically connect to your home router. No need LAN cable any more.


back

Step 6
I am using a Wouxun KG-818 transceiver for the igate and it has got a Kenwood type connector for speaker/mic.

You can order it from www.argentdata.com

The connector has two plugs: a 3.5mm TRS plug, and a smaller TS plug. The pinout is as follows:

TRS tip: (not connected)
TRS ring: (white) = MIC
TRS sleeve: (black) = PTT
TS tip: (red) = SPKR
TS sleeve: (blue) = GND

Connecting the Radio
You can either wire up a 9 pin D-Sub plug to mate with the one on the board, or, if you’d prefer, you can use the four holes below R7 to hard wire a radio connection. If you use the 9 pin D-Sub connection, it should be wired as follows:
Pin 1: TX Audio
Pin 3: Push to Talk (PTT)
Pin 5: Receive Audio
Pin 6: Ground

Potentiometer R7 adjusts the level of the transmit audio output. Most people will find that they need to set it fairly near the minimum setting. One way to set this is to use two radios, one to monitor the transmitted signal and the other connected to the TNC-Pi. Key the radio connected to the TNC-Pi manually by pushing the PTT button on it. On the other radio you will hear a continuous tone (even though no data is being transmitted… you don’t need to be running any software on the Raspberry Pi to do this). Turn R7 all the way down and the tone will go away. Then slowly turn it up until the volume doesn’t increase any further in the monitor receiver. When you reach this point, back it off just a little and you should have it about right.

Now you have a linux based microcomputer controlling an AX.25 Terminal Node Controller for RF to Internet packet gating

THAT'S ALL FOLKS


back

Admin