arduino - Subscribe in the Nodemcu -


i able publish topic in nodemcu , mqtt dashboard (app android), see:

#include <pubsubclient.h> const char* mqtt_broker = "iot.eclipse.org"; const char* mqtt_clientid = "tccguilf"; pubsubclient client(nodemcuclient); const char* topicotemperatura = "tccguilf/temperatura"; const char* topicoumidade = "tccguilf/umidade"; ... client.publish(topicotemperatura, string(temperatura).c_str(), true); ... 

now, subscribe topic in nodemcu, published mqttdashboard. perhaps:

teste = client.subscribe(topicoteste); 

so not work, i've tried callback functions found on web, no success far.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -