Closed tarzan115 closed 7 years ago
@tarzan115
You could have such kind of exceptions on ESP
when read
function is called without the actual network available. The MqttClient::yield
polling the read
to receive packets.
@tarzan115
I can't reproduce your issue.
After change [a1e83f84984e6b968f77e3508bcb608e12529dc8] the cycle
method performs verification if network is available. If the network is not connected It will not try to read the new packet from the network.
Could you please provide the code example to reproduce this.
I just use original your example ConnectEsp8266WiFiClient
I create a hotspot and setup for ESP8266 connect to. and then I turn that hotspot off. Esp8266 got Error Exception(28)
.
@tarzan115 Could you please share the stack trace of the exception?
Need to identify:
1) the exact ESP
API throwing the exception
2) if the WiFiClient::connected()
are able to detect the WiFi disconnection quickly enough
The problem was with WiFiClient::read
call after the network disconnection.
I don't know why ESP
implementation throws the exception instead of just returning the error status...
Improved NetworkClientImpl
template should resolve the problem.
Hi @monstrenyatko me again 😄 I got
Exception(28)
when call functionmqtt->yield(30000L);
inloop()
function in ESP8266 when I turn off my WiFi modem. I tried to test in so many cases and I figure out is inmqtt->yield(30000L)
function. and I also try in your example. It was the same. could you please check that.thank you so much.