Skip to contentSkip to conversation

Announcing Perl module for parsing APRS packets

DISCUSSION Jeff Laughlin 7 participants 14 messages Aug 5, 2005 – Aug 11, 2005

lore
Share & tools
lore
#0 lore raw

Hello,

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Once the data is in a friendlier format in the hash structure, it can be used to generate Google Earth KML, or combined with the Google Maps API to create a FOSS findu.com replacement.

OK this is actually from my IARU 2005 contest log but these could just as easily be APRS stations :)
http://www.n1ywb.com/pics/iaru05.jpg

Also I would like to start working on a complementary module to construct APRS packets from the hash structure returned by the parser module. Applications could include a highly intelligent digipeater.

Comments and suggestions are appreciated.

73 de n1ywb

#1 lore raw

wow... cool....

i was considering writing one myself, but well done... i'm going to have a propper play when i get back home from a tournament i'm in...

keep up the good work

regards & 73
Charles - 2E0GOM

Kirklees RAYNET - http://www.kirkleesraynet.org.uk

Quoted 12 lines

Hello,

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

#2 lore raw
Quoted 6 lines
Quoted 6 lines

Hello,

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

Quoted 6 lines
Quoted 6 lines

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Perhaps it can be included in CPAN?

73, de Nate >>

Signature · 5 lines
 Wireless | Amateur Radio Station N0NB          |  Successfully Microsoft
  Amateur radio exams; ham radio; Linux info @  | free since January 1998.
             http://www.qsl.net/n0nb/           |  "Debian, the choice of
             My Kawasaki KZ-650 SR @            |     a GNU generation!"
        http://www.networksplus.net/n0nb/       |   http://www.debian.org
#3 lore raw

<CUT>

Quoted 1 line

Perhaps it can be included in CPAN?

never even thought of that one lol

regards/73
Charles - 2E0GOM

#4 lore raw
In reply to Jeff Laughlin
Quoted 10 lines · Jeff Laughlin

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Have you considered tracking down the Perl code that Ian (the APRS spec editor) created which decodes packets? That was quite complete and fully decoded everything similar to the "listen" command.

--
Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"

#5 lore raw
Quoted 13 lines · On 8/10/05, Curt, WE7U <[email protected]> wrote:
Quoted 10 lines · Jeff Laughlin

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Quoted 4 lines

Have you considered tracking down the Perl code that Ian (the APRS spec editor) created which decodes packets? That was quite complete and fully decoded everything similar to the "listen" command.

Could this be used to dump APRS data into a db like MySQL? I am interested in doing something like that, but have to learn about db. I work with them up to a certain point, time to learn the rest and getting APRS data into a db would be a neat exersize.

Signature · 5 lines
Chuck Hast 
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
#6 lore raw
Quoted 6 lines · Chuck Hast
Quoted 4 lines

Have you considered tracking down the Perl code that Ian (the APRS spec editor) created which decodes packets? That was quite complete and fully decoded everything similar to the "listen" command.

Could this be used to dump APRS data into a db like MySQL?

Perl? Or Ian's program?

Yes to the first. Combine Either Ian's or this new program with a bit of Perl database code and you can inject this into a database. I've done a bunch of sybperl and Perl5 talking to Sybase and it works quite well.

Quoted 4 lines

I am interested
in doing something like that, but have to learn about db. I work with them up to a certain point, time to learn the rest and getting APRS data into a db would be a neat exersize.

Yep!

MySQL has some spatial extensions which would be useful (so you can query on lat/long). PostgreSQL with the PostGIS extensions also gives you this. I've been hoping to play with these at some point myself.

--
Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"

#7 lore raw
In reply to Chuck Hast
Quoted 19 lines · Chuck Hast
Quoted 13 lines · On 8/10/05, Curt, WE7U <[email protected]> wrote:
Quoted 10 lines · Jeff Laughlin

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Quoted 4 lines

Have you considered tracking down the Perl code that Ian (the APRS spec editor) created which decodes packets? That was quite complete and fully decoded everything similar to the "listen" command.

Quoted 4 lines

Could this be used to dump APRS data into a db like MySQL? I am interested in doing something like that, but have to learn about db. I work with them up to a certain point, time to learn the rest and getting APRS data into a db would be a neat exersize.

Yes that is certainly a possibility... In fact I am working on that right now! My next code release will be a complete FOSS findu.com replacement, with a postgresql backend.

http://www.trackulator.com/

Expect to see it sometime in the next few weeks.

#8 lore raw
Quoted 7 lines · Jeff Laughlin

Yes that is certainly a possibility... In fact I am working on that right now! My next code release will be a complete FOSS findu.com replacement, with a postgresql backend.

http://www.trackulator.com/

Expect to see it sometime in the next few weeks.

With PostGIS extensions I hope?

Hey, how about working in 'C' and doing the same thing for Xastir-2???? That's the direction we're wanting to go.

--
Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"

#9 lore raw
Quoted 6 lines · On 8/10/05, Curt, WE7U <[email protected]> wrote:
Quoted 4 lines · Jeff Laughlin

Yes that is certainly a possibility... In fact I am working on that right now! My next code release will be a complete FOSS findu.com replacement, with a postgresql backend.

Quoted 8 lines
Quoted 3 lines

http://www.trackulator.com/

Expect to see it sometime in the next few weeks.

With PostGIS extensions I hope?

Hey, how about working in 'C' and doing the same thing for Xastir-2???? That's the direction we're wanting to go.

Yes, that is where I want to go, I would like to be able to dump the APRS data to a db, probably will try to set things up to where only certain calls are dumped to the db because I want to gather this for disaster activities, actually my mapper would be linked to the db and so all data goes into the db and the mapping is done out of the db. That is the way we do RF coverage study data where I work. We dump all of the data captures into a db and then I link the mapper to the db and look at the selected data.

Signature · 5 lines
Chuck Hast 
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
#10 lore raw
In reply to Curt, WE7U
Quoted 2 lines · On Wed, 10 Aug 2005, Curt, WE7U wrote:

Hey, how about working in 'C' and doing the same thing for Xastir-2???? That's the direction we're wanting to go.

I have a PERL APRS library that's about medium complete. See 'libaxu' on Sourceforge. I've not put much more effort in to it since I believe the real need these days is a "golden parser" for APRS in a standard language like C/C++. Then it can be leveraged by all platforms - including PERL.

73,
Bill - WA7NWP

#11 lore raw
In reply to Chuck Hast
Quoted 4 lines · Chuck Hast

Could this be used to dump APRS data into a db like MySQL? I am interested in doing something like that, but have to learn about db. I work with them up to a certain point, time to learn the rest and getting APRS data into a db would be a neat exersize.

Consider SQLite as a light-weight self-contained DB for this sort of thing. It leaves MySQL/Postgres in the dust, and never misses a beat. My Perl/Tk realtime logger uses it.

Have a look at the sources for example code (not necessarily state of the art ;-)

http://zl2arn.ath.cx/zl2bsj/qle-0.0.3.tar.gz

HTH...

Wilbert, ZL2BSJ

#12 lore raw
In reply to Curt, WE7U

Hi Curt,

Thanks for the suggestion. I wasn't aware that it existed.

After thwarting a few broken links I did manage to find a copy. It targets perl 4, it's not a module, and it outputs formatted text instead of a data structure, so it doesn't exactly acheive the same goals that I have. However it is GPL'ed which is good, so I may be able to re-use some of it's parsing code without tainting my code. I still have quite a bit left to implement to have a complete implementation. And it will certainly be nice to have another GPL code base to reference other than XASTIR.

Quoted 24 lines · On 8/10/05, Curt, WE7U <[email protected]> wrote:
Quoted 10 lines · Jeff Laughlin

I've written a Perl module, Ham::APRS::Parser, for parsing APRS packets, and I've released it under the GPL. You can find it here:
http://aprs.n1ywb.com/Ham-APRS-Parser-0.01/

It takes the packet string, parses it, and returns a hash with the data in a consistent and easy to process format. Currently it reliably returns position, from and to calls, digi-path, symbols, and Mic-E status reports from normal position reports, compressed position reports, and Mic-E position reports. More work is needed to fully implement the APRS protocol.

Have you considered tracking down the Perl code that Ian (the APRS spec editor) created which decodes packets? That was quite complete and fully decoded everything similar to the "listen" command.

--
Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"

#13 lore raw
Quoted 1 line · Jeff Laughlin

Thanks for the suggestion. I wasn't aware that it existed.

I had an _extremely_ minor part in it I think: I remember pointing Ian towards Perl with a bit of example code to snag/parse packets and he went crazy with it from that point!

Quoted 8 lines

After thwarting a few broken links I did manage to find a copy. It targets perl 4, it's not a module, and it outputs formatted text instead of a data structure, so it doesn't exactly acheive the same goals that I have. However it is GPL'ed which is good, so I may be able to re-use some of it's parsing code without tainting my code. I still have quite a bit left to implement to have a complete implementation. And it will certainly be nice to have another GPL code base to reference other than XASTIR.

That was the idea. I didn't think it'd be directly usable, but examples are always good.

Also look at the OpenTrac parsing code in Scott's "listen" patches or in Xastir (Xastir code is directly derived from Scott's code). Might as well do that too! It's much easier to parse than APRS anyway, something about being designed for parsing from the get-go I suppose...

--
Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"