Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Update :
If I doclient.publish("/devices/data", data_json.c_str());, it gets compiled, but data doesn't appear in mqtt.
client.publish("/devices/data", data_json.c_str());
Serial.print(data_json.length()); prints 236
Serial.print(data_json.length());
If I just do client.publish("/devices/data", "data_json");, works as well.
client.publish("/devices/data", "data_json");
Also tried client.publish("/devices/data", data_json.c_str());, no luckit gets compiled, but data doesn't appear in mqtt.
Also tried client.publish("/devices/data", data_json.c_str());, no luck.
AlsoIf I i just do client.publish("/devices/data", "data_json");, works as well. Is
Is my json to string conversion correct ?
Also I i just do client.publish("/devices/data", "data_json");, works as well. Is my json to string conversion correct ?