ag1le
Posts: 1
Joined: Mon Jul 30, 2012 5:30 am

APRS tracking mash-up

Mon Jul 30, 2012 5:38 am

I wanted to test how Raspberry Pi would work as a small web server for APRS tracking purposes.
APRS is used by ham radio amateurs to track moving stations - general public may have seen APRS trackers for instance in high altitude balloon tracking etc.

I created a simple Javascript mash-up page using APIs - see the results in here:
http://ag1le.blogspot.com/2012/07/raspb ... sh-up.html

Image

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Sun Aug 19, 2012 9:13 am

Not exactly what you're doing, but I've just set up a Pi to act as an APRS digipeater and iGate using an application called aprx connected to a Byonics TinyTrack4 via ttyAMA0 -> RS232.
EOF

mattjfrank
Posts: 4
Joined: Sat Oct 06, 2012 2:45 am

Re: APRS tracking mash-up

Sat Oct 06, 2012 2:49 am

aquarat wrote:Not exactly what you're doing, but I've just set up a Pi to act as an APRS digipeater and iGate using an application called aprx connected to a Byonics TinyTrack4 via ttyAMA0 -> RS232.
I was hoping you could tell me if you had any issues connecting the TinyTrack4 to the gpio serial port pins? I am.

I have removed the stuff from the boot file for ttyAMA0 and also from the inittab file and given pi access to the dialout group.

I'm able to see some data using cat /dev/ttyAMA0 but it's not the correct data, the data I see using cat /dev/ttyUSB0 when i plug in a serial usb adapter is the right data. As soon as I submit this post I will be starting over fresh to see if I have better luck

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Sat Oct 06, 2012 5:45 pm

Hi

My APRS Pi has been working flawlessly.

Here are the major config files on my system :
/etc/inittab :

Code: Select all

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3


#Spawn a getty on Raspberry Pi serial line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
and /etc/aprx.conf :

Code: Select all

mycall  ZS1LER-1

<aprsis>
login    ZS1LER-1 # login defaults to $mycall
server    euro.aprs2.net    14580
</aprsis>

<logging>
pidfile /var/run/aprx.pid
rflog /var/log/aprx/aprx-rf.log
aprxlog /var/log/aprx/aprx.log
</logging>

<interface>
   serial-device /dev/ttyAMA0  19200 8n1    KISS
   callsign     $mycall  # callsign defaults to $mycall
   tx-ok        true    # transmitter enable defaults to false
</interface>

<beacon>
beaconmode  both
cycle-size  30m
beacon raw                      "!3350.93S/01840.12ErPHG9133Linux iGate :)"
</beacon>
and /boot/cmdline.txt :

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
And that's all there is too it :) .

P.S. Although it's kind of outside of the goals of this post; remember to calibrate the levels on the TinyTrak
EOF

mattjfrank
Posts: 4
Joined: Sat Oct 06, 2012 2:45 am

Re: APRS tracking mash-up

Sat Oct 06, 2012 6:15 pm

I'm starting to think that something may be wrong with the serial port on my pi then..

I can have a usb serial attached and it works flawlessly.. i attach it to the internal serial and although im getting data across it's not correctly formatted. I was thinking it may have to do with baud or connection type or something was hoping you would tell me you had to make some other change ..

Im not using the program you are.. I'm using a differnet program altogether but that has nothing to do with my issue. Because my issue is visible even when i cat /dev/ttyAMA0 vs cat /dev/ttyUSB0 when doing usb0 i see exactally what i expect when i cant ama0 it's not and when i run my app that talks to that port i get an IO timeout error.. It almost seems like the port is in use even though I dont know what or why or how.

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Sat Oct 06, 2012 6:31 pm

mmm... well there are three things, from my experience with the Pi that could potentially cause serial comm issues :
(1) The most obvious : are you use a decent TTL -> RS232 level shifter ?
Image
Image
(2) I had major issues with this... I found that the serial port didn't work properly when the Pi was attached to certain USB power supplies. Specifically that the Pi was attached to one power supply (dodgy) and the device it was communicating with was attached to another power supply. I didn't investigate the problem extensively, but I'd suspect that the commons/negatives powering the different machines were at different levels, which in turn may have created "ground loops" on the serial connection. I'd suggest that you experiment with different power supplies on the Pi.
(3) Probably obvious, once again; the baud rate and the tx/rx pins (I accidentially connected the wrong pins the first time I tried linking a Pi via ttyAMA0).

I hope this helps.

P.S. In the first pic, a Yaesu FT-2900, in front of it a TinyTrak4 (and out of focus on the right the TTL->RS232 shifter) and then in the foreground the Pi.
In the second pic, a USB->RS232 converter, attached to an RS232->TTL shifter (the same as used on the TT4) and of course the Pi it is attached to on the right. Underneath the Pi is a VHF Motorola Advisor pager.
EOF

mattjfrank
Posts: 4
Joined: Sat Oct 06, 2012 2:45 am

Re: APRS tracking mash-up

Sat Oct 06, 2012 6:37 pm

I hate to admit it but my problem is exactly what i thought it was early on in my troubleshooting. I have to have a ttl rs232 shifter..

Sorry to waste your time, hopefully someone else finds this posts and saves them a lot of time.

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Sat Oct 06, 2012 6:39 pm

Haha, no worries, I'm glad I covered that point :) .
EOF

mattjfrank
Posts: 4
Joined: Sat Oct 06, 2012 2:45 am

Re: APRS tracking mash-up

Tue Oct 16, 2012 4:40 am

aquarat wrote:Haha, no worries, I'm glad I covered that point :) .
Thanks again, I got myself a couple of the shifters and they work great.

Exciton
Posts: 2
Joined: Sat Oct 27, 2012 3:52 pm

Re: APRS tracking mash-up

Sat Oct 27, 2012 4:01 pm

aquarat,

Thanks for posting the fruits of your labor for connecting a Pi to the Byonics TT4. I am in the process of getting a similar station hooked up and appreciate the insight. One question....why did you feel it necessary to add an external TTL to RS232 adapter? The Byonics TT4 comes with a MAX202 adapter chip built in. Did you try without the external adapter and have problems?

Thanks,
Chuck / KG5CA

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Sun Oct 28, 2012 5:26 pm

Hey Exciton

Ah! I honestly had no idea the TT4 had a MAX232(?) in it lol :P I would assume that you have to bypass the chip to use the TT4 with a Pi because the Pi's pins aren't over-voltage tolerant ? sending a RS232 voltage down onto a TTL-Pi pin could damage it ?

I worked out what was causing the interfacing problem. I was using a cheap Chinese power supply and the ground/negative wasn't electrically isolated from the AC supply (LOL)... I knew the neg/com/grnd on the chinese supply wasn't 0v relative to the TT4's supply but I didn't realise how big the difference was until I touched the Pi's USB connector with one hand and an earthed metal object with the other and got a really nasty shock.

I've got so many Pis now, in addition to an Exynos machine (draws a fair bit of power) that I've switched to using a PC-PSU... which has improved everything (stability, performance, shock hazards, interfacing, etc.) quite nicely.
EOF

Exciton
Posts: 2
Joined: Sat Oct 27, 2012 3:52 pm

Re: APRS tracking mash-up

Mon Oct 29, 2012 12:39 am

Aquarat,

The Byonics TT4 has two output ports, Port A and Port B. It appears Port A is hard-wired to the TI Max202 chip such that it is always provides RS232 (dual polarity) output. However, the instruction manual gives instructions such that Port B can be bypassed for straight TTL output from the Atmel processor chip. Thus...we get a choice.

I am new to the Pi. Are the serial output ports of the Pi really RS232 or only TTL? Either way it appears the TT4 can drive it directly, just need to know what the Pi desires.

Thanks for the tip on the power supply.

Best,
Chuck / KG5CA

User avatar
aquarat
Posts: 73
Joined: Thu Jul 26, 2012 2:32 pm
Location: Cape Town, South Africa

Re: APRS tracking mash-up

Mon Oct 29, 2012 6:06 am

Hi Chuck

I didn't realise that, thanks for the explanation @ portA/B. The Pi's UART can only run TTL on 3.3v. It is not over-voltage tolerant, that's why I'm using a MAX232-based converter (which so far has worked very well).
EOF

bprats99
Posts: 30
Joined: Thu Apr 04, 2013 4:54 am
Location: Southern California USA

Re: APRS tracking mash-up

Sun Aug 25, 2013 4:37 am

Although the original post is a year old, I wanted to clarify the issues connecting RS-232 to the RPi serial console pins.

The RPi serial signal is TTL logic at 3.3 to 3.6 volts high and zero volts.
The TX data pin rests at +3.6V and goes low with data
Important: TTL serial is inverted from RS-232

RS-232 is plus / minus 8-15 volts roughly
Most PCs scope at plus/minus 12 volts
The TX data pin rests at -12 volts(my Dell PC) and goes high with data
The inverted signal is the big difference between TTL serial and RS-232 serial

A MAX23 chip can convert RS-232 to TTL then a level converter such as one from Adafruit will convert the 5 volt to 3.6 volts.

Putting RS232 onto a level converter will give 3.6 volts but to repeat, the mark/space polarity will be set by the RS232 signal and is wrong or inverted.

I used tinyterm pro terminal program on the PC and minicom on the RPi and a dual channel scope to observe voltage levels while typing a 'H' . PC and RPi programs were set to 300 baud to make observation easier.

Return to “Networking and servers”