Help with random resets

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
gmeloy
Posts: 4
Joined: Tue Aug 15, 2017 6:55 pm

Help with random resets

Post by gmeloy » Wed Feb 07, 2018 1:40 pm

Hi,

I've got a custom board with an ESP-12S module connected to an ARM processor via the UART. I have an FTDI adapter on this UART as well so I can see the communication between the ESP8266 and the ARM. I have python scripts on the ESP that will let me use the ARM to open a websocket to a known address, send a JSON-formatted structure, receive a response, and then close the websocket. I'm currently doing this once a second, though in the final app it'll be more like twice a minute. As a part of debugging the problem I'm having, I added a gc.collect() after each transaction. With that, along with a micropython.mem_info() printout that I had in for awhile, I'm pretty sure that I'm not running out of memory.

It's generally working, but the ESP8266 resets randomly. I ran it overnight last night and it happened 7 times.

I looked into determining the causes of resets and it seems that what you get from the stock build isn't very informative and that you have to build your own Micropython to really get detailed information out. That's not out of the question if it will really be useful, I've built MP before, but for now I'm just running the precompiled downloadable binary. Here is what it printed each time it reset last night:
rst cause:2, boot mode:(3,6).
That looks like it was caused by the reset pin? It's possible that the regulator on our board or my power supply isn't up to snuff.

More info on what I'm using:
Websockets code based on: https://github.com/danni/uwebsockets
Micropython version: esp8266-20171101-v1.9.3.bin

Any help would be appreciated,
Glen

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Help with random resets

Post by pythoncoder » Thu Feb 08, 2018 9:44 am

As a very general point the ESP8266 vendor firmware has buffers which can overflow if data is sent to a socket at a higher rate than it can be processed (e.g. due to varying network delays). This can cause lockups and auto-resets. Do you ever see LmacRxBlk:1 errors? These are a sure indicator of this.

I'd try re-testing with much lower throughput and see if that makes a difference.
Peter Hinch
Index to my micropython libraries.

gmeloy
Posts: 4
Joined: Tue Aug 15, 2017 6:55 pm

Re: Help with random resets

Post by gmeloy » Thu Feb 08, 2018 3:50 pm

I have seen those LmacRxBlk:1 messages before, but I haven't seen it in my last several days of testing. I'll back off to once every 5s and see if the resets still happen.

Thanks!

Post Reply