OpenMarine
same object gives different output ? - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: Node Red (https://forum.openmarine.net/forumdisplay.php?fid=15)
+--- Thread: same object gives different output ? (/showthread.php?tid=605)



same object gives different output ? - JD1 - 2017-06-30

I am puzzled and have not managed to figure out why this is:

I have a web socket

[{"id":"2027b6ec.669a3a","type":"websocket in","z":"c504ca30.ff7d08","name":"","server":"5884b7b4.0464d8","client":"","x":175,"y":28,"wires":[["2f03a1ca.9cf7de","b143f8ab.382258","c99866e.b8a3f98"]]},{"id":"5884b7b4.0464d8","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"}]

it produces this output:

2017-06-30, 11:18:56 AMnode: c99866e.b8a3f98msg.payload : string[375]
"{"context":"vessels.urn:mrn:imo:mmsi:31602354","updates":[{"source":{"label":"OPkplex"},"timestamp":"2017-06-30T18:18:56.513Z","values":[{"path":"navigation.position","value":{"source":{"type":"NMEA0183","sentence":"GGA","label":"signalk-parser-nmea0183","talker":"GP"},"timestamp":"2017-06-30T18:18:00.000Z","longitude":-123.41748333333334,"latitude":48.67388833333333}}]}]}"

a duplicate websocket node produces this output:

2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : string[6]
"48.674"
2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : Object
{ navigation.gnss: object }
2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : Object
{ environment.inside.temperature: 293.53 }
2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : string[6]
"48.674"
2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : Object
{ navigation.courseOverGroundTrue: 3.8018507096192478, navigation.speedOverGround: 0.23664450439438559, navigation.magneticVariation: 0 }
2017-06-30, 11:21:41 AMnode: 37d776e.006768amsg.payload : Object
{ environment.depth.belowTransducer: 4.5 }


Now I am pretty sure I screwed something up somewhere but for the life of me I can't figure it out ..... both web sockets are identical, one was copy/pasted from the other, yet the debug output of the two are completely different.

Can anybody help me explain why the same nodes produce completely different outputs ?


RE: same object gives different output ? - benjamingotke - 2017-06-30

I'm using the SenseHat on my Raspberry pi. Got to the OpenPlotter and selected the sensors and got them to send to signalK. In diagnostics its looks fine, but when I use node-red to get it to my dashboard the temperature is 311 degrees, humidity is correct, but pressure is about 102185.85474(end-of-the-world kind of pressure).
It might be the same problem. I have not yet solved it..


RE: same object gives different output ? - JD1 - 2017-06-30

(2017-06-30, 09:46 PM)benjamingotke Wrote: I'm using the SenseHat on my Raspberry pi. Got to the OpenPlotter and selected the sensors and got them to send to signalK. In diagnostics its looks fine, but when I use node-red to get it to my dashboard the temperature is 311 degrees, humidity is correct, but pressure is about 102185.85474(end-of-the-world kind of pressure).
It might be the same problem. I have not yet solved it..

Different issue. In your case you need to adjust your units. Temperature is output in degrees K and you probably want to see degrees C .... C = k - 272    (that is not the exact value, verify and use the correct number)
Pressure is reported in Pascals, mbar would be Pascal/100


RE: same object gives different output ? - JD1 - 2017-06-30

Let me ask my question slightly different:

In the sample node red flow that is included in the installation of OpenPlotter, there is a node
ws://localhost:3000/signalk/v1/stream

If I put a half dozen additional ws://localhost:3000/signalk/v1/stream nodes onto the screen (copy and paste) and connected each one to a debug message, should I not see the exact same debug output from each and every ws://localhost:3000/signalk/v1/stream node ?

If I put additional ws://localhost:3000/signalk/v1/stream nodes onto additional flows, should I not see the same output being generated from each and every copy and pasted node even though the nodes are in different flows ?


RE: same object gives different output ? - JD1 - 2017-07-01

I have no idea what happened but all my various test nodes have now reverted to the same output (not by themselves but with me deleting the old node and inserting a new node). I am now unable to recreate the 'bad' output.
I do not think that I fundamentally changed anything but I must have. I did a lot of futzing around so who knows.
I was close to saying that the first websocket created produced the good output and subsequent web sockets, be they cloned from the first or generated new, would generate bad output. I even had a bunch of web sockets create completely empty output without changing anything (one would generate good output, half a dozen additional identical web sockets would produce bad output and additional identical web sockets would produce no output).
Ahhh the mysterious world of computers <shrug>


RE: same object gives different output ? - JD1 - 2017-07-04

I have upgraded to OpenPlotter 0.12.0 but am still having the same issue.
on one flow, I have two web sockets with their output going to a debug node.
Both web sockets were generated by dragging a web socket onto the flow and hitting 'done' on the details (ie: everything is default)
Both web sockets are /ws://localhost:3000/signalk/v1/stream?

Debug output on web socket one is :
msg.payload : Object
{ navigation.position: object }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ navigation.gnss: object }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ navigation.position: object }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ navigation.position: object }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ navigation.courseOverGroundTrue: 1.1344640137963142, navigation.speedOverGround: 0, navigation.magneticVariation: 0.2792526803190927 }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ navigation.courseOverGroundMagnetic: 0.8552113334772214, navigation.courseOverGroundTrue: 1.1344640137963142, navigation.speedOverGround: 0 }
2017-07-04, 12:37:22 PMnode: c99866e.b8a3f98msg.payload : Object
{ environment.wind.speedApparent: 3.395334193484662, environment.wind.angleApparent: 0.2617993877991494 }


Debug output on web socket two is:
msg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }
2017-07-04, 12:36:08 PMnode: 6152c793.dab9amsg.payload : Object
{ empty }

Debug output that is from another identical web socket on a different flow and what I would expect from both of these other nodes:
2017-07-04, 12:39:42 PMnode: 6b170cfc.6d26f4msg.payload : string[374]
"{"context":"vessels.urn:mrn:imo:mmsi:31602354","updates":[{"source":{"type":"NMEA0183","sentence":"RMC","label":"OPkplex","talker":"GP"},"timestamp":"2017-08-04T19:39:41.000Z","values":[{"path":"navigation.courseOverGroundTrue","value":1.1344640137963142},{"path":"navigation.speedOverGround","value":0},{"path":"navigation.magneticVariation","value":0.2792526803190927}]}]}"
2017-07-04, 12:39:42 PMnode: 6b170cfc.6d26f4msg.payload : string[381]
"{"context":"vessels.urn:mrn:imo:mmsi:31602354","updates":[{"source":{"type":"NMEA0183","sentence":"VTG","label":"OPkplex","talker":"GP"},"timestamp":"2017-07-04T19:39:42.000Z","values":[{"path":"navigation.courseOverGroundMagnetic","value":0.8552113334772214},{"path":"navigation.courseOverGroundTrue","value":1.1344640137963142},{"path":"navigation.speedOverGround","value":0}]}]}"
2017-07-04, 12:39:42 PMnode: 6b170cfc.6d26f4msg.payload : string[328]
"{"updates":[{"source":{"type":"NMEA0183","sentence":"MWV","label":"OPkplex","talker":"EC"},"timestamp":"2017-07-04T19:39:42.000Z","values":[{"path":"environment.wind.speedApparent","value":3.6011120233928238},{"path":"environment.wind.angleApparent","value":0.12217304763960307}]}],"context":"vessels.urn:mrn:imo:mmsi:31602354"}"

Deleting the node that provides the good output and re-creating it changed no outputs of the other nodes
Deleting the node that provided bad output data and re-creating it still provided bad data but now the node that was providing 'empty' output provides the same output as the bad data node (this was without any user change on that node!)

There is definitively something funky going on and I have no clue what it could be!

BTW, previously, when I deleted the websocket node that had good output and recreated it, it would flip all other web socket nodes to proper output!