[Xastir] Python

Tom Russo russo at bogodyn.org
Wed Aug 15 22:55:13 EDT 2012


On Wed, Aug 15, 2012 at 07:39:36PM -0400, we recorded a bogon-computron collision of the <n1mie at mac.com> flavor, containing:
> Is it possible to use Python, or some other development platform, to tap Xastir for information? For example I'd like to be able to write a script/app to keep track of my wife's APRS tracker and take action as appropriate. Perhaps then I'd have it light an LED when she's close to home. I have lots of ideas, but I need to know if I can do it that way or find a way to connect directly to an aprsis server.

Xastir has no API that you can connect to externally other than its server 
port, which presents data exactly the same way APRS-IS servers do.  So the
short answer to your question is "No."  But there's a long answer, too.

You could, of course, write a script to read from the server port and look
for your wife's callsign-ssid, then compute the distance from your station
and blink the LED, but then that's exactly the same script you'd use to 
connect to an APRS-IS server without ever using Xastir.

To do what you want would require you to hack on Xastir itself.  There are 
several approaches that could work:  You might look at how the code implements 
proximity alerts using Festival, and hack on that: in the proximity alert 
code, Xastir uses Festival to speak the callsign followed by "distance is " 
followed by the distance, followed by "miles."  This same type of code could 
be hacked, say, to speak only the distance for a *tracked* station that comes 
within the proximity limits, or in your case, run a script or some other 
external program instead of speaking.

"Audio Alarms" could also be used for this purpose, but not without hacking.
The "Audio Alarm" feature doesn't actually play audio --- you simply configure
Xastir to run a particular program with a particular file as an argument when
an alarm event happens.  The intent is that the program is one that can play
audio and the file argument is the name of an audio file, but you *could*
use any program and and any input for it to do something else.  But there
is no specific audio alarm set up for "some specific station is within 
this distance of me" so you'd still need to roll up your sleeves and code
within Xastir to do this.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick




More information about the Xastir mailing list