UDP MQTT to Openplotter with ESP32 - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2) +--- Thread: UDP MQTT to Openplotter with ESP32 (/showthread.php?tid=3077) |
RE: UDP MQTT to Openplotter with ESP32 - PaddyB - 2020-11-10 (2020-11-10, 11:50 AM)Peter— Wrote: But I guess it’s a format where I have to state e.g that it’s a temp value and it’s measure in degC, or a wind value in this case, measured in knts. Signalk works in SI units, so temperature is Deg Kelvin, speed is in M/S, direction is in radians etc. No need for node red, send a JSON formatted string to signalk and that's it . Like this > { "updates": [ { "source": { "type": "NMEA0183", "sentence": "GLL", "label": "OPkplex", "talker": "GP" }, "timestamp": "2017-07-26T12:21:15.000Z", "values": [ { "path": "navigation.position", "value": { "longitude": -7.846666666666667, "latitude": 36.9987 } } ] } ] } RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-10 (2020-11-10, 01:34 PM)PaddyB Wrote:(2020-11-10, 11:50 AM)Peter— Wrote: But I guess it’s a format where I have to state e.g that it’s a temp value and it’s measure in degC, or a wind value in this case, measured in knts. So would this work? { “Vessel”: { “Outside”: { “Temperature”: 300 } } } RE: UDP MQTT to Openplotter with ESP32 - PaddyB - 2020-11-10 (2020-11-10, 02:13 PM)Peter— Wrote: So would this work? Afraid not, try it for yourself , in the data fiddler > RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-10 (2020-11-10, 06:10 PM)PaddyB Wrote:(2020-11-10, 02:13 PM)Peter— Wrote: So would this work? That is a great tool, thanks PaddyB. I'm on a slack channel learning about it, and I'll update you guys when I know more. Currently this is what I expect to be the format: Code: { RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-10 Ok I'm stuck. Here is my code: Code: #include "WiFi.h" On my PI, I can use netcat on the 3333 port and see the JSON-DELTA UDP sentence, so I know it transmitting and recieving. If I copy the netcat output into the SignalK datafiddler it is valid, so I know the format is correct. I have added the connection in SignalK as a Signalk connection on port 3333 with "no self mapping" and logging disabled. When I look in the SignalK diagnose tool there is no temperature readings. What am I missing? Kind Regards, Peter RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-11 Ok so it seems I got it working by putting by it all into one udp.print command - at least the WiFi icon on my data connection in SignalK is showing that it is receiving information by flashing. However, the data is not showing in my diagnose tool nor on my instrument panels. I have checked the format in the fiddler and it seems correct. Any ideas how to get it up on the instruments? Update: The serve log states: "Cannot read property 'length' of undefined " RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-11 Hi all I got it working. I'll make a guide within the next week explaining this in more detail. Here is my final code: Code: #include "WiFi.h" Many thanks for the help guys Peter RE: UDP MQTT to Openplotter with ESP32 - PaddyB - 2020-11-11 Great, well done! RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-11 (2020-11-11, 08:32 PM)PaddyB Wrote: Great, well done! Thanks PaddyB I did the same for apparent wind speed (which is actually what I want) and it worked perfectly as well. However, I wasn’t able to get it into the dashboard in OpenCPN. Any ideas how to do that? Br, Peter RE: UDP MQTT to Openplotter with ESP32 - Peter— - 2020-11-11 Looks like it must be nmea code for OpenCPN, but someone wrote that OpenCPN should soon be able to receive SignalK so I’m not going to waste my time on this before I have my system ready and hopefully by spring OpenCPN will include it. Br, Peter |