This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sensor -> MQTT -> OpenPlotter
#1
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.
Reply
#2
(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();
 }
}
Reply
#3
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.
Reply
#4
(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
Reply
#5
(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.
Reply
#6
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
Reply
#7
(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!
Reply
#8
(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
Reply
#9
(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.
Reply
#10
(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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)