You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On ESP32, you cannot open a socket if the network is not established. This means that you cannot start the mqtt connection if the network is not connected. Error message at boot is: assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox)
jbaudoux
changed the title
Begin crashes with Invalid mbox on esp32
Begin crashes with Invalid mbox on esp32 due to MQTT connecting too early
Dec 22, 2024
Describe the bug
On ESP32, you cannot open a socket if the network is not established. This means that you cannot start the mqtt connection if the network is not connected. Error message at boot is:
assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox)
Bug is in
MqttClient::begin()
that connects without checking network herehttps://github.com/sidoh/esp8266_milight_hub/blob/master/lib/MQTT/MqttClient.cpp#L55
That
reconnect()
line should be removed.The mqtt connection will be established in the
loop
when callingMqttClient::handleClient()
after checking the network connection here https://github.com/sidoh/esp8266_milight_hub/blob/master/src/main.cpp#L531i think there is no need to connect in begin.
Steps to reproduce
I guess it depends how fast the network is established.
Expected behavior
Should not crash in begin
Setup information
Firmware version
1.13.1
Output of http://milight-hub.local/about
Output of http://milight-hub.local/settings
Additional context
Board: esp32dev
Build with
pio run --target upload -e esp32
The text was updated successfully, but these errors were encountered: