Skip to content
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

esp8266 lost connection every 30 min #1018

Open
BruceAKABear opened this issue Jul 5, 2023 · 1 comment
Open

esp8266 lost connection every 30 min #1018

BruceAKABear opened this issue Jul 5, 2023 · 1 comment

Comments

@BruceAKABear
Copy link

I have meet one strange problem, esp8266 call connected() methd will return false every 30 min actually the hartbeat is still working, in my logic when connected() return I will reboot whole system. why connected() will return false?

`
hearbeat:

2023-07-05T10:45:47+08:00 [MQTT] 13388860@10.5.171.61:54257 msg: mqtt_packet_received, packet: PINGREQ(Q0, R0, D0)
2023-07-05T10:45:47+08:00 [MQTT] 13388860@10.5.171.61:54257 msg: mqtt_packet_sent, packet: PINGRESP(Q0, R0, D0)

my logic in connect:

2023-07-05T10:45:57+08:00 [MQTT] 13388860@10.5.171.61:53948 msg: mqtt_packet_received, packet: CONNECT(Q0, R0, D0),ClientId=13388860, ProtoName=MQTT, ProtoVsn=4, CleanStart=true,

`

my logic in loop:

`

void loop() {
if (WiFi.status() != WL_CONNECTED) {
connectWifi();
} else {
if (!mqttClient.connected()) {
connectMqtt();
}
}
mqttClient.loop();
}
`

@superbool
Copy link

Check your wifi is stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants