Hi
I'm New to Node-Red, but have spent several days on youtube and google trying to figure this out. I would appreciate if you could help me over this bump in the road.
What I'm trying to do, is to get information out of SignalK JSON delta messages imported through websocket, and display it on the Node-Red Dashboard.
I'm New to JavaScript, and I'm pretty sure this is where my problem is:
if (msg.updates[0].source.pgn === "129025") {
msg.payload = msg.updates[0].values[0].value.longitude;
return [msg, null];
}
if (msg.updates[0].source.pgn === "129025") {
msg.payload = msg.updates[0].values[1].value.latitude;
return [null, msg];
}
The websocket spams Node-Red With several JSON messages every second, and most of them are formatted the same way, I therefore need to check the PGN number of a Message to make sure it is the Message With the right data before extracting the sensor Readings.
For some reason my JavaScript doesn't work. Where the numbers should be on the Dashboard it's just blank. Debug gives me this:
19.02.2019 05.03.20node: navigation.positionfunction : (error)
"TypeError: Cannot read property '0' of undefined"
Please help