-
Notifications
You must be signed in to change notification settings - Fork 140
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
Library fails with ESP32 Ethernet boards that use ethernet instead of WiFi #97
Comments
I have pushed the suggested fix into de |
Will test today and come back to you. Thanks! |
I tried unsuccessfully to make it work from the dev branch, I think there might be some issues and I did not want to modify too many things: I am getting errors on WiFiEvent from the EspSimpleWifiHandler library:: Same for: After fixing these I am still getting errors all related to WiFiEvent:
And so on... Maybe this is a breaking change from 2.0.1 ESP32 library? I will keep investigating tomorrow and see if I can make any sense of it or find an easier solution. Thanks, |
Thank you, these logs are valuable. It works well on my side (with both ESP32 and ESP8266), but I am not sure wich ESP32 core version I had when I tested this. I will do more testing in the next days. |
Sorry I was not able to get much further, I am thinking of a different approach for you to check if this would work. Maybe you can use the: And unset them on: And check for connectivity using if (_wificonnected || _ethconnected) This way you will have a quite accurate and reliable way of knowing if there is a connection you can use? And replace code:
I will do some additional testing and see if this method would work. Thanks |
Description of the problem
When using ESP32 with ethernet, MQTT library fails to send as it is relying on WiFi being connected, is there any failsafe for this situation already built in that I did not see?
Versions
This happens on all versions
Hardware
C++ code
The following code stops MQTT from executing on "Ethernet-only" connections
I believe that we should remove the isWifiConnected or at least have a possibility to ignore wifi connectivity otherwise the MQTT library will never be able to work over Ethernet.
Since we have the _handleWiFi parameter, maybe we can use that in all if statements where we can use
This way we can eliminate the checking for WiFi connectivity altogether in case we are not having MQTT Library manage WiFi connections.
Thanks,
Pablo
The text was updated successfully, but these errors were encountered: