Building N7NIX's fork of Dan's Tracker - now called UDRTracker for the RPi: 05/31/15 Updates since July 6, 2013 code drop 0. Required Compiling tools: sudo apt-get install build-essential (includes libc-dev, make, gcc, ... etc) pkg-config imagemagick git automake autoconf libtool 1. Mount a remote NFS drive for compiling #get an example script here #http://www.trinityos.com/HAM/CentosDigitalModes/misc/RPi/usr/local/sbin/mount-hampacket2-nfs.sh /usr/local/sbin/mount-hampacket2-nfs.sh 2. (OPTIONAL) Backup any old versions of the UDR Tracker software that's on the remote NFS server #go into the directory whereever you created it and clean out any compile time stuff cd /mnt/nfs/hampacket2/ cd dantracker-master make clean #Make a backup of the last setup - Get the version of the last README - last version for me was july 13 2013 ls -la dantracker-master/README tar czvf dantracker-master-071314.tgz dantracker-master 3. Download sources all of the following onto your remote NFS server or HD. Do NOT write all this to the SD card or you can wear it out cd /mnt/nfs/hampacket2 #get the N7NIX Tip of Tree #Note down the DATE of last GIT version at # https://github.com/n7nix?tab=activity wget -O n7nix-dantracker.zip https://github.com/n7nix/dantracker/archive/master.zip #Rename it so it's clearer mv n7nix-dantracker.zip n7nix-dantracker-`date +%m%d%y`.zip 4. Download the dependencies # Make sure you have the following installed, if not, install them and yes, # screen IS required # # If this an update attempt, make sure you run apt-get update; apt-get upgrade first # dpkg -l | grep -e pkg-config -e imagemagick -e git \ -e automake -e autoconf -e libtool -e libgtk2.0 -e libax25-dev \ -e openssl -e libssl-dev -e screen #----------------------------------------------------------------------- #Next, get core modules required by DanTracker #libfap is not available via other repositories # New version as of 5/31/15 (was 11/2014) is v1.5.0 # Version 1.4.0 is known BROKEN - don't use it # # See what's newest at http://www.pakettiradio.net/libfap/ # cd /mnt/nfs/hampacket2 wget -O libfap-1.5.tar.gz http://www.pakettiradio.net/downloads/libfap/1.5/libfap-1.5.tar.gz #These following programs are NOT available via other repositories # current version as of 11/2014 wget -O iniparser-3.1.tar.gz wget http://ndevilla.free.fr/iniparser/iniparser-3.1.tar.gz cd /mnt/nfs tar xzvf iniparser-3.1.tar.gz #Not available via other repositories - downloads the source directly # Git command will create it's own json-c directory # If you already had a previous download present: cd json-c; git pull # # 0.12 as of 11/2014 cd /mnt/nfs git clone git://github.com/json-c/json-c.git #Stock Wheezy has "libjs-jquery" which is at 1.7.2 but we need 1.8.3 or newer # # Backup the old version # tar czvf jquery.js.tgz jquery.js # # 1.11.1 as of 11/2014 cd /mnt/nfs/hampacket2 wget http://bit.ly/jqsource -O jquery.js mkdir /usr/share/dantracker sudo cp /mnt/nfs/hampacket2/jquery.js /usr/share/dantracker #IMPORTANT: You CANNOT get and install nodejs from the Debian APT repositories as # the current available to Raspian / Wheezy version ( 0.6.19 ) is WAY too old # If you did install it previously from apt-get, you must use the following command to remove it: dpkg -r nodejs wwwconfig-common javascript-common libjs-jquery libv8-dev \ node-node-uuid libc-ares-dev libev-dev node-abbrev node-inherits \ node-block-stream node-rimraf node-mkdirp node-graceful-fs node-fstream \ node-ini node-lru-cache node-minimatch node-nopt node-request node-semver \ node-tar node-which nodejs-dev npm dpkg --purge nodejs-dev npm #Node.js - Download the newest version (aka node) # # current version is 2014.05.01, Version 0.11.13 as of 11/2014 cd /mnt/nfs/hampacket2 git clone git://github.com/ry/node.git 5. Preparing to compile stuff - If your upgrading things on this Rpi or have other big programs running, FREE UP as much RAM as possible. If you've already enabled UDR Tracker and you're trying to upgrade it. Make sure it's not running either: #Frees up a lot of RAM - shut off Xwindows # Disable any AX25 stuff - /etc/tracker/tracker-down - /etc/ax25/ax25-down 6. Compile the dependencies Either from the Rpi itself (so you compile things in the ARM instruction set) or if you've setup a cross compilation setup on your x86 machine; do 6.a Node It's worth noting that Node.JS is broken on the Rpi since 0.11.8 where running "npm -v" will give "illegal instruction": https://github.com/joyent/node/issues/7222 https://github.com/joyent/node/pull/14193 NodeJS version 0.11.7 is OK or wget http://node-arm.herokuapp.com/node_latest_armhf.deb sudo dpkg -i node_latest_armhf.deb #NOTE: It's absolutely required that you have the local /tmp file system # mounted on a remote NFS file system. node.js requires a lot more # than 512MB of RAM to compile things and will automatically # overflow to the /tmp file system. If this happens, you will TRASH # your SD card. I know because I killed one SD card this way! cd /mnt/nfs/hampacket2/node If not built before -- #Required work around for the use of Flock over NFS # https://github.com/TooTallNate/node-gyp/issues/147 export LINK=g++ #Takes 23 sec on a Rpi Model-B time ./configure #takes 193min (~3hrs) on a Rpi Model-B time make #install it using checkinstall #takes 21min 39sec on a Rpi Model-B sudo checkinstall Description: Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices Using the checkconfig text menus, change: version: 0.11.13 (update this to reflect your specific version) Press ENTER to install it (this takes a while) If built before -- dpkg -i node_0.11.7-1_armhf.deb #verify it's installed by running: node -v && npm -v v0.11.8-pre 1.3.11 7. Uncompress on NFS server (faster than doing on Rpi itself) in the following order cd /mnt/nfs/hampacket2 #Need this opened up first to get a patch file from it # this will uncompress into a directory called dantracker-master # #Just in case you had a previous version mv dantracker-master dantracker-master-previous #Now uncomoress the new version unzip n7nix-dantracker-`date +%m%d%y`.zip tar xzvf libfap-1.5.tar.gz tar xzvf iniparser-3.1.tar.gz 8. Compile Libfap first (which requires some patches) - On the RPi itself: -------------------- cd /mnt/nfs/hampacket2 cd libfap-1.5 libfap (with patches) If not built before -- cd libfap-1.5 patch -p2 < ../dantracker-master/fap_patch.n7nix sudo cp src/fap.h /usr/local/include/ #This takes about 53 seconds on a Rpi Model-B time ./configure #This takes about 1m 37sec on a Rpi model-B time make sudo checkinstall sudo checkinstall --pkgname libfap --pkgversion 1.5.0 --pkgrelease 1 --pkggroup hamradio \ --pkgsource http://www.pakettiradio.net/downloads/libfap/ --maintainer dranch@trinnet.net --provides "APRS" description: libfap is a quick and dirty C port of the Ham::APRS::FAP Finnish APRS Parser (Fabulous APRS Parser) Perl module. As the original Perl code, libfap parses normal, mic-e and compressed location packets, NMEA location packets, objects, items, messages, telemetry and most weather packets. For more description, see the Perl module. NOTE: libraries will install to /usr/local/lib No need to then install the program as checkinstall does that for you! 9. Compile libiniparser cd ../iniparser If not built before -- sudo cp src/iniparser.h /usr/local/include sudo cp src/dictionary.h /usr/local/include #This takes about on a Rpi Model-B time make #there isn't a makefile based install here ... do everything manually sudo cp libiniparser.* /usr/local/lib 10. Compile json-c #This packege seems to have a FLOCK over NFS issues which esstentially #makes it hang 100%. Lets work around this with compiling LOCALLY If not built before -- sudo su mkdir /root/json-c cp -r /mnt/nfs/json-c/* /root/json-c/ cd /root/json-c #This takes about 2m 17sec on a Rpi model-b time sh autogen.sh #This takes about 1m 2sec on a Rpi model-b time ./configure #This takes about 1m 6sec on a Rpi model-b time make checkinstall description: JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects version: 0.12 #copy it back into the NFS area just in case cp -r . /mnt/nfs/hampacket2/json-c/ ldconfig If built before -- dpkg -i json_0.12-1_armhf.deb 11. Download and install Node.JS modules #NPM is like cpan for perl - it dynamically downloads and installs modules # for you As of 11/30/14 ------- sudo npm -g install ctype #0.5.3 sudo npm -g install iniparser #0.5.2 sudo npm -g install websocket #1.0.13 sudo npm -g install connect #3.3.3 sudo npm -g install serve-static #1.7.1 sudo npm -g install finalhandler #0.3.2 to verify what's installed, use: sudo npm info ctype | grep version: sudo npm info iniparser | grep version: sudo npm info websocket | grep version: sudo npm info connect | grep version: sudo npm info serve-static | grep version: sudo npm info finalhandler | grep version: NOTE: do NOT use "npm -g update" EVER as it will try to upgrade Node.JS beyond 0.11.7 which will break things on the Rpi 12. Install gpsd for optional GPSd based tracking apt-get install gpsd gpsd-clients python-gps libgps20 libgps-dev 13. Install the modified Dan Tracker cd /mnt/nfs/hampacket2 cd dantracker-master Review the contents of the simple "Makefile" for any changes in settings you might want --------------------------------------------------------------------------------------- LEGACY: Probably NOT needed anymore. To check, run the following command: grep kernel_ax25.h aprs-ax25.c If there isn't any match, you can ignore this section # Create the following patch file for the VE7FET version of the AX25 libs vim aprs-ax25.c.patch -- --- aprs-ax25.c.orig 2013-09-22 19:29:53.213809680 -0700 +++ aprs-ax25.c 2013-09-22 19:30:07.587971034 -0700 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include -- patch -p0 < aprs-ax25.c.patch --------------------------------------------------------------------------------------- If not built before -- #This takes 2m 17sec on a Rpi Mode-B time make #(OPTIONAL) make a backup of your old configs and startup scripts (if any) mkdir /etc/tracker/`date '+%m%d%y'` cp /etc/tracker/* /etc/tracker/`date '+%m%d%y'` #remove the old code and install the new code dpkg -r dantracker ######################################################################## # NOTE: # # this package does not install correctly if you try to rename # # it from dantracker to udrtracker with the checkinstall tool # ######################################################################## # NOTE#2: # Please note that some of the programs we use here are NOT tracked via the Debian .deb # packagine system ( iniparser,json-c,jquery.js ). Since they aren't known, we cannot # mark them via the "--requires" or you'll never be able to install this # program! # NOTE #3: # update the pkgversion with the date of the last DanTracker date as # found above from the Git repo checkinstall --pkgname dantracker --pkgversion 052415 --pkgrelease 1 --pkggroup hamradio --pkgsource https://github.com/n7nix/dantracker \ --maintainer dranch@trinnet.net --provides APRS --requires imagemagick,libfap,node Description: APRS Client with GPS, SmartBeaconing, and local web server display using JavaScript for small screens version: 0.02.0043 #From the Jquery packge downloaded above, copy it over: mkdir /usr/share/dantracker sudo cp /mnt/nfs/hampacket2/jquery.js /usr/share/dantracker #(OPTIONAL) If an upgrade from a previous version; restore your old configs cp /etc/tracker/`date +'%m%d%y'`/* /etc/tracker/ -------------------------------- Setup persistent USB serial connections with Udev - Covered in the HamPacket documentation for now: http://www.trinityos.com/HAM/CentosDigitalModes/hampacketizing-centos.html#1d.presetup-udevusbserial -------------------------------- 14. Configuring N7NIX's Dan Tracker Edit config files /etc/tracker/aprs_tracker.ini # To use the native Linux AX25 stack, # - comment out the lines under the [tnc] section # - rate # - Un-comment out the line: # - type AX25 #Under the [station] section, # - update the mycall parameter to your call+SSID # Edit the config file /etc/tracker/aprs_spy.ini change [station] mycall change under the [ui_net], the unix_socket name If you don't have a gps connected change [gps] type from nmea to static If gps is connected set serial port and set type to nmea For AX.25 operation change config for [ax25] port = xxx This should be the same port name used in /etc/ax25/axports ------------------------------------ Starting things up: - The NFS mounts of /tmp can screw up dantracker and other programs. As such, I recommend to REBOOT first ------------------------------------ From the UDR Tracker documentation: Running Dan Tracker manually (fully assumes you have a properly configured Linux AX.25 stack operating (usually started on the Rpi with: /etc/ax25/ax25-up.new: #Using KI6ZHD's modified startup script # #As root run: /etc/tracker/tracker-up nogps As the root user, run the command: screen -ls should see something similar to: There are screens on: 30680.Tracker (04/15/2013 06:10:32 PM) (Detached) 21348.Spy (04/15/2013 01:00:42 PM) (Detached) 2 Sockets in /var/run/screen/S-root. ---------------------------------- To confirm things are loaded correctly: 1. Confirm the right AX.25 CALSIGN-SSID as configured in the aprs_tracker/ini file is shown here: #Make sure the AX.25 stack is running netstat -A ax25 -an Active AX.25 sockets Dest Source Device State Vr/Vs Send-Q Recv-Q * KI6ZHD-6 ax0 LISTENING 000/000 0 0 2. Make sure the web interface is listening on ports 8080 and 8081 # netstat -an | grep -e 8080 -e 8081 tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN To attach to one of the DanTracker screen terminals: --------------------------- screen -r Tracker or screen -r Spy # Note: # Each of the DanTracker windows has MULTIPLE sub-screens. If you are # successful in getting these screen sessions running & you are attached # use these 'screen' commands: list windows: ctrl a w change windows ctrl a 0 ctrl a 1 ctrl a 2 leave session by detaching: ctrl a d kill them: ctrl a \ For the Tracker screen, you should see something like the following. The bottom "." represent received APRS packets. This should constantly increase and if it doesn't, that means something is WRONG: [The default Tracker view is Screen window #2] -- Waiting for node script to create a Unix socket UI Socket /tmp/KI6ZHD_UI, connected with sock 4 Using live packets aprsax25_connect: Using callsign KI6ZHD-6 with ax.25port vhfdrop DEBUG: aprsax25_connect(): Port vhfdrop is using device ax0, callsign KI6ZHD-6 DEBUG: aprsax25_connect(): Connected to AX.25 stack on rx socket 5, tx socket 6 DEBUG: tnc type is AX25 try aprsax25_connect to APUDR1 via WIDE2-1,WIDE1-1, socket=5 .31.05.15 12:24:44: beacon reason: ATREST, req: 1200 delta: 1433100284 31.05.15 12:24:44 Packet out: len: 68, src: KI6ZHD-6, pkt: =3720.62N/12200.00Wx/A=000409Using dantracker v1.01(181), gps sats 0 send_ax25_beacon: ............................................................................. -- [Tracker Screen #0] -- CONF debug: gps system update time every 1440 minutes DEBUG: Calling iniparser for station call KI6ZHD, ssid:6 CONF debug: sock_host name string length = 0 CONF debug beacon types count 1, beacon: phg CONF debug comments count 3, comment: 1,5 CONF debug: aprsis filter string: t/m Processed single key: Using dantracker v1.01(181), key: ver, remaining: 17 Final str: Using dantracker v1.01(181), gps sats $sats$ Processed single key: , version v1.01(181), key: ver, remaining: 119 Processed single key: , call sign KI6ZHD, key: mycall, remaining: 0 Final str: Test: Number of sats $sats$, version v1.01(181), date $date$, time $time$, voltage $voltage$, index $index$, temperature $temp1$, sig qual $digiq$, call sign KI6ZHD Processed 2 lines, total keys: 11 -- [Tracker Screen #1] -- Check ini parameters websock: 57333 html port: 8080 Connections: websocket port: 57333 Net Host: undefined port: /tmp/KI6ZHD_UI Warning: Native modules not compiled. XOR performance will be degraded. Warning: Native modules not compiled. UTF-8 validation disabled. Sun May 31 2015 12:24:40 GMT-0700 (PDT)UI Socket Server listening on undefined:/tmp/KI6ZHD_UI HTML Server listening on port: 8080 Sun May 31 2015 12:24:46 GMT-0700 (PDT) Web Socket Server is listening on port 57333 Will create socket:/tmp/KI6ZHD_UI CONNECTED: undefined:undefined net0: NO Chat Client -- For the Spy screen, you should see something like the following. [The default Tracker view is Screen window #1] -- Warning: Native modules not compiled. XOR performance will be degraded. Warning: Native modules not compiled. UTF-8 validation disabled. Using ini file: /etc/tracker/aprs_spy.ini Connections: websocket port: 1348 Net Host: undefined port: /tmp/KI6ZHD_SPYUI Sun May 31 2015 12:24:40 GMT-0700 (PDT) UI Socket Server listening on undefined: /tmp/KI6ZHD_SPYUI Sun May 31 2015 12:24:42 GMT-0700 (PDT) WebSocket Server is listening on port 1348 Will create UI Unix socket:/tmp/KI6ZHD_SPYUI UI NET Socket CONNECTED: undefined:undefined -- [The default Tracker view is Screen window #0] - The output will show received APRS packets. This should constantly show new packets but if it doesn't, that means something is WRONG: -- . . . 31.05.15 12:34:14 ax0: K6JFT-7->S7QVPQ v K7FED-1 N6ZX-3 WIDE2* Text:`14i*}-'/"O)} 31.05.15 12:34:14 ax0: KI6TDB->S7SQXX v N6ZX-3 WIDE1* WIDE2-1 Text:0000 `2*[l >/'"3v}|#Y%V(E|!w"T!|3 31.05.15 12:34:28 ax0: W7AIT-1->S7TQWP v K7FED-1 N6ZX-3 WIDE2* Text:`1Y$l!B-/]"4$}HOME QTH!!!= 31.05.15 12:34:38 ax0: N3WG-9->SWRRPQ v WIDE1-1 WIDE2-1 Text:`1Wjn6x>/`"4$}_" 31.05.15 12:34:45 ax0: N6VGW-9->SXRXRP v K6FGA-1 N6ZX-3 WIDE2* Text:`1+>nq6>/`"3S}145.110MHz T103 -060_% 31.05.15 12:34:52 ax0: W6TST-9->SV2VRR v K6IXA-3 N6ZX-3 WIDE2* Text:`03[mh`>/"5I}/San Benito Co. ARES/ACS/RACES 31.05.15 12:34:59 ax0: N6DRY->S8RXSR v K6FGA-1 N6ZX-3 WIDE2* Text:`1:3osO>/'"4)}|"!&)(!|!w_@!|3 31.05.15 12:35:02 ax0: KF6PQW->SX1WQV v WB6IVK-1 N6ZX-3 WIDE2* Text:`2-#lRJk/"3m}N811ES Lancair ES 31.05.15 12:35:08 ax0: K6JFT-7->S7QYYQ v WIDE1-1 WIDE2-1 Text:`19;,U-'/"KS}Cessna 180 - N180XV 31.05.15 12:35:09 ax0: K6JFT-7->S7QYYQ v WR6ABD* WIDE2-1 Text:`19;,U-'/"KS}Cessna 180 - N180XV 31.05.15 12:35:11 ax0: K6JFT-7->S7QYYQ v N6ACK-11 WIDE1* WIDE2-1 Text:`19;,U-'/"KS}Cessna 180 - N180XV 31.05.15 12:35:12 ax0: N3WG-9->SWRRPY v WIDE1-1 WIDE2-1 Text:`1Wlm\F>/`"4"}_" 31.05.15 12:35:13 ax0: N3WG-9->SWRRPY v WR6ABD* WIDE2-1 Text:`1Wlm\F>/`"4"}_" 31.05.15 12:35:19 ax0: WA6TS-9->S7QUVQ v N6ZX-3 WIDE1* Text:`1V2qI/>/`"4X}145.230MHz C100 -060 Tom is mobile, call voice alert or frq_" 31.05.15 12:35:29 ax0: W2GMD-10->APT314 v WB6TMS-3 WIDE1 N6ZX-3 WIDE2* Text:!3743.79N/12228.80W>142/000/A=-00091/Baby Wagon - www.w2gmd.org - Twitter: @ampledata|!"%{'E|!w]U! 31.05.15 12:35:34 ax0: W6PD-9->APT314 v WB6IVK-1 N6ZX-3 WIDE2* Text:!3907.69N/12103.66W>239/000/A=002155 31.05.15 12:35:34 ax0: W6PD-9->APT314 v K6FGA-1 N6ZX-3 WIDE2* Text:>146.52/ w6pd@arrl.net 31.05.15 12:35:40 ax0: N6DRY->S8RXSR v K7FED-1 N6ZX-3 WIDE2* Text:`1:3osO>/'"4)}|"!&)(!|!w_@!|3 31.05.15 12:35:40 ax0: K6JFT-7->S7QYYQ v K7FED-1 N6ZX-3 WIDE2* Text:`19;,U-'/"KS}Cessna 180 - N180XV 31.05.15 12:35:40 ax0: W7AIT-1->S7TQWR v K7FED-1 N6ZX-3 WIDE2* Text:`1Y!l@2-/]"3z}HOME QTH!!!= 31.05.15 12:35:45 ax0: N3WG-9->SWRRQT v WIDE1-1 WIDE2-1 Text:`1Wxm!p>/`"4'}_" -- GUI operation: Open up a web browser either on the Rpi itself or on a different machine that can reach your Rpi via the network (wired or wireless) ----------------------- Is your browser web socket enabled? http://caniuse.com/websockets web url for tracker :8080/tracker.html http://rpi:8080/tracker.html or localhost:8080/tracker.html web url for spy :8081/spy.html or localhost:8081/spy.html The install script does not setup apps to start on a power up or reboot. To have the spy & tracker apps startup at boot time do the following. As root copy tracker startup script to the init.d dir then use udpate-rc.d to add the daemon. su cd /etc/tracker cp tracker /etc/init.d/ Add a daemon with sequence of 95 update-rc.d tracker defaults 95 The daemon script supports start, stop, restart & status For example as root: /etc/init.d/tracker status Starting tracker or spy from command line without using script -------------------------------------------------------------- Make sure tracker or spy is not already running screen -ls screen -S Tracker -c /etc/tracker/.screenrc.trk or screen -S Spy -c /etc/tracker/.screenrc.spy Console Programs ================ Stand alone programs displaying to console only. ./aprs-is --------- ./aprs-is -c /aprs.ini Display packets from an APRS server. Need to specify in ini file: [net] server_host_address, server_port and range [static] lat and long [gps] type=static ./aprs-ax25 ----------- ./aprs-ax25 -c /aprs.ini Display packets from AX.25 stack Need to edit compile time define aprs-ax25.c and remove #define PKT_SOCK_ENABLE. ./fakegps --------- Continuously display gps GGA & RMC sentences that will be used if [gps]:type=static is configured. ./faptest < file_containing_aprs_packet --------------------------------------- Reads a packet from stdin and passes to fap library. For dantracker kk7ds ONLY ========================= Configuration ============= Copy one of the ini files from examples directory to same directory as aprs executable and rename to aprs.ini Running dantracker kk7dds edition ================================= Stress-test by using examples/aprstest.ini (modified as appropriate), which will attempt to eat the entire APRS-IS world feed without crashing. Test Programs ------------- Test stand alone programs displaying to console. ./aprs-is ./aprs-ax25 Test display interface. Using socket connect with AF_INET ./ui -i with ./uiclient -i [NAME] [VALUE] Using socket connect wit AF_UNIX ./ui -w with ./uiclient -w [NAME] [VALUE] Normal operation ---------------- UI socket connect via AF_INET ./ui -i with ./aprs -d 127.0.0.1 UI socket connect via AF_UNIX ./ui -w with ./aprs r Code Pull Requests 0 Pulse Graphs Network HTTPS clone URL You can clone with HTTPS, or Subversion. 169 commits 1 branch 0 releases 2 contributors C 72.5% JavaScript 20.6% Shell 6.7% Python 0.1% Ini parser: http://ndevilla.free.fr/iniparser/ CFLAGS = -g -Wall -I/path/to/iniparser/src Errata ------ 11/30/14 - Significant updates, work arounds for known issues with newer Node.JS versions, compiling issues, etc. 09/22/13 - first solid version