Hello,
I have kinda the same error on my ESP32c3.
On startup, I m able to connect to the wifi network registered in the memory.
Then I switch to the mode WIFI_MODE_APSTA, to host a web page and configure another wifi network.
Then, when I try to reconnect, i have :
Code: Select all
I (107143) mqtt_event_handler: MQTT_EVENT_BEFORE_CONNECT
E (107143) esp-tls: [sock=48] connect() error: Host is unreachable
E (107143) esp-tls: Failed to open new connection
E (107153) transport_base: Failed to open a new connection
E (107153) mqtt_client: Error transport connect
However, my device is connected to the wifi, I can see it in my administrator panel.
With wireshark in a working state, I can see the DNS request and response and then TCP and TLS exchanges.
In a not working state, I also have DNS request but I never have the TCP and TLS exchanges.
I have tried to open a socket to the MQTT network when I have MQTT_EVENT_BEFORE_CONNECT, and I got errno 118.
Looking on the internet, it means that I m not connected to my local network.