2018-09-29, 05:22 PM
(2018-09-29, 03:15 PM)awwbaker@yahoo.com Wrote: I have a sensor collecting humidity data and using the following to send to MQTT.
pubString = String(dht.getHumidity()/100);
memset(msg, 0, sizeof(msg));
pubString.toCharArray(msg, pubString.length()+1);
client.publish("SensorHumidity",msg);
I am trying to display the humidity data in Wilhelm but it is being recognized, correctly as a string in Wilhelm rather than a float. How do I send the data so it ends up as being float in SignalK and hence Wilhelm as well? I have data getting on to Wilhelm, I suspect I am just not doing it the right way. I am NOT familiar with a whole JSON structure but do I need to go to that extent to accomplish what I am trying? A shove in right direction would be appreciated. Signed Newbie, but learning
What are you using to send the data? If it's an esp then this library might help , I stole some of it and send signalk direct so no problems with the data. Had the same issues with mqtt sending the data as a string.
https://github.com/mxtommy/EspSigK