Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By helpme
#38740 I am using MQTT publish function in SMING. This is the function prototype.
Code: Select allbool MqttClient::publish(String topic, String message, bool retained /* = false*/);


My problem is that the message is in String type. However, the message that I want to publish is in binary. How can I use SMING MQTT to publish binary data?
User avatar
By voyo
#42601 MQTT messages *should* be data-agnostic, question is how it is implemented in mqtt library, if its fully supported (I dont know this).

Quick googling gave me this hint -

client = mqtt.createClient({encoding: 'binary'});

feel free to try and let all us know ;)
But if this not work for you, I would try encode message with ie. base64