OpenMarine

Full Version: Sensor -> MQTT -> OpenPlotter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Now I have some time to play around. I have a small wifi device ESP8266 with several sensors, like DHT22, IR-Temp, pressure, etc. I currently use them at home. The device is sending data to a MQTT broker, locally or to iot.eclipse.org. I managed to send the messages to the built in MQTT broker at OpenPlotter.
I can see them beeing broadcasted with mosquitto_sub ... .

How can I map the incoming data to SignalK?
There is no trigger "MQTT". There are only flat topics. No "/" possible. Which seems to be out of this world.

May be I've got something wrong. There has been a comparable thread, but was abandoned.
Does anyone have any ideas?

Thanks.
(2019-02-14, 01:13 PM)skipper@sy-barranas Wrote: [ -> ]Does anyone have any ideas?

Thanks.


You could send the data as signalk...

Code:
void sendSigK(String sigKey, float data) {    //    send SigK via UDP *****************************************

 if (sendSig_Flag == 1) {
   DynamicJsonBuffer jsonBuffer;
   String deltaText;

   //  build delta message
   JsonObject& delta = jsonBuffer.createObject();

   //updated array
   JsonArray& updatesArr = delta.createNestedArray("updates");
   JsonObject& thisUpdate = updatesArr.createNestedObject();   //Json Object nested inside delta [...
   JsonArray& values = thisUpdate.createNestedArray("values"); // Values array nested in delta[ values....
   JsonObject& thisValue = values.createNestedObject();
   thisValue["path"] = sigKey;
   thisValue["value"] = data;

   thisUpdate["Source"] = "ESP32";

   // Send UDP packet
   Udp.beginPacket(remoteIp, remotePort);
   delta.printTo(Udp);
   Udp.println();
   Udp.endPacket();
 }
}
Thank you PaddyB. I finally made it with WiFiUDP instead of EthernetUDP and the right ip-address ;-) 10.10.10.1 is the magic solution = OpenPlotter accesspoint.
(2019-02-14, 01:35 PM)PaddyB Wrote: [ -> ]
(2019-02-14, 01:13 PM)skipper@sy-barranas Wrote: [ -> ]Does anyone have any ideas?

Thanks.


You could send the data as signalk...

Code:
void sendSigK(String sigKey, float data) {    //    send SigK via UDP *****************************************

 if (sendSig_Flag == 1) {
   DynamicJsonBuffer jsonBuffer;
   String deltaText;

   //  build delta message
   JsonObject& delta = jsonBuffer.createObject();

   //updated array
   JsonArray& updatesArr = delta.createNestedArray("updates");
   JsonObject& thisUpdate = updatesArr.createNestedObject();   //Json Object nested inside delta [...
   JsonArray& values = thisUpdate.createNestedArray("values"); // Values array nested in delta[ values....
   JsonObject& thisValue = values.createNestedObject();
   thisValue["path"] = sigKey;
   thisValue["value"] = data;

   thisUpdate["Source"] = "ESP32";

   // Send UDP packet
   Udp.beginPacket(remoteIp, remotePort);
   delta.printTo(Udp);
   Udp.println();
   Udp.endPacket();
 }
}

I might be the most stupid person on earth right now, but, where do you put in this code? Huh I'm using espeasy and nodemcu but can't find the right place to put it.
I can not find any info about how to actually do it so it would be nice if you could put me in the right direction.
Sorry for the question, but I'm lost...
//Patrik
(2019-03-18, 11:52 PM)Pkarl45 Wrote: [ -> ]I might be the most stupid person on earth right now, but, where do you put in this code? Huh I'm using espeasy and nodemcu but can't find the right place to put it.
I can not find any info about how to actually do it so it would be nice if you could put me in the right direction.
Sorry for the question, but I'm lost...
//Patrik

That code snippit is for programming the esp directly using the arduino IDE, won't work in espeasy.
Instructions how to configure ESP8266 + ds18b20 using Arduino IDE here below.
I moved from EasyESP to https://github.com/mxtommy/SigkSens
Instructions: https://github.com/JeroenAdam/IoT-aboard...figuration
(2019-03-19, 11:26 AM)PaddyB Wrote: [ -> ]
(2019-03-18, 11:52 PM)Pkarl45 Wrote: [ -> ]I might be the most stupid person on earth right now, but, where do you put in this code? Huh I'm using espeasy and nodemcu but can't find the right place to put it.
I can not find any info about how to actually do it so it would be nice if you could put me in the right direction.
Sorry for the question, but I'm lost...
//Patrik

That code snippit is for programming the esp directly using the arduino IDE, won't work in espeasy.

thank you!
(2019-02-14, 01:13 PM)skipper@sy-barranas Wrote: [ -> ]Now I have some time to play around. I have a small wifi device ESP8266 with several sensors, like DHT22, IR-Temp, pressure, etc. I currently use them at home. The device is sending data to a MQTT broker, locally or to iot.eclipse.org. I managed to send the messages to the built in MQTT broker at OpenPlotter.
I can see them beeing broadcasted with mosquitto_sub ... .

How can I map the incoming data to SignalK?
There is no trigger "MQTT". There are only flat topics. No "/" possible. Which seems to be out of this world.

May be I've got something wrong. There has been a comparable thread, but was abandoned.
Does anyone have any ideas?

Thanks.

How to send data from ESP8266 to built-in mqtt broker of open plotter..i couldnt find any mqtt tab in open plotter
(2020-08-25, 04:48 PM)Melvin Wrote: [ -> ]How to send data from ESP8266 to built-in mqtt broker of open plotter..i couldnt find any mqtt tab in open plotter

See message 2 in this thread, easier to send data as signalk data.
(2020-08-25, 05:14 PM)PaddyB Wrote: [ -> ]
(2020-08-25, 04:48 PM)Melvin Wrote: [ -> ]How to send data from ESP8266 to built-in mqtt broker of open plotter..i couldnt find any mqtt tab in open plotter

See message 2 in this thread, easier to send data as signalk data.

From one Rpi to another Rpi , can we send data as signalk data
Pages: 1 2