Created
April 25, 2015 23:29
-
-
Save godber/a66493ac47ee3d623c4f to your computer and use it in GitHub Desktop.
Sample parsing APRS Packets with Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2015-04-25 09:09:18 MST, 309 | |
| 2015-04-25 09:11:17 MST, 1089 | |
| 2015-04-25 09:13:16 MST, 1968 | |
| 2015-04-25 09:15:16 MST, 2855 | |
| 2015-04-25 09:17:16 MST, 3710 | |
| 2015-04-25 09:19:16 MST, 4588 | |
| 2015-04-25 09:21:15 MST, 5432 | |
| 2015-04-25 09:23:15 MST, 6317 | |
| 2015-04-25 09:25:15 MST, 7226 | |
| 2015-04-25 09:27:14 MST, 8148 | |
| 2015-04-25 09:27:15 MST, None | |
| 2015-04-25 09:29:14 MST, 9047 | |
| 2015-04-25 09:31:14 MST, 9940 | |
| 2015-04-25 09:33:14 MST, 10813 | |
| 2015-04-25 09:35:13 MST, 11674 | |
| 2015-04-25 09:37:14 MST, 12530 | |
| 2015-04-25 09:39:13 MST, 13271 | |
| 2015-04-25 09:41:14 MST, 14028 | |
| 2015-04-25 09:43:14 MST, 14682 | |
| 2015-04-25 09:45:14 MST, 15259 | |
| 2015-04-25 09:47:14 MST, 15894 | |
| 2015-04-25 09:49:14 MST, 16624 | |
| 2015-04-25 09:51:14 MST, 17314 | |
| 2015-04-25 09:53:15 MST, 18158 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2015-04-25 09:10:34 MST: W7ASU-2>S2TSXY,WIDE2-1,qAR,KE8DM:`*.FlfhO/'"<U}|!;!x||3 | |
| 2015-04-25 09:12:35 MST: W7ASU-2>S2TTPY,WIDE2-1,qAR,K7ACS:`*-qn\bO/'"Ej}|!<!x||3 | |
| 2015-04-25 09:16:35 MST: W7ASU-2>S2TTSR,WIDE2-1,qAR,K7ACS:`*,&m\jO/'"Y5}Byonics MT-1000|!>!x||3 | |
| 2015-04-25 09:18:35 MST: W7ASU-2>S2TTUR,WIDE2-1,qAR,KE8DM:`**|nHdO/'"bn}|!?!x||3 | |
| 2015-04-25 09:20:36 MST: W7ASU-2>S2TTVX,WIDE2-1,qAR,K7ACS:`*)mo*~O/'"l?}|!@!w||3 | |
| 2015-04-25 09:22:36 MST: W7ASU-2>S2TTWU,WIDE2-1,qAR,K7ACS:`*(No>yO/'"ul}|!A!w||3 | |
| 2015-04-25 09:22:37 MST: W7ASU-2>S2TTWU,CREBC-1*,WIDE2*,qAR,N6EAJ:`*(No>yO/'"ul}|!A!w||3<0xa9><0xdc> [Duplicate telemetry sequence, Delayed or out-of-order packet (sequence number)] | |
| 2015-04-25 09:24:36 MST: W7ASU-2>S2TUPU,WIDE2-1,qAR,K7ACS:`*'3o\gO/'#$z}Byonics MT-1000|!B!w||3 | |
| 2015-04-25 09:26:37 MST: W7ASU-2>S2TURV,WIDE2-1,qAR,KC0LL-10:`*arnR_O/'#/$}|!C!w||3 | |
| 2015-04-25 09:28:37 MST: W7ASU-2>S2TUVS,WIDE2-1,qAR,KD6GHX:`*`Pnz^O/'#92}|!D!v||3 | |
| 2015-04-25 09:30:37 MST: W7ASU-2>S2TUXQ,WIDE2-1,qAR,KB7KFC-1:`*^vp>iO/'#Bu}|!E!v||3 | |
| 2015-04-25 09:30:38 MST: W7ASU-2>S2TUXQ,CREBC-1*,WIDE2*,qAR,N6EAJ:`*^vp>iO/'#Bu}|!E!v||3R) [Duplicate telemetry sequence, Delayed or out-of-order packet (sequence number)] | |
| 2015-04-25 09:32:38 MST: W7ASU-2>S2TUYX,WIDE2-1,qAR,KE8DM:`*]/q\cO/'#M,}Byonics MT-1000|!F!v||3 | |
| 2015-04-25 09:32:39 MST: W7ASU-2>S2TUYX,CREBC-1*,WIDE2*,qAR,N6EAJ:`*]/q\cO/'#M,}Byonics MT-1000|!F!v||3<0xc2>0 [Duplicate telemetry sequence, Delayed or out-of-order packet (sequence number)] | |
| 2015-04-25 09:34:38 MST: W7ASU-2>S2TVVU,WIDE2-1,qAR,KC0LL-10:`*[0pzYO/'#V+}|!G!u||3 | |
| 2015-04-25 10:32:34 MST: W7ASU-2>S2TYRV,WIDE2-1,qAR,W7DXJ-3:`)@Zr mO/'#]]}|!H!p||3 | |
| 2015-04-25 10:34:35 MST: W7ASU-2>S2TYWX,WIDE2-1,qAR,KE8DM:`)>Pp\qO/'#EO}|!I!q||3 | |
| 2015-04-25 10:36:36 MST: W7ASU-2>S2UPQY,WIDE2-1,qAR,KE8DM:`)<wp*`O/'#/y}Byonics MT-1000|!J!q||3 | |
| 2015-04-25 10:40:37 MST: W7ASU-2>S2UPYS,WIDE2-1,qAR,KC0LL-10:`):6o4`O/'"eM}|!L!p||3 | |
| 2015-04-25 10:44:40 MST: W7ASU-2>S2UQUT,CHILDS,WIDE2*,qAR,KC0LL-10:`)8>m>KO/'"E6}Byonics MT-1000|!N!p||3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2015-04-25 09:10:34 MST: W7ASU-2>S2TSXY,WIDE2-1,qAR,KE8DM:`*.FlfhO/'"<U}|!;!x||3 | |
| 2015-04-25 09:12:35 MST: W7ASU-2>S2TTPY,WIDE2-1,qAR,K7ACS:`*-qn\bO/'"Ej}|!<!x||3 | |
| 2015-04-25 09:16:35 MST: W7ASU-2>S2TTSR,WIDE2-1,qAR,K7ACS:`*,&m\jO/'"Y5}Byonics MT-1000|!>!x||3 | |
| 2015-04-25 09:18:35 MST: W7ASU-2>S2TTUR,WIDE2-1,qAR,KE8DM:`**|nHdO/'"bn}|!?!x||3 | |
| 2015-04-25 09:20:36 MST: W7ASU-2>S2TTVX,WIDE2-1,qAR,K7ACS:`*)mo*~O/'"l?}|!@!w||3 | |
| 2015-04-25 09:22:36 MST: W7ASU-2>S2TTWU,WIDE2-1,qAR,K7ACS:`*(No>yO/'"ul}|!A!w||3 | |
| 2015-04-25 09:24:36 MST: W7ASU-2>S2TUPU,WIDE2-1,qAR,K7ACS:`*'3o\gO/'#$z}Byonics MT-1000|!B!w||3 | |
| 2015-04-25 09:26:37 MST: W7ASU-2>S2TURV,WIDE2-1,qAR,KC0LL-10:`*arnR_O/'#/$}|!C!w||3 | |
| 2015-04-25 09:28:37 MST: W7ASU-2>S2TUVS,WIDE2-1,qAR,KD6GHX:`*`Pnz^O/'#92}|!D!v||3 | |
| 2015-04-25 09:30:37 MST: W7ASU-2>S2TUXQ,WIDE2-1,qAR,KB7KFC-1:`*^vp>iO/'#Bu}|!E!v||3 | |
| 2015-04-25 09:32:38 MST: W7ASU-2>S2TUYX,WIDE2-1,qAR,KE8DM:`*]/q\cO/'#M,}Byonics MT-1000|!F!v||3 | |
| 2015-04-25 09:34:38 MST: W7ASU-2>S2TVVU,WIDE2-1,qAR,KC0LL-10:`*[0pzYO/'#V+}|!G!u||3 | |
| 2015-04-25 10:32:34 MST: W7ASU-2>S2TYRV,WIDE2-1,qAR,W7DXJ-3:`)@Zr mO/'#]]}|!H!p||3 | |
| 2015-04-25 10:34:35 MST: W7ASU-2>S2TYWX,WIDE2-1,qAR,KE8DM:`)>Pp\qO/'#EO}|!I!q||3 | |
| 2015-04-25 10:36:36 MST: W7ASU-2>S2UPQY,WIDE2-1,qAR,KE8DM:`)<wp*`O/'#/y}Byonics MT-1000|!J!q||3 | |
| 2015-04-25 10:40:37 MST: W7ASU-2>S2UPYS,WIDE2-1,qAR,KC0LL-10:`):6o4`O/'"eM}|!L!p||3 | |
| 2015-04-25 10:44:40 MST: W7ASU-2>S2UQUT,CHILDS,WIDE2*,qAR,KC0LL-10:`)8>m>KO/'"E6}Byonics MT-1000|!N!p||3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2015-04-25 09:10:34 MST, 790 | |
| 2015-04-25 09:12:35 MST, 1630 | |
| 2015-04-25 09:16:35 MST, 3397 | |
| 2015-04-25 09:18:35 MST, 4273 | |
| 2015-04-25 09:20:36 MST, 5136 | |
| 2015-04-25 09:22:36 MST, 6000 | |
| 2015-04-25 09:24:36 MST, 6924 | |
| 2015-04-25 09:26:37 MST, 7839 | |
| 2015-04-25 09:28:37 MST, 8763 | |
| 2015-04-25 09:30:37 MST, 9649 | |
| 2015-04-25 09:32:38 MST, 10577 | |
| 2015-04-25 09:34:38 MST, 11395 | |
| 2015-04-25 10:32:34 MST, 12082 | |
| 2015-04-25 10:34:35 MST, 9884 | |
| 2015-04-25 10:36:36 MST, 7924 | |
| 2015-04-25 10:40:37 MST, 4513 | |
| 2015-04-25 10:44:40 MST, 1578 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aprslib | |
| def main(infile): | |
| """docstring for main""" | |
| with open(infile) as f: | |
| for line in f: | |
| timestamp = line[:23] | |
| aprs_packet = line[24:].strip() | |
| try: | |
| aprs_data = aprslib.parse(aprs_packet) | |
| print "%s, %s" % (timestamp, aprs_data.get('altitude', None)) | |
| except (aprslib.ParseError, aprslib.UnknownFormat) as exp: | |
| #print aprs_packet | |
| pass | |
| if __name__ == '__main__': | |
| import sys | |
| main(sys.argv[1]) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I grabbed the raw packets from http://aprs.fi for both W7ASU-0 and W7ASU-2, cleaned up the duplicate and bad packets and saved them in the files:
w7asu-0-aprs-fi.txtandw7asu-2-aprs-fi.txt.Then I wrote the
w7asu-parse.py, which parses those files to generate thew7asu-2-decoded.txtandw7asu-2-decoded.txtoutput files, which are just timestamp followed by the altitude in meters. I will plot these at some point.