项目作者: adriann0

项目描述 :
JavaScript module for parsing APRS messages
高级语言: JavaScript
项目地址: git://github.com/adriann0/npm-aprs-parser.git
创建时间: 2017-02-07T22:57:33Z
项目社区:https://github.com/adriann0/npm-aprs-parser

开源协议:GNU General Public License v3.0

下载


npm-aprs-parser

JavaScript library for parsing APRS packets.

Code Example

  1. const aprs = require("aprs-parser");
  2. const parser = new aprs.APRSParser();
  3. console.log(parser.parse("SQ7PFS-10>APRS,TCPIP*,qAC,T2SYDNEY:@085502h4903.50N/07201.75W-PHG5132Hello world/A=001234"));
  4. console.log();
  5. console.log(parser.parse("SQ7PFS-10>S32U6T,TCPIP*,qAC,T2SYDNEY:`(_fn\"Oj/>Hellov"));

Output:

  1. APRSMessage {
  2. from: Callsign { ssid: '10', call: 'SQ7PFS' },
  3. to: Callsign { call: 'APRS' },
  4. via:
  5. [ Callsign { call: 'TCPIP*' },
  6. Callsign { call: 'qAC' },
  7. Callsign { call: 'T2SYDNEY' } ],
  8. raw: 'SQ7PFS-10>APRS,TCPIP*,qAC,T2SYDNEY:@085502h4903.50N/07201.75W-PHG5132Hello world/A=001234',
  9. data:
  10. Position {
  11. latitude: 49.05833333333333,
  12. longitude: -72.02916666666667,
  13. symbol: '/-',
  14. symbolIcon: 'Home',
  15. extension: PHG { heightFeet: 20, gaindB: 3, directivityDeg: 90, powerWatts: 25 },
  16. altitude: 376.1232,
  17. comment: 'Hello world',
  18. timestamp: Mon Feb 27 2017 09:55:02 GMT+0100 (CET),
  19. msgEnabled: true } }
  20. APRSMessage {
  21. from: Callsign { ssid: '10', call: 'SQ7PFS' },
  22. to: Callsign { call: 'S32U6T' },
  23. via:
  24. [ Callsign { call: 'TCPIP*' },
  25. Callsign { call: 'qAC' },
  26. Callsign { call: 'T2SYDNEY' } ],
  27. raw: 'SQ7PFS-10>S32U6T,TCPIP*,qAC,T2SYDNEY:`(_fn"Oj/>Hellov',
  28. data:
  29. MICEPosition {
  30. latitude: 33.42733333333334,
  31. longitude: -12.129,
  32. mice: 'returning',
  33. symbol: '/j',
  34. symbolIcon: 'Jeep',
  35. extension: CourseSpeed { courseDeg: 251, speedMPerS: 10.28888888 },
  36. radio: 'Kenwood TH-D7A Mobile',
  37. comment: 'Hello' } }

Code Example - weather station support

  1. const aprs = require("aprs-parser");
  2. const parser = new aprs.APRSParser();
  3. console.log(parser.parse("FW7233>APRS,TCPXX*,qAX,CWOP-2:@231821z5150.13N/01913.68E_239/003g010t042r000p011P011b09969h83L000eMB51"));

Output:

  1. APRSMessage {
  2. from: Callsign { call: 'FW7233' },
  3. to: Callsign { call: 'APRS' },
  4. via: [
  5. Callsign { call: 'TCPXX*' },
  6. Callsign { call: 'qAX' },
  7. Callsign { ssid: '2', call: 'CWOP' }
  8. ],
  9. raw: 'FW7233>APRS,TCPXX*,qAX,CWOP-2:@231821z5150.13N/01913.68E_239/003g010t042r000p011P011b09969h83L000eMB51',
  10. data: Position {
  11. latitude: 51.8355,
  12. longitude: 19.228,
  13. symbol: '/_',
  14. symbolIcon: 'WX Station',
  15. extension: CourseSpeed { courseDeg: 239, speedMPerS: 1.543333332 },
  16. weather: {
  17. windGust: 4.4704,
  18. temperature: 5.555555555555555,
  19. rain1h: 0,
  20. rain24h: 2.794,
  21. rainSinceMidnight: 2.794,
  22. pressure: 996.9,
  23. humidity: 83,
  24. luminosity: 0
  25. },
  26. comment: 'eMB51',
  27. timestamp: 2021-01-23T18:21:00.000Z,
  28. msgEnabled: true
  29. }

For WX stations with position CourseSpeed extension is used to represent wind speed and direction. Units used in weather report:

  • rain1h, rain24h, rainSinceMidnight - millimeters
  • windGust - meters per second
  • temperature - Celcius
  • pressure - millibars
  • luminosity - watts per square meter
  • snow - centimeters
  • humidity - %

Code Example - APRS Stream

This library also supports connecting to the APRS “firehose”. An amateur radio license is required to connect.

  1. const aprs = require("aprs-parser");
  2. const stream = new aprs.APRSISConnector;
  3. stream.connect('YOUR-AMATEUR-RADIO-CALLSIGN');
  4. stream.on('aprs', (event)=>{
  5. console.log(event)
  6. });

Installation

  1. $ npm install aprs-parser --save

Supported data types

  • Position
  • Objects
  • Current MIC-E
  • Telemetry
  • Messages
  • Status reports
  • Weather

License

Library is licensed under the GNU Lesser General Public License.

Library by adriann0 with Kris Linquist as an additional contributor.