rossengeorgiev / aprs-python

📡 Python module for working with APRS
http://aprs-python.readthedocs.io/en/latest/
GNU General Public License v2.0
115 stars 37 forks source link

Does not support BEACON format. #3

Closed ytjohn closed 9 years ago

ytjohn commented 9 years ago

Hello, I'm working on an APRS client and am liking this library.

I discovered it doesn't support BEACON style messages. The format is a bit different than a standard packet, going directly into comment after the header. I think if we check for parsed['to'].upper() == 'BEACON': we can assume everything in the body is the message.

FROMCALL->BEACON:FROMCALL COMMENT<0x0d)

W3YA-1>BEACON:W3YA-1 Nittany Amateur Radio Club Digipeater<0x0d>
K3ARL-6>BEACON:K3ARL Ogletown APRS Digipeater<0x0d>
K3ARL-5>BEACON:K3ARL Brush Mountain APRS-RPTR<0x0d>
rossengeorgiev commented 9 years ago

Hi, It's not that simple actually. Messages with reserved destination callsign such as BEACON can be a valid position report, or any other format. It's only when they don't match any existing format type are they treated as 'beacons'. I will include support for it in the next release

rossengeorgiev commented 9 years ago

I've added some code for beacons. You can install it via pip:

 pip install --upgrade git+git://github.com/rossengeorgiev/aprs-python.git@dev#egg=aprslib

Although, I noticed a few packets that behave strangely. For example:

WD4INS-4>BEACON,qAR,WB9FHP:S!3703.05NS08741.54W#PHG5360/W3,KYn-N REPEATER 147.195 PL 136.5 PENNYRILE STATE PARK, KY.

That would parse as beacon, but aprs.fi parses it as position report. Not sure how that works exactly as S is not a valid packet type.

rossengeorgiev commented 9 years ago

Here is why they behave like they do:

https://github.com/gitpan/Ham-APRS-FAP/blob/4b6b7e60e1df4ffb92530a0a2e7c037d36a12135/FAP.pm#L2716-L2747