Esp8266 disconnects from WIFI and doesn't reconnect automatically

If you are asking a question, please follow this template:

  1. Esp8266 disconnects from station wifi after a few hours and doesn’t reconnect automatically. Need to restart the chip by recycling power.

  2. Here is the log output

mongoose.c:4912         0x3fff12ec mbedtls_ssl_flush_output() returned -78 (-0x004e)
mongoose.c:4912         0x3fff12ec mbedtls_ssl_write_record() returned -78 (-0x004e)
mongoose.c:4912         0x3fff12ec mbedtls_ssl_send_alert_message() returned -78 (-0x004e)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 2096 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
mongoose.c:12068        Failed to resolve 'xxx.iot.us-east-2.amazonaws.com', server 192.168.31.1
mgos_mqtt_conn.c:229    MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 3640 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
mongoose.c:12068        Failed to resolve 'xxx.iot.us-east-2.amazonaws.com', server 192.168.31.1
mgos_mqtt_conn.c:229    MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 8318 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
mongoose.c:12068        Failed to resolve 'xxx.iot.us-east-2.amazonaws.com', server 192.168.31.1
mgos_mqtt_conn.c:229    MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 17464 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
mongoose.c:12068        Failed to resolve 'xxx-ats.iot.us-east-2.amazonaws.com', server 192.168.31.1
mgos_mqtt_conn.c:229    MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 30614 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113              /zzz_UPSTREAM -> {"data":{"eparams":{"AIRMS":0.00,"AWATT":0.00,"BIRMS":0.00,"BWATT":0.00,"CIRMS":0.00,"CWATT":0.00},"meters":{"AMETER":0.01,"BMETER":0.01,"CMETER":0.01}}}
mongoose.c:12068        Failed to resolve 'xxx.iot.us-east-2.amazonaws.com', server 192.168.31.1
mgos_mqtt_conn.c:229    MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256    MQTT0 Disconnect
mgos_mqtt_conn.c:549    MQTT0 connecting after 55514 ms
mgos_mqtt_conn.c:471    MQTT0 connecting to xxx-east-2.amazonaws.com:8883
  • Please help me with the quick fix for this asap.

Doesn’t look like you have shared enough logs. I’d assume you need to at least share the events related to WiFi (rather than MQTT) for anyone to be able to help

This is the total log. The problem starts from these lines
mongoose.c:4912 0x3fff12ec mbedtls_ssl_flush_output() returned -78 (-0x004e)
mongoose.c:4912 0x3fff12ec mbedtls_ssl_write_record() returned -78 (-0x004e)
mongoose.c:4912 0x3fff12ec mbedtls_ssl_send_alert_message() returned -78 (-0x004e)

After that, the log sort of keeps repeating.

There is no evidence in your log of wifi disconnection.
This line

Failed to resolve 'xxx.iot.us-east-2.amazonaws.com', server 192.168.31.1

shows a DNS issue rather than a wifi one.

Here is even more detailed log. The issue starts when esp8266 disconnects from WIFI and doesn’t automatically reconnect.

main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:4912 0x3fff12ec mbedtls_ssl_flush_output() returned -78 (-0x004e)
mongoose.c:4912 0x3fff12ec mbedtls_ssl_write_record() returned -78 (-0x004e)
mongoose.c:4912 0x3fff12ec mbedtls_ssl_send_alert_message() returned -78 (-0x004e)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 2096 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 3640 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 8318 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 17464 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 30614 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 55514 ms
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
esp_main.c:145 SDK: state: 5 -> 2 (3c0)
esp_main.c:145 SDK: rm 0
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 3
mgos_net.c:82 WiFi STA: disconnected
mgos_net.c:86 WiFi STA: connecting
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 2 -> 2 (b0)
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 57762 ms
esp_main.c:145 SDK: state: 2 -> 0 (2)
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 2
mgos_net.c:82 WiFi STA: disconnected
mgos_wifi.c:345 WiFi STA: Connect timeout
mgos_wifi.c:88 WiFi STA: Using config 0 (Xiaomi_EFB4)
mgos_wifi.c:270 WiFi STA: Connecting to Xiaomi_EFB4
mgos_net.c:86 WiFi STA: connecting
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 0 -> 2 (b0)
esp_main.c:145 SDK: state: 2 -> 3 (0)
esp_main.c:145 SDK: state: 3 -> 5 (10)
esp_main.c:145 SDK: add 0
esp_main.c:145 SDK: aid 3
esp_main.c:145 SDK: cnt
esp_main.c:145 SDK: state: 5 -> 2 (fc0)
esp_main.c:145 SDK: rm 0
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 15
mgos_net.c:82 WiFi STA: disconnected
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
mgos_wifi.c:345 WiFi STA: Connect timeout
mgos_wifi.c:88 WiFi STA: Using config 0 (Xiaomi_EFB4)
esp_main.c:145 SDK: state: 2 -> 0 (0)
mgos_wifi.c:270 WiFi STA: Connecting to Xiaomi_EFB4
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 202
mgos_net.c:86 WiFi STA: connecting
mgos_net.c:82 WiFi STA: disconnected
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 0 -> 2 (b0)
esp_main.c:145 SDK: state: 2 -> 3 (0)
esp_main.c:145 SDK: state: 3 -> 5 (10)
esp_main.c:145 SDK: add 0
esp_main.c:145 SDK: aid 3
esp_main.c:145 SDK: cnt
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 58023 ms
esp_main.c:145 SDK: state: 5 -> 2 (fc0)
esp_main.c:145 SDK: rm 0
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 15
mgos_net.c:82 WiFi STA: disconnected
mgos_wifi.c:345 WiFi STA: Connect timeout
mgos_wifi.c:88 WiFi STA: Using config 0 (Xiaomi_EFB4)
esp_main.c:145 SDK: state: 2 -> 0 (0)
mgos_wifi.c:270 WiFi STA: Connecting to Xiaomi_EFB4
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 202
mgos_net.c:86 WiFi STA: connecting
mgos_net.c:82 WiFi STA: disconnected
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 0 -> 2 (b0)
esp_main.c:145 SDK: state: 2 -> 3 (0)
esp_main.c:145 SDK: state: 3 -> 5 (10)
esp_main.c:145 SDK: add 0
esp_main.c:145 SDK: aid 3
esp_main.c:145 SDK: cnt
esp_main.c:145 SDK: state: 5 -> 2 (fc0)
esp_main.c:145 SDK: rm 0
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 15
mgos_net.c:82 WiFi STA: disconnected
mgos_wifi.c:345 WiFi STA: Connect timeout
mgos_wifi.c:88 WiFi STA: Using config 0 (Xiaomi_EFB4)
esp_main.c:145 SDK: state: 2 -> 0 (0)
mgos_wifi.c:270 WiFi STA: Connecting to Xiaomi_EFB4
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 202
mgos_net.c:86 WiFi STA: connecting
mgos_net.c:82 WiFi STA: disconnected
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 0 -> 2 (b0)
esp_main.c:145 SDK: state: 2 -> 3 (0)
esp_main.c:145 SDK: state: 3 -> 5 (10)
esp_main.c:145 SDK: add 0
esp_main.c:145 SDK: aid 3
esp_main.c:145 SDK: cnt
mgos_mqtt_conn.c:471 MQTT0 connecting to xxx.iot.us-east-2.amazonaws.com:8883
esp_main.c:145 SDK: state: 5 -> 2 (fc0)
esp_main.c:145 SDK: rm 0
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 15
mgos_net.c:82 WiFi STA: disconnected
main.c:113 /zzz_UPSTREAM -> {“data”:{“eparams”:{“AIRMS”:0.00,“AWATT”:0.00,“BIRMS”:0.00,“BWATT”:0.00,“CIRMS”:0.00,“CWATT”:0.00},“meters”:{“AMETER”:0.01,“BMETER”:0.01,“CMETER”:0.01}}}
mongoose.c:12068 Failed to resolve ‘xxx.iot.us-east-2.amazonaws.com’, server 192.168.31.1
mgos_mqtt_conn.c:229 MQTT0 TCP connect error (-1)
mgos_mqtt_conn.c:256 MQTT0 Disconnect
mgos_mqtt_conn.c:549 MQTT0 connecting after 64674 ms
mgos_wifi.c:345 WiFi STA: Connect timeout
mgos_wifi.c:88 WiFi STA: Using config 0 (Xiaomi_EFB4)
esp_main.c:145 SDK: state: 2 -> 0 (0)
mgos_wifi.c:270 WiFi STA: Connecting to Xiaomi_EFB4
mgos_wifi.c:118 WiFi STA: Disconnected, reason: 202
mgos_net.c:86 WiFi STA: connecting
mgos_net.c:82 WiFi STA: disconnected
esp_main.c:145 SDK: scandone
esp_main.c:145 SDK: state: 0 -> 2 (b0)
esp_main.c:145 SDK: state: 2 -> 3 (0)
esp_main.c:145 SDK: state: 3 -> 5 (10)

In my experience I’ve seen thinks like this when my WiFi router starts to play up. (202 and 3)
From memory I would get reason 15 when I got the WiFi password wrong, but that doesn’t seem to match what you are saying.

When I’ve been doing lots of connects/disconnects as part of dev work I’ve seen this, then resolved by restarting my router.

The thing is that esp8266 connects to the same router when restarted. If it is a router issue, the chip shouldn’t connect even after restarting. And this is happening with many different routers. The chips show the same behavior after every 6-12 hours. This issue never happens with ESP32 chip.

Does it solve with a reset or a power-on reset ?
Looks like your comms are lost and the OS decides to disconnect and reconnect after realizing something is wrong.
I’ve seen this happening with some Access Points and after a new program load.
How is your heap before this happens ? Are you checking MQTT send function’s return value ?

I’ve come across exactly this issue on a small number of our production devices (ESP32) and never managed to get to the bottom of it. We find that devices disconnect from MQTT server periodically, MOS reports that it’s unable to connect to the MQTT server and the TCP connection fails. UDP stays ‘up’ and we’re able to receive logs from the device over the internet over UDP. The only way to resolve the issue is to reboot the device, which causes it to immediately reconnect.

The only thing I’ve been able to find that gives any clues at all is that many of my customers seeing this issue had an LG Smart TV connected to the same router. Absolutely no idea why it’s related, but turning off the TV usually caused the disconnect issues to stop. Weird, huh?

Weird… I’ve read of some multicast issues with some WiFi routers due to Smart TVs, but…
Are you able to sniff some traffic when this is happening ? Sometimes when routers go nuts they discard some protocol or even some address, perhaps a new address assignment clears something inside… I’d like to see if the TCP SYNs are going out as expected to properly blame the router
On the other side, did you check heap memory usage ? MQTT can queue and queue hoping that it will finally get through.

Unfortunately it’s only ever happened on remote production devices with clients who don’t know how to setup packet filtering so I’m working blind. We did put in a script to report on heap whenever it failed but that didn’t seem to be an issue.

This is a serious issue on Esp8266. Mongoose os is simply not built for it I guess. It has cost me a lot of money as many of my devices have rendered useless. Restarting the device connects it to the mqtt server right away but it keeps stopping after every 1 or 2 days. I suggest dont use mos with es8266

I don’t believe it’s got anything to do with Mongoose-os. Our devices are ESP32, not ESP8266 - I believe it’s a problem somewhere in the ESP-IDF, but somehow linked to a very obscure external influence on the local network - until we can find somebody who’s having the issue who is able to get some Wireshark packet filtering to send across to the team at Espressif, I don’t think we’ll solve the issue. It only occurs on about 0.5% of my production devices.

Hello @needlerp, Any Update from Espresif?

Device : ESP8266, AWS
Wifi Router : MikroTik, Tp-link

Some Additional info, esp8266 MGOS 2.20, with dynamic DHCP, when MQTT connect to AWS, will cause Wifi STA to disconnect on MikroTik RB751U-2HnD router with disconnect reason 6 follow by reason 202. In UART debug, I see the system try to reconnect the Wifi STA and then disconnect the moment MQTT connect. Sometimes, it may succeed after 10 tries or more but lost connection after some time.

When MQTT is disabled, the Wifi STA connect and stays connect.

With Static DHCP (did only some short test), no drop in Wifi STA connection with MQTT enable.

On TP-Link AC750 router, MGOS 2.20, Wifi STA connect ok on both dynamic and static DHCP with MQTT.

Reverting to MGOS 2.19, Both router connect ok.

Summary:
MikroTik Router

MGOS version Dynamic DHCP Static DHCP
2.19 ok ok
2.20 Disconnect STA frequently when MQTT connect ok

The above test is based on test in office. Back in Jan 18 2022, I have mention similar issue on cesanta/mongoose-os - Gitter without enough test data.

I am also investigating why MQTT disconnect frequently on some devices with MGOS 2.19 and earlier.
We have seen some device from our log, that MQTT disconnect more than 10x a day, some 1000x
in a week. Most disconnected reason from AWS, MQTT_KEEP_ALIVE_TIMEOUT
or CONNECTION_LOST. According to observation, AWS MQTT consider a disconnection if the 1 minute ping failed.
Is there any other info what are the condition for the MQTT to disconnect?
About 17% of esp8266 disconnect MQTT “too” frequently.
Some feedback on field, Playstation 4, Home Security camera may have some interference.

ESP8266 modules usually simply have too few memory for 2.20. You might be running out of memory as MQTT does use the heap.

Even if the MQTT uses heap, it should not cause the WIFI STA to disconnect.

Wifi disconnect reason:
REASON_NOT_AUTHED = 6,
REASON_AUTH_FAIL = 202,

Since mos 2.19 works with aws mqtt at startup, mos 2.20 should also works.
If mos 2.20 has no solution for esp8266 AWS MQTT constant disconnecting WIFI STA, then we have to label mos 2.20 unsuitable for use for esp8266 if AWS MQTT are involved.

Since you know how these systems work, I’m sure you’ll solve it.

Yesterday, we visited one of the client to recover an ESP8266 FW with MOS 2.20. We have no information on what router it use. We could not even update the device via WIFI STA, we can only replace the ESP8266 FW with MOS 2.19 via AP mode.

Today, a quiet Saturday, I tried my hand on the Wireshark.
1x ESP8266, with MOS 2.19, wifi configure to connect to MikroTik router, accessible via Wifi STA
1x Mac mini (late 2014, Monterrey), wifi connect to MikroTik, able to connect to ESP8266 over Wifi STA
1x MikroTik router
I have power off all other device that uses WIFI to the MikroTik
Close all application on MAC mini that may use internet.

WireShark installed on the MAC, configure

  • to capture only wifi
  • record to file max 500MB with 10 ring buffer

Start recording with my finger pressed on the reset button on the ESP8266, after seeing some packet on the Wireshark, I released my finger from the ESP8266. Hoping that I could see some recording on the connection state on Wireshark.

No. Time Source Destination Protocol Length Info
134 80.729974 Espressi_3d:bf:1f Broadcast ARP 42 ARP Announcement for 192.168.88.146
135 80.753945 Espressi_3d:bf:1f Broadcast ARP 42 Who has 192.168.88.1? Tell 192.168.88.146

Only 2 ARP packet show the ESP8266, the rest are packet in and out of Mac mini.

I could see DHCP request for MAC mini when I turn off and then turn on the wifi while recording Wireshark. I guess Wireshark can only pick up packet only related to MAC Mini only since it is installed in MAC Mini.

How do I SNIFF the packet of the ESP8266 effectively?

Our statistic show 12% failure in the field with MOS 2.20 before we stop updating the client via OTA. To date, we have only visited 2 clients to recover the system via AP mode. Since then, we discover a 100% failure with MikroTik router when MOS 2.20 is used.

How can I help to resolve this issue?
Is MOS 2.19 the final journey for ESP8266?