Help Sending Data over APRS (RF)

813 views
Skip to first unread message

Andrew Koenig

unread,
Jul 16, 2015, 11:46:55 AM7/16/15
to weewx...@googlegroups.com
Hello Group!

I've been tasked with setting up a few RaspberryPis paired with Pete Bros Ultimeter 100s. These will go to various sites maintained by the local amateur radio club. The project calls for sending the weather information to Weather Underground, the APRS network (via RF), and to rsync the generated webpages to a server. The RF request is important, as this data will be used by storm spotters in the field. The easiest way to do this is to just use a Byonics WXTrak, but that doesn't produce the nice graphs from weewx or report to Weather Underground every couple of seconds.

I currently have direwolf running with a MaxTrac300 and a USB soundcard. The TNC setup is stable and actually does a really good job. I'm running the aprx daemon.

My dilemma is that the aprx daemon can poll a file and send that over the air at a given interval, or it can execute a script and send the stdout over the air. Is it possible to run a command and have it spit out the most current CWOP packet?

I've looked through the CWOP section, and it appears to be rather easy to add a few "f.write" lines to siphon the packet out and send it to a file, but if that file is only polled once every 600 seconds, it could be 599 seconds out of date before it even gets sent over the air.

Thoughts?

73 de KE5GDB

Thomas Keffer

unread,
Jul 16, 2015, 11:56:33 AM7/16/15
to weewx-user
There are several different ways of doing this.

First, you could follow the pattern set by the Weather Underground "Rapidfire" protocol. While the WU on-the-wire protocol is quite different from CWOP, you can see how it deals with broadcasting LOOP packets instead of archive records. You would then modify the existing CWOP implementation, following an analogous pattern.

The other option is to write a weewx service that saves the most recent LOOP packet to a file, to be picked up by your aprx daemon. 

In either case, because the LOOP packets can come quite often, every 2 seconds in the case of a Vantage station (not sure about the Ultimeter), you need to make sure whatever you write does not block for too long. Use short timeouts.

Hope this helps.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Koenig

unread,
Jul 16, 2015, 1:14:42 PM7/16/15
to weewx...@googlegroups.com
Ah, and this is where it goes over my head a bit. Doing a little copy-pasta on the CWOP service is in my domain, but the loop packets go over my head a little bit. I need to look over the code a little more thoroughly.

If I'm reading this right, everything is done in the restx.py file, correct?

P Simmons

unread,
Jul 16, 2015, 1:23:50 PM7/16/15
to weewx...@googlegroups.com
Here's and old thread that may help...

https://groups.google.com/forum/#!topic/weewx-user/ZKPcsnA0N6Y

Later,
Paul

Nate Bargmann

unread,
Jul 16, 2015, 11:13:24 PM7/16/15
to weewx...@googlegroups.com
Here is how I solved it (serendipity).

My one Pi runs WeeWX and sends the data to APRS-IS using the call N0NB.

The other Pi is running APRX and using the call N0NB-10. The APRS-IS
filter set by APRX asks for everything within 100km of my location. As
the calls are different, APRS-IS happily sends my weather to APRX and it
gets transmitted locally (no WIDE aliases).

As these two Pis will eventually be in separate locations, it wasn't
feasible for me to run WeeWX and APRX on the same Pi.

- Nate

--

"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us

Andrew Koenig

unread,
Jul 16, 2015, 11:29:14 PM7/16/15
to weewx...@googlegroups.com
I like the general principle of that idea, but the internet connection on this device will not be reliable. The end goal is to put it out at one of the local club's repeater sites, and use BBHN as the backhaul. Now, I like BBHN, and it's been fairly stable, but these are also 20+km links.

I think what I'm going to do is set the archive interval to 60 seconds, which will recreate that file once a minute. Then, ideally, the data will be no older than 60 seconds when beaconed via RF.

73 de KE5GDB

Andrew Koenig

unread,
Jul 17, 2015, 12:05:06 AM7/17/15
to weewx...@googlegroups.com
Here's what I've implemented. It seems to work fairly well.

I bumped the post_interval on CWOP up to 60 seconds. Kinda fast, yes I know, but it'll work.

I added these three lines just after the declaration of the send_packet function:

f = open('/mnt/ramdisk/wxpacket.txt', 'w')
f.write(tnc_packet)
f.close()

So, with that code inserted, and the rest of the method block commented out, it's writing to the ramdisk (rc.local -> mount -t tmpfs -o size=1m tmpfs /mnt/ramdisk) once a minute and not sending anything to the APRS-IS servers.

The final step is to write an aprx beacon in this manner:
beacon timeout 2 exec /usr/local/bin/weewx_packet.sh

where weewx_packet.sh is simply

#!/bin/bash
cut -d":" -f2 /mnt/ramdisk/wxpacket.txt

[I don't think aprx supports bash one-liners]

So anyway, that should work, but I've only made it to the ramdisk stage in my plan. My Pi/Ultimeter combo currently lacks an interface cable (on the agenda for tomorrow), so I had to test it out on K5UTD-1. Unfortunately that aprx instance is receive only due to the antenna multicoupler situation.

Hopefully the future google searches for aprx/weewx can learn something from my experiences.

73 de KE5GDB

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/ENd6MSlT4Ig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Andrew Koenig

Thomas Keffer

unread,
Jul 17, 2015, 12:16:18 AM7/17/15
to weewx-user
Just a point of style: it would be better to subclass the present class CWOPThread, adding a specialized version of send_packet(). This version would first call CWOPThread's version, then do your write-to-file code. Then, in weewx.conf, you replace weewx.restx.CWOPThread with the path to your specialized class. Put the class in the user subdirectory.

If you don't do this, you're committing to forever modify the code in restx.py with every upgrade.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Glen Roe

unread,
Mar 13, 2016, 2:23:57 PM3/13/16
to weewx-user
I'm looking to use a Pi in place of a opentracker with dedicated FW that will key a 2 meter transmitter.
I use PBros 800 protocol or argent data wx instruments now. I'd like to be able to have all the current APRS features and radio keying, as well as some aux input states that could be read in the raw data. That or profile changing if a state changes to add a different info header.
The reason for a change is to have more expansion options used my the popular Pi. More programmers my help I'm counting on.
I hope this is already happening? I'm of course looking for a working version I can try and lean to modify.
Thank you

Dave Webb KB1PVH

unread,
Mar 13, 2016, 2:30:54 PM3/13/16
to weewx...@googlegroups.com

See if this thread helps you out any.

https://groups.google.com/forum/?nomobile=true#!searchin/weewx-user/Aprs/weewx-user/ENd6MSlT4Ig

Dave-KB1PVH

Sent from my Samsung S4

Reply all
Reply to author
Forward
0 new messages