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:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UDP MQTT to Openplotter with ESP32
#2
(2020-11-09, 03:57 PM)Peter— Wrote:  Any ideas ?

I have similar sending various sensor data, but sending it as signalk.  Now on micropython but before used this on the arduino ide >>

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

 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();
   delta.printTo(Serial);
   Serial.println();
 }


Micropython here if you want a look (or a play) 
https://github.com/boatybits/boatymonpy
Still a work in progress but what there is works Smile
Reply


Messages In This Thread
UDP MQTT to Openplotter with ESP32 - by Peter— - 2020-11-09, 03:57 PM
RE: UDP MQTT to Openplotter with ESP32 - by PaddyB - 2020-11-09, 04:15 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)