ESP8266 goes down after sometime [SOLVED]

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
navy
Posts: 15
Joined: Sat May 04, 2019 6:37 am

Re: ESP8266 goes down after sometime

Post by navy » Mon May 20, 2019 8:43 am

I have esp8266 and esp32 with similar codebase.
Esp8266 has 4 DS18b20 sensors and send data to thingsspeak.
Esp32 has bme280 sensor and send data to thingsspeak too.

i've check a logs, and it was a few exceptions caught tonight on esp8266 in MQTT section, so no crashes.
Esp32 still working but i've spotted an 7 hours time lag with no data sent. I dunno what it was.
It is definitely not a server fault and not a wifi fault, because 8266 working well near.

From now i've start to monitor esp32. I thing it's a some bug specific to bme280 and i2c.

navy
Posts: 15
Joined: Sat May 04, 2019 6:37 am

Re: ESP8266 goes down after sometime

Post by navy » Fri May 24, 2019 7:46 am

After some tests i just realize that difference between my esp8266 and esp32 setup is only in hardware and position.

So a removed esp32 with bme280 more close to a door ( wifi router is on stairs). And it partially solves a problem.

This log is before i moved esp32. I see problems with wifi and exceptions in mqtt.

Code: Select all

field1=80.15&field2=18.45
MQTT connect exception
field1=81.15&field2=18.43
MQTT connect exception
field1=81.19&field2=18.44
MQTT connect exception
field1=81.17&field2=18.44
field1=81.10&field2=18.47
MQTT connect exception
field1=77.23&field2=17.82
MQTT connect exception
field1=77.12&field2=17.81
I (1731214) wifi: bcn_timout,ap_probe_send_start
I (1733714) wifi: ap_probe_send over, resett wifi status to disassoc
I (1733714) wifi: state: run -> init (c800)
I (1733714) wifi: pm stop, total sleep time: 505496430 us / 1728010995 us

I (1733714) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1733724) wifi: STA_DISCONNECTED, reason:200
beacon timeout[0m
I (1734094) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1734094) wifi: state: init -> auth (b0)
I (1734094) wifi: state: auth -> assoc (0)
I (1734114) wifi: state: assoc -> run (10)
I (1741214) wifi: bcn_timout,ap_probe_send_start
I (1743714) wifi: ap_probe_send over, resett wifi status to disassoc
I (1743714) wifi: state: run -> init (c800)
I (1743714) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1743724) wifi: STA_DISCONNECTED, reason:200
beacon timeout[0m
[0;32mI (1746144) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1748554) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1750964) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1753374) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1755794) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
I (1756154) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1756154) wifi: state: init -> auth (b0)
I (1757154) wifi: state: auth -> init (200)
I (1757154) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1757154) wifi: STA_DISCONNECTED, reason:2[0m
[0;32mI (1759574) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
I (1759934) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1759934) wifi: state: init -> auth (b0)
I (1759944) wifi: state: auth -> assoc (0)
I (1760944) wifi: state: assoc -> init (400)
I (1760954) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1760954) wifi: STA_DISCONNECTED, reason:4[0m
[0;32mI (1763364) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1765774) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
[0;32mI (1768194) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
I (1768554) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1768554) wifi: state: init -> auth (b0)
I (1768574) wifi: state: auth -> assoc (0)
I (1769574) wifi: state: assoc -> init (400)
I (1769574) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1769574) wifi: STA_DISCONNECTED, reason:4[0m
[0;32mI (1771994) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
I (1772354) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1772354) wifi: state: init -> auth (b0)
I (1773354) wifi: state: auth -> init (200)
I (1773354) wifi: new:<13,0>, old:<13,2>, ap:<255,255>, sta:<13,2>, prof:1
[0;32mI (1773354) wifi: STA_DISCONNECTED, reason:2[0m
[0;32mI (1775774) wifi: STA_DISCONNECTED, reason:201
no AP found[0m
I (1776134) wifi: new:<13,2>, old:<13,0>, ap:<255,255>, sta:<13,2>, prof:1
I (1776134) wifi: state: init -> auth (b0)
I (1776134) wifi: state: auth -> assoc (0)
I (1776144) wifi: state: assoc -> run (10)
I (1776294) wifi: connected with 55507, channel 13
I (1776294) wifi: pm start, type: 1

[0;32mI (1776294) network: CONNECTED[0m
[0;32mI (1779764) event: sta ip: 192.168.1.113, mask: 255.255.255.0, gw: 192.168.1.1[0m
[0;32mI (1779764) network: GOT_IP[0m
I (1788114) wifi: bcn_timout,ap_probe_send_start
field1=69.75&field2=21.18
field1=74.73&field2=18.82
MQTT connect exception
field1=79.64&field2=18.13
MQTT connect exception
field1=79.72&field2=18.14
MQTT connect exception
field1=79.83&field2=18.14
MQTT connect exception
field1=79.90&field2=18.14
MQTT connect exception
field1=79.95&field2=18.18
MQTT connect exception
field1=79.95&field2=18.18
MQTT connect exception
field1=79.96&field2=18.24
MQTT connect exception
field1=79.96&field2=18.24
MQTT connect exception
field1=79.93&field2=18.29
MQTT connect exception
field1=79.93&field2=18.29
MQTT connect exception
field1=79.93&field2=18.32
MQTT connect exception
field1=79.93&field2=18.32
MQTT connect exception
field1=80.00&field2=18.34
MQTT connect exception
field1=80.00&field2=18.34
MQTT connect exception
field1=79.91&field2=18.36
MQTT connect exception
field1=79.91&field2=18.36
MQTT connect exception
This is a log after i moved esp32 close to router:

Code: Select all

I (3674) wifi: connected with 55507, channel 13

I (3674) wifi: pm start, type: 1

[0;32mI (3674) network: CONNECTED[0m
..[0;32mI (5264) event: sta ip: 192.168.1.113, mask: 255.255.255.0, gw: 192.168.1.1[0m
[0;32mI (5264) network: GOT_IP[0m
Connection successful
('192.168.1.113', '255.255.255.0', '192.168.1.1', '192.168.1.1')
field1=75.03&field2=17.53
field1=75.03&field2=17.53
field1=73.32&field2=16.93
field1=78.74&field2=17.36
field1=80.98&field2=17.64
field1=69.75&field2=21.18
field1=69.75&field2=21.18
field1=84.39&field2=18.09
field1=84.89&field2=18.18
field1=84.65&field2=18.17
field1=80.19&field2=17.85
field1=79.45&field2=17.80
field1=81.41&field2=18.08
field1=82.50&field2=18.24
field1=81.12&field2=18.15
field1=78.17&field2=17.66
field1=79.72&field2=17.68
field1=81.32&field2=17.96
field1=82.45&field2=18.10
field1=80.76&field2=18.11
field1=77.13&field2=17.84
field1=79.07&field2=17.73
field1=80.97&field2=17.98
field1=82.10&field2=18.11
field1=82.65&field2=18.27
field1=79.59&field2=18.09
field1=76.59&field2=17.81
field1=79.63&field2=17.89
field1=81.52&field2=18.10
field1=82.46&field2=18.17
field1=83.27&field2=18.25
field1=79.73&field2=18.07
field1=76.30&field2=17.80
field1=79.92&field2=17.83
field1=81.29&field2=18.04
field1=82.25&field2=18.15
field1=83.01&field2=18.21
field1=83.77&field2=18.26
field1=79.18&field2=18.10
field1=76.33&field2=17.79
field1=80.29&field2=17.87
field1=81.68&field2=17.99
field1=82.61&field2=18.11
field1=83.16&field2=18.24
field1=83.66&field2=18.31
field1=81.74&field2=18.16
field1=77.93&field2=17.83
field1=80.39&field2=17.86
field1=82.38&field2=17.99
field1=81.00&field2=17.90
field1=76.22&field2=17.66
field1=78.97&field2=17.73
field1=80.59&field2=17.93
field1=82.04&field2=18.01
field1=82.76&field2=18.11
field1=83.28&field2=18.21
field1=83.83&field2=18.29
My conclusions:

0. It was a bunch of problems: bad code, bad wire connections, difference in hardware, position and wifi connection.
1. As Peter said, problems with wifi will occur. And i saw it.
2. mqtt.simple suck on connection problems.
3. WiFi module on esp8266 is more powerful than esp32 (i mean specifically my own 2 pcb)
4. WDT and exceptions are rulz :)

Next step is to rewrite code on mqttresilent lib.

Post Reply