MQTT connection fails when using static IP

ht_main1
Posts: 28
Joined: Sun Oct 06, 2019 6:08 pm

MQTT connection fails when using static IP

Postby ht_main1 » Mon Dec 14, 2020 5:36 am

hi
i am using MQTT example from ESP -IDF, when i first tested it worked very well , it connected well with server and published DATA,
I am using Ethernet, but to my need i set ethernet IP as static , and after that MQTT connection fails.

idf version: 4.0

folowing is log from file,
D (13538) emac_esp32: receive len= 249[0m
[0;32mI (13558) eth_example: free heap: 179932[0m
D (13698) emac_esp32: receive len= 78[0m
D (13698) emac_esp32: receive len= 86[0m
D (14498) emac_esp32: receive len= 60[0m
D (15128) emac_esp32: receive len= 60[0m
D (16138) emac_esp32: receive len= 60[0m
D (16628) MQTT_CLIENT: Reconnecting...[0m
[0;32mI (16628) MQTT_API: Other event id:7[0m
[0;31mE (16628) MQTT_CLIENT: Error transport connect[0m
[0;32mI (16628) MQTT_API: MQTT_EVENT_ERROR[0m
D (16628) MQTT_CLIENT: Reconnect after 10000 ms[0m
[0;32mI (16638) MQTT_API: MQTT_EVENT_DISCONNECTED[0m

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: MQTT connection fails when using static IP

Postby PeterR » Mon Dec 21, 2020 1:30 am

The MQTT over web socket assumes that everything is in a single ethernet packet as I recall. If you are using websockets then check my posts, there is a patch in there somewhere.
Perhaps the same issue exists with other transports?

There is not enougth in your log for me to work with. Why the first 'reconnecting' - what caused the connection to be dropped? It could be anything including a network timeout. Keep in mind that public servers have bad days.
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: No registered users and 112 guests