New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to ReInit/ReStart HAMqtt service via Web Interface ESP8266 Reboots #244
Comments
Some additional info. In HAMqtt.cpp
In PubSubClient.cpp
In Client.h
I only asume, that Client.h somehow points to WiFiClient.cpp In WiFiClient.cpp
|
Problem Solved! I've made a bad, untested/unverified assumption based from the Arduinos Examples, namely: From this as the basis:
I made these Foo()-s:
And every time, when I reenabled the MQTT via startMQTT(), then I've also "reinitialized" it's device and switches... Or so I thought. Note to noobs like me: |
Win7x64 Arduino 1.8.19
HA-intergration 2.1.0
ESP8266-Olimex-Dev 2MB
I've made a WebInterface for the ESP8266, includeing the MQTT.
On startup everything is fine, but when I try to restart the Service the ESP8266 reboots.
On the Web Page there is a Enable button which then is sent to the mqtt_flags register.
If flag i set, then the mqtt startup initiates.
On the first start, it works. However when I change it fron Enabled to Disabled it seem to work.
Even HAMqtt::isConnected() returns false.
After I've enabled #define ARDUINOHA_DEBUG in the ArduinoHADefines.h library I've got some clues via Serial Debug lines:
On the first run, from setting Disabled to Enabled I got his:
But when I set is from Enabled to Disabled I've never recive this line:
So it seem that it never truly disconnects or just some mqtt status flags never get set to the proper state.
I've even tried to add change bool HAMqtt::disconnect() like so:
With the resultin Serial:
But still, the same thing happens after ReEnabling the Service, the ESP8266 reboots.
PhySix66
The text was updated successfully, but these errors were encountered: