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.

  • 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
(02-14-2019, 08:13 AM)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
(02-14-2019, 08:35 AM)PaddyB Wrote:
(02-14-2019, 08:13 AM)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
(03-18-2019, 06: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
(03-19-2019, 06:26 AM)PaddyB Wrote:
(03-18-2019, 06: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


Forum Jump:


Users browsing this thread: 1 Guest(s)