Closed baqwas closed 4 years ago
Sorry for logging this. Problem solved with stringify and strcpy. Thanks.
Kind regards.
@baqwas
JSONVar _message_;
_message_["status"] = 1;
String payload = JSON.stringify(_message_);
client.publish(topic, payload.c_str());
Hello,
This is a newbie request for guidance. When I use the following code:
The broker displays message as an empty string. Bottom line, is there some function/method to transform a JSON object to a string before use downstream. (Defeats the purpose of JSON, I know, but the use is external to board's sketch). Thanks.
Kind regards.