node-red-contrib-ntrip 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [0.2.3]
|
|
5
|
+
### Added NMEA encoder node - [#13](https://github.com/windkh/node-red-contrib-ntrip/issues/13)
|
|
6
|
+
|
|
4
7
|
## [0.2.2]
|
|
5
8
|
### Added documentation - [#3](https://github.com/windkh/node-red-contrib-ntrip/issues/3)
|
|
6
9
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"id":"ce248cbbb81fedc7","type":"debug","z":"95fe791a9c2e02fb","name":"debug 45","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1100,"y":360,"wires":[]},{"id":"1e5f02ac026876e5","type":"debug","z":"95fe791a9c2e02fb","name":"debug 46","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1100,"y":420,"wires":[]},{"id":"fa8ecd8584cd2497","type":"NmeaDecoder","z":"95fe791a9c2e02fb","description":"","x":780,"y":380,"wires":[["ce248cbbb81fedc7","395ad916396d2633"],["1e5f02ac026876e5"]]},{"id":"458040210a13ca79","type":"serial in","z":"95fe791a9c2e02fb","name":"COM8 USB","serial":"02508e00360cfd65","x":590,"y":380,"wires":[["028e8c8c34a7cb4f","fa8ecd8584cd2497"]]},{"id":"028e8c8c34a7cb4f","type":"debug","z":"95fe791a9c2e02fb","name":"debug 67","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":420,"wires":[]},{"id":"02508e00360cfd65","type":"serial-port","name":"","serialport":"COM8","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"id":"395ad916396d2633","type":"NmeaEncoder","z":"95fe791a9c2e02fb","description":"","x":1100,"y":660,"wires":[["b1d594a6a88edfca","0451732ab38bafa9"],["0aacddfbe23ce47d"]]},{"id":"b1d594a6a88edfca","type":"debug","z":"95fe791a9c2e02fb","name":"debug 65","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1280,"y":620,"wires":[]},{"id":"0aacddfbe23ce47d","type":"debug","z":"95fe791a9c2e02fb","name":"debug 66","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1280,"y":680,"wires":[]},{"id":"8288987f3959d44e","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":540,"wires":[["311378b9c7996b1f"]]},{"id":"311378b9c7996b1f","type":"function","z":"95fe791a9c2e02fb","name":"GPDTM","func":"// https://github.com/Node-NTRIP/nmea/blob/master/src/messages/dtm.ts\nmsg.payload = {\n messageType : 'DTM',\n nmeaMessage : {\n talker: 'GP', \n datum: 'W84',\n // subDatum: string;\n latitudeOffset : 0,\n longitudeOffset: 0,\n altitudeOffset: 0,\n // refDatum: 'W84'\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":540,"wires":[["395ad916396d2633"]]},{"id":"81c6cb1be666c10c","type":"function","z":"95fe791a9c2e02fb","name":"GNGBS","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gbs.ts\nmsg.payload = {\n messageType : 'GBS',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n latitudeError: 0,\n longitudeError: 0,\n altitudeError: 0,\n satelliteId: 1,\n probability: 1,\n bias: 0,\n standardDeviation: 0,\n systemId: 1,\n signalId: 0,\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":580,"wires":[["395ad916396d2633"]]},{"id":"0e982631e6b36163","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":580,"wires":[["81c6cb1be666c10c"]]},{"id":"0451732ab38bafa9","type":"NmeaDecoder","z":"95fe791a9c2e02fb","description":"","x":1320,"y":760,"wires":[["ccc599cb0e9addf6"],[]]},{"id":"ccc599cb0e9addf6","type":"debug","z":"95fe791a9c2e02fb","name":"debug 68","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1480,"y":740,"wires":[]},{"id":"7ea7ecdb2b40ae9c","type":"function","z":"95fe791a9c2e02fb","name":"GNGLL","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gll.ts\nmsg.payload = {\n messageType : 'GLL',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n latitude: 66.66,\n longitude: 33.33,\n status: 'A',\n modeIndicator: 'R',\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":660,"wires":[["395ad916396d2633"]]},{"id":"fa082ed5b7d0ed5a","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":660,"wires":[["7ea7ecdb2b40ae9c"]]},{"id":"9cb944ace7f6806e","type":"function","z":"95fe791a9c2e02fb","name":"GNGGA","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gga.ts\nmsg.payload = {\n messageType : 'GGA',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n latitude: 66.66,\n longitude: 33.33,\n quality: 1,\n numberSatellites: 10,\n hdop: 2.5,\n altitude: 180.00,\n geoidalSeparation: 90.00,\n differentialAge: 5,\n differentialStationId: 'differentialStationId',\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":620,"wires":[["395ad916396d2633"]]},{"id":"0e3c3f77a0bc9553","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":620,"wires":[["9cb944ace7f6806e"]]},{"id":"78e689b321ae3f8f","type":"comment","z":"95fe791a9c2e02fb","name":"","info":"// see also https://github.com/node-ntrip/nmea#readme\n// put your payload into msg.payload.message see output of decoder node","x":740,"y":500,"wires":[]},{"id":"9fb5ecd91eba0f94","type":"function","z":"95fe791a9c2e02fb","name":"GNGNS","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gns.ts\nmsg.payload = {\n messageType : 'GNS',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n latitude: 66.66,\n longitude: 33.33,\n modeIndicators: ['R'],\n numberSatellites: 1,\n hdop: 0,\n altitude: 123,\n geoidalSeparation: 0,\n differentialAge: 0,\n differentialStationId: 'differentialStationId',\n navigationStatus: 'S',\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":700,"wires":[["395ad916396d2633"]]},{"id":"b4c368a6ec3fd9b0","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":700,"wires":[["9fb5ecd91eba0f94"]]},{"id":"346c9bfb24eca4bf","type":"function","z":"95fe791a9c2e02fb","name":"GNGRS","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/grs.ts\nmsg.payload = {\n messageType : 'GRS',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n residualsMode: 0,\n residuals: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n systemId: 1,\n signalId: 1,\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":740,"wires":[["395ad916396d2633"]]},{"id":"a42bcfe61f797be3","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":740,"wires":[["346c9bfb24eca4bf"]]},{"id":"24fc3108ef208f3b","type":"function","z":"95fe791a9c2e02fb","name":"GNGSA","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gsa.ts\nmsg.payload = {\n messageType : 'GSA',\n nmeaMessage : {\n talker: 'GN',\n operationMode: 'A',\n navMode: 3,\n satellites: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n pdop: 0,\n hdop: 0,\n vdop: 0,\n systemId: 1,\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":780,"wires":[["395ad916396d2633"]]},{"id":"79f77e548a594e86","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":780,"wires":[["24fc3108ef208f3b"]]},{"id":"946e93e6b5d5bd99","type":"function","z":"95fe791a9c2e02fb","name":"GNGST","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gst.ts\nmsg.payload = {\n messageType : 'GST',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n rangeRms: 1,\n standardDeviationMajor: 0,\n standardDeviationMinor: 0,\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":820,"wires":[["395ad916396d2633"]]},{"id":"45b4a35d34900485","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":820,"wires":[["946e93e6b5d5bd99"]]},{"id":"cd0e6bb7b2ebe038","type":"function","z":"95fe791a9c2e02fb","name":"GNGSV","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/gsv.ts\nmsg.payload = {\n messageType : 'GSV',\n nmeaMessage : {\n talker: 'GN',\n sentenceCount: 1,\n sentenceNumber: 1,\n numberSatellites: 1,\n satellites: [{ \n satelliteId: 1,\n elevationDegrees: 1,\n azimuthDegrees: 0,\n signalNoiseRatio: 1,\n }],\n signalId: 1,\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":860,"wires":[["395ad916396d2633"]]},{"id":"95fbbdfc6e3339cf","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":860,"wires":[["cd0e6bb7b2ebe038"]]},{"id":"a8daeb2afa192350","type":"function","z":"95fe791a9c2e02fb","name":"GNRMC","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/rmc.ts\nmsg.payload = {\n messageType : 'RMC',\n nmeaMessage : {\n talker: 'GN',\n time: new Date(0, 0, 0, 1, 2, 3, 0),\n status: 'A',\n latitude: 10,\n longitude: 11,\n speedOverGroundKnots: 0,\n courseOverGroundTrue: 1,\n date: new Date(0, 0, 0),\n magneticVariation: 0,\n modeIndicator: 'R',\n navStatus: 'S',\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":900,"wires":[["395ad916396d2633"]]},{"id":"aabbb873df0609ca","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":900,"wires":[["a8daeb2afa192350"]]},{"id":"54fe198c52d51c3d","type":"function","z":"95fe791a9c2e02fb","name":"GNTHS","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/ths.ts\nmsg.payload = {\n messageType : 'THS',\n nmeaMessage : {\n talker: 'GN',\n headingTrue: 1,\n modeIndicator: 'R'\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":940,"wires":[["395ad916396d2633"]]},{"id":"2227f94cab8861f7","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":940,"wires":[["54fe198c52d51c3d"]]},{"id":"53b59280cfaa354c","type":"function","z":"95fe791a9c2e02fb","name":"GNTXT","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/txt.ts\nmsg.payload = {\n messageType : 'TXT',\n nmeaMessage : {\n talker: 'GN',\n messageCount: 1,\n messageNumber: 1,\n messageType: 1,\n text: 'Bigfoot'\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":980,"wires":[["395ad916396d2633"]]},{"id":"5db9e0dee97ef9e0","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":980,"wires":[["53b59280cfaa354c"]]},{"id":"4aeabe8dfd5e58de","type":"function","z":"95fe791a9c2e02fb","name":"GNVHW","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/vhw.ts\nmsg.payload = {\n messageType : 'VHW',\n nmeaMessage : {\n talker: 'GN',\n headingTrue: 1,\n headingMagnetic: 2,\n speedKnots: 3,\n speedKmh: 4\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1020,"wires":[["395ad916396d2633"]]},{"id":"d835de357bdbb233","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":1020,"wires":[["4aeabe8dfd5e58de"]]},{"id":"95767237d022ba6f","type":"function","z":"95fe791a9c2e02fb","name":"GNVLW","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/vlw.ts\nmsg.payload = {\n messageType : 'VLW',\n nmeaMessage : {\n talker: 'GN',\n totalCumulativeWaterDistance: 1,\n resetWaterDistance: 2,\n totalCumulativeGroundDistance: 3,\n resetGroundDistance: 4\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1060,"wires":[["395ad916396d2633"]]},{"id":"d6f529187402ec50","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":1060,"wires":[["95767237d022ba6f"]]},{"id":"f72f5b6462f257c4","type":"function","z":"95fe791a9c2e02fb","name":"GNVPW","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/vpw.ts\nmsg.payload = {\n messageType : 'VPW',\n nmeaMessage : {\n talker: 'GN',\n speedKnots: 1,\n speedMs: 2\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1100,"wires":[["395ad916396d2633"]]},{"id":"238c581bcb5a2ecf","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":1100,"wires":[["f72f5b6462f257c4"]]},{"id":"80bfe72db5dee054","type":"function","z":"95fe791a9c2e02fb","name":"GNVTG","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/vtg.ts\nmsg.payload = {\n messageType : 'VTG',\n nmeaMessage : {\n talker: 'GN',\n courseOverGroundTrue: 1,\n courseOverGroundMagnetic: 2,\n speedOverGroundKnots: 3,\n speedOverGroundKmh: 4,\n modeIndicator: 'R',\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1140,"wires":[["395ad916396d2633"]]},{"id":"8a811f6ae216f934","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":1140,"wires":[["80bfe72db5dee054"]]},{"id":"0cfc1b0b7af0efa1","type":"function","z":"95fe791a9c2e02fb","name":"GNZDA","func":"// see https://github.com/Node-NTRIP/nmea/blob/master/src/messages/zda.ts\nmsg.payload = {\n messageType : 'ZDA',\n nmeaMessage : {\n talker: 'GN',\n date: new Date(0, 0, 0, 1, 2, 3, 0),\n localTimeZoneHours: 1,\n localTimeZoneMinutes: 2\n }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1180,"wires":[["395ad916396d2633"]]},{"id":"5a48b0e6d7d8d4c0","type":"inject","z":"95fe791a9c2e02fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":1180,"wires":[["0cfc1b0b7af0efa1"]]}]
|
package/ntrip/99-ntrip.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<script type="text/javascript">
|
|
6
6
|
RED.nodes.registerType('NtripClient', {
|
|
7
|
-
category: '
|
|
7
|
+
category: 'GNSS',
|
|
8
8
|
color: '#C0DEED',
|
|
9
9
|
defaults: {
|
|
10
10
|
description: { value:"" },
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
|
|
160
160
|
<script type="text/javascript">
|
|
161
161
|
RED.nodes.registerType('RtcmDecoder', {
|
|
162
|
-
category: '
|
|
162
|
+
category: 'GNSS',
|
|
163
163
|
color: '#C0DEED',
|
|
164
164
|
defaults: {
|
|
165
165
|
description: { value:"" },
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
|
|
205
205
|
<script type="text/javascript">
|
|
206
206
|
RED.nodes.registerType('NmeaDecoder', {
|
|
207
|
-
category: '
|
|
207
|
+
category: 'GNSS',
|
|
208
208
|
color: '#C0DEED',
|
|
209
209
|
defaults: {
|
|
210
210
|
description: { value:"" },
|
|
@@ -244,3 +244,48 @@
|
|
|
244
244
|
<p>.</p>
|
|
245
245
|
<p><code>msg.payload</code></p>
|
|
246
246
|
</script>
|
|
247
|
+
|
|
248
|
+
<!-- ------------------------------------------------------------------------------------------ -->
|
|
249
|
+
|
|
250
|
+
<script type="text/javascript">
|
|
251
|
+
RED.nodes.registerType('NmeaEncoder', {
|
|
252
|
+
category: 'GNSS',
|
|
253
|
+
color: '#C0DEED',
|
|
254
|
+
defaults: {
|
|
255
|
+
description: { value:"" },
|
|
256
|
+
},
|
|
257
|
+
inputs: 1,
|
|
258
|
+
outputs: 2,
|
|
259
|
+
icon: "function.png",
|
|
260
|
+
paletteLabel: "NMEA Encoder",
|
|
261
|
+
label: function () {
|
|
262
|
+
return this.description || "NMEA Encoder";
|
|
263
|
+
},
|
|
264
|
+
labelStyle: function() {
|
|
265
|
+
return this.description?"node_label_italic":"";
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
</script>
|
|
270
|
+
|
|
271
|
+
<script type="text/x-red" data-template-name="NmeaEncoder">
|
|
272
|
+
<div class="form-row">
|
|
273
|
+
<label for="node-input-description"><i class="fa fa-comment"></i> Description</label>
|
|
274
|
+
<input type="text" id="node-input-description" placeholder="The description of the node (optional)">
|
|
275
|
+
</div>
|
|
276
|
+
</script>
|
|
277
|
+
|
|
278
|
+
<script type="text/x-red" data-help-name="NmeaEncoder">
|
|
279
|
+
<p>A node that encodes NMEA messages.</p>
|
|
280
|
+
|
|
281
|
+
<h3>Configuration</h3>
|
|
282
|
+
|
|
283
|
+
<p>Description of the device.</p>
|
|
284
|
+
|
|
285
|
+
<h3>Inputs</h3>
|
|
286
|
+
<p>.</p>
|
|
287
|
+
|
|
288
|
+
<h3>Outputs</h3>
|
|
289
|
+
<p>.</p>
|
|
290
|
+
<p><code>msg.payload</code></p>
|
|
291
|
+
</script>
|
package/ntrip/99-ntrip.js
CHANGED
|
@@ -21,4 +21,7 @@ module.exports = function (RED) {
|
|
|
21
21
|
|
|
22
22
|
const NmeaDecoderNode = require('./nodes/nmea-decoder-node.js')(RED);
|
|
23
23
|
RED.nodes.registerType("NmeaDecoder", NmeaDecoderNode);
|
|
24
|
+
|
|
25
|
+
const NmeaEncoderNode = require('./nodes/nmea-encoder-node.js')(RED);
|
|
26
|
+
RED.nodes.registerType("NmeaEncoder", NmeaEncoderNode);
|
|
24
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = function (RED) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const { NmeaTransport
|
|
4
|
+
const { NmeaTransport } = require('@gnss/nmea');
|
|
5
5
|
|
|
6
6
|
function NmeaDecoderNode(config) {
|
|
7
7
|
RED.nodes.createNode(this, config);
|
|
@@ -11,20 +11,20 @@ module.exports = function (RED) {
|
|
|
11
11
|
|
|
12
12
|
this.on('input', function (msg) {
|
|
13
13
|
|
|
14
|
-
let buffer = msg.payload;
|
|
14
|
+
let buffer = msg.payload.nmeaMessage ?? msg.payload;
|
|
15
15
|
if(Buffer.isBuffer(buffer)){
|
|
16
|
-
buffer = buffer.toString();
|
|
16
|
+
buffer = buffer.toString('utf8');
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
try
|
|
20
|
-
{
|
|
21
|
-
let
|
|
22
|
-
let messageType =
|
|
20
|
+
{
|
|
21
|
+
let nmeaMessage = NmeaTransport.decode(buffer);
|
|
22
|
+
let messageType = nmeaMessage.constructor.name.replace('NmeaMessage', '').toUpperCase();
|
|
23
23
|
|
|
24
24
|
let msg = {
|
|
25
25
|
payload : {
|
|
26
26
|
messageType : messageType,
|
|
27
|
-
|
|
27
|
+
nmeaMessage : nmeaMessage,
|
|
28
28
|
input : buffer
|
|
29
29
|
},
|
|
30
30
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
module.exports = function (RED) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
NmeaTransport,
|
|
6
|
+
NmeaMessageUnknown,
|
|
7
|
+
NmeaMessage,
|
|
8
|
+
NmeaMessageDtm,
|
|
9
|
+
NmeaMessageGbs,
|
|
10
|
+
NmeaMessageGga,
|
|
11
|
+
NmeaMessageGll,
|
|
12
|
+
NmeaMessageGns,
|
|
13
|
+
NmeaMessageGrs,
|
|
14
|
+
NmeaMessageGsa,
|
|
15
|
+
NmeaMessageGst,
|
|
16
|
+
NmeaMessageGsv,
|
|
17
|
+
NmeaMessageRmc,
|
|
18
|
+
NmeaMessageThs,
|
|
19
|
+
NmeaMessageTxt,
|
|
20
|
+
NmeaMessageVhw,
|
|
21
|
+
NmeaMessageVlw,
|
|
22
|
+
NmeaMessageVpw,
|
|
23
|
+
NmeaMessageVtg,
|
|
24
|
+
NmeaMessageZda,
|
|
25
|
+
} = require('@gnss/nmea');
|
|
26
|
+
|
|
27
|
+
function NmeaEncoderNode(config) {
|
|
28
|
+
RED.nodes.createNode(this, config);
|
|
29
|
+
let node = this;
|
|
30
|
+
node.nmeaMessagesReceived = 0;
|
|
31
|
+
node.invalidMessagesReceived = 0;
|
|
32
|
+
|
|
33
|
+
this.on('input', function (msg) {
|
|
34
|
+
|
|
35
|
+
let input = msg.payload.nmeaMessage;
|
|
36
|
+
let isNmeaMessage = input.prototype instanceof NmeaMessage;
|
|
37
|
+
let messageType = msg.payload.messageType;
|
|
38
|
+
messageType = messageType.toUpperCase();
|
|
39
|
+
|
|
40
|
+
try
|
|
41
|
+
{
|
|
42
|
+
let message;
|
|
43
|
+
let nmeaMessage;
|
|
44
|
+
if(isNmeaMessage){
|
|
45
|
+
nmeaMessage = input; // is already a NmeaMessage
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
|
|
49
|
+
switch (messageType) {
|
|
50
|
+
case 'Object':
|
|
51
|
+
nmeaMessage = NmeaMessageUnknown.construct(input);
|
|
52
|
+
break;
|
|
53
|
+
case 'DTM':
|
|
54
|
+
nmeaMessage = NmeaMessageDtm.construct(input);
|
|
55
|
+
break;
|
|
56
|
+
case 'GBS':
|
|
57
|
+
nmeaMessage = NmeaMessageGbs.construct(input);
|
|
58
|
+
break;
|
|
59
|
+
case 'GGA':
|
|
60
|
+
nmeaMessage = NmeaMessageGga.construct(input);
|
|
61
|
+
break;
|
|
62
|
+
case 'GLL':
|
|
63
|
+
nmeaMessage = NmeaMessageGll.construct(input);
|
|
64
|
+
break;
|
|
65
|
+
case 'GNS':
|
|
66
|
+
nmeaMessage = NmeaMessageGns.construct(input);
|
|
67
|
+
break;
|
|
68
|
+
case 'GRS':
|
|
69
|
+
nmeaMessage = NmeaMessageGrs.construct(input);
|
|
70
|
+
break;
|
|
71
|
+
case 'GSA':
|
|
72
|
+
nmeaMessage = NmeaMessageGsa.construct(input);
|
|
73
|
+
break;
|
|
74
|
+
case 'GST':
|
|
75
|
+
nmeaMessage = NmeaMessageGst.construct(input);
|
|
76
|
+
break;
|
|
77
|
+
case 'GSV':
|
|
78
|
+
nmeaMessage = NmeaMessageGsv.construct(input);
|
|
79
|
+
break;
|
|
80
|
+
case 'RMC':
|
|
81
|
+
nmeaMessage = NmeaMessageRmc.construct(input);
|
|
82
|
+
break;
|
|
83
|
+
case 'THS':
|
|
84
|
+
nmeaMessage = NmeaMessageThs.construct(input);
|
|
85
|
+
break;
|
|
86
|
+
case 'TXT':
|
|
87
|
+
nmeaMessage = NmeaMessageTxt.construct(input);
|
|
88
|
+
break;
|
|
89
|
+
case 'VHW':
|
|
90
|
+
nmeaMessage = NmeaMessageVhw.construct(input);
|
|
91
|
+
break;
|
|
92
|
+
case 'VLW':
|
|
93
|
+
nmeaMessage = NmeaMessageVlw.construct(input);
|
|
94
|
+
break;
|
|
95
|
+
case 'VPW':
|
|
96
|
+
nmeaMessage = NmeaMessageVpw.construct(input);
|
|
97
|
+
break;
|
|
98
|
+
case 'VTG':
|
|
99
|
+
nmeaMessage = NmeaMessageVtg.construct(input);
|
|
100
|
+
break;
|
|
101
|
+
case 'ZDA':
|
|
102
|
+
nmeaMessage = NmeaMessageZda.construct(input);
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
// message could not be converted.
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (nmeaMessage !== undefined) {
|
|
111
|
+
message = NmeaTransport.encode(nmeaMessage);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let msg = {
|
|
115
|
+
payload : {
|
|
116
|
+
nmeaMessage : message,
|
|
117
|
+
input : input
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
node.send([msg, null]);
|
|
122
|
+
node.nmeaMessagesReceived++;
|
|
123
|
+
}
|
|
124
|
+
catch(ex)
|
|
125
|
+
{
|
|
126
|
+
let msg = {
|
|
127
|
+
payload : {
|
|
128
|
+
error : ex,
|
|
129
|
+
input : input,
|
|
130
|
+
inputString : input.toString()
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
node.send([null, msg]);
|
|
134
|
+
node.invalidMessagesReceived++;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
node.status({
|
|
138
|
+
fill: 'green',
|
|
139
|
+
shape: 'ring',
|
|
140
|
+
text: 'NMEA: ' + node.nmeaMessagesReceived + ' Invalid: ' + node.invalidMessagesReceived,
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
this.on('close', function(done) {
|
|
145
|
+
node.status({});
|
|
146
|
+
done();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return NmeaEncoderNode;
|
|
151
|
+
};
|