Open SayBello opened 3 months ago
Hello,
i tryed your code and endet up in reset loop. After a while i found a solution for me. By moving the mqttConnect() function in the firmware setup
` PubSubClient client(espClient);
`
void setup() { .... ..... //mqttConnect(); / / client.setServer( MQTT_SERVER, //Server MQTT_PORT //Port ); client.connect( "heater", MQTT_USER, //Username MQTT_PASSWORD, //Username "heater/status", //Will Topic 2, //Will QoS 1, //Will retain "Offline" //Will message );
client.publish("heater/status", "Online", true); //Report as online subscribe(); client.setCallback(callback);
....... ....... ` it works for me,
Deutsch geht auch ;-)
change in mqtt
bool mqttConnect()
to
void mqttConnect()
does the trick
Hello,
i tryed your code and endet up in reset loop. After a while i found a solution for me. By moving the mqttConnect() function in the firmware setup
` PubSubClient client(espClient);
`
void setup() { .... .....
//mqttConnect(); / / client.setServer( MQTT_SERVER, //Server MQTT_PORT //Port ); client.connect( "heater", MQTT_USER, //Username MQTT_PASSWORD, //Username "heater/status", //Will Topic 2, //Will QoS 1, //Will retain "Offline" //Will message );
client.publish("heater/status", "Online", true); //Report as online subscribe(); client.setCallback(callback);
....... ....... ` it works for me,
Deutsch geht auch ;-)