Crashes consistently in asyncio.sleep or trying to run some other task #9352
Replies: 10 comments 24 replies
-
That's surprising... Which firmware are you using? (Can you send us the exact filename you flashed, or the commit number and board if you compiled yourself). |
Beta Was this translation helpful? Give feedback.
-
I am using a weimos D1 mini clone with ESP 8266 which has 4M flash |
Beta Was this translation helpful? Give feedback.
-
This does not make sense to me: async dosomething:
While True:
#do something NTP time query
await asyncio.sleep(60) Shouldn't this read: async def dosomething():
While True:
#do something NTP time query
await asyncio.sleep(60) |
Beta Was this translation helpful? Give feedback.
-
I think I have isolated the issue, When the code wakes up from asynco.sleep it tries to call a variable inside a singleton class to check whether AP is still in use, I think this is causing some issue I was previously calling I have replaced it with a direct call to
|
Beta Was this translation helpful? Give feedback.
-
Sorry I'm really confused -- what version of MicroPython are you actually running? 1.13 two years old there have been numerous fixes to asyncio since. Can you replicate this issue with an official build from the downloads page of v1.19.1 ? |
Beta Was this translation helpful? Give feedback.
-
@jimmo I just sleep for 5 seconds with time.sleep(5) even that is crashing after few loops So there is some interrupt or exception occurring in the firmware irrespective of what ever code is being executed, it so happens that I got stuck up with asyncio sleep. I suspect without any proof that it could be the WLAN code, as if STA is inactive NO SUCH issue occurs |
Beta Was this translation helpful? Give feedback.
-
I have observed the following if both STA and AP are active BUT if STA not connected to any SSID - then its all well The #15 ets_task(4020f560, 28, 3fff9430, 10) probably is crashing occasionally resulting in mayhem? I did a grep on the code and found ets_task function only in esp8266/ets_alt_task.c - who calls it? |
Beta Was this translation helpful? Give feedback.
-
Did you check for power problems? The ESP8266 can draw quite a bit of current when transmitting. The genuine Wemos D1 is fine, but clones may have problems in attempts to save a few cents. And at the price of a genuine Wemos D1, you do not need a clone. |
Beta Was this translation helpful? Give feedback.
-
I can give you some update on this and one of you can provide a possible cause. Deductions so far: Suggestions received so far: Faulty power supply. Further deductions : I have 3 ESP8266 boards and they are all different clones Weimos clone. Node MCU v3 clone and ESP01S. ESP01s has no 3.3V regulator - others have AMS1117 chip printed All of them crash after 30 seconds or so,when STA connection is active . I tried to power these 3 (bypassing the boards 3.3v regulator) with another board which is a ESP 32 nodemcu which also has an AMS1117 So it failed everytime with STA turned on and if there is a SLEEP condition Next I made one of the ESP8266 as a WiFi AP. Now I connected the other ESP8266 to this using STA - EUREKA - No more crashes. So there is something in the WiFi connection between ESP8266 and my router which is a b/g/n router, which performs some action at 30 seconds after a new connection which results in the STA task getting killed beyond redemption. When the same ESP8266 connects to another ESP8266 its only 802.11/g connection at 54Mbps. To test whether signal strength is the issue, I took the ESP8266 far away so that Rssi between ESP8266 were -71dB where as the router signal was more powerful at -45dB So it appears that there is something in the code of the radio module causing it to crash with my router after 30 seconds. |
Beta Was this translation helpful? Give feedback.
-
With esp.osdebug(0) when the EPS8266 connects to my router it prints out
Where as when it connects to my phone it prints aid 1, other than that everything is the same/ When I aid is 2 - it fails after 32 second I found this information about a DOS bug in ESP8266 that can crash Could you please check your device with esp.OSdebug(0) and let me know what gets printed for aid - when you connect to your routers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very simple program to debug this problem
the code crashes after around 5th or 6th iteration of the while loop - this is consistent, the last statement that gets printed is the one before sleep , I turned esp debug message and I am seeing some interrupt is causing it, the board doesn't even have any pins soldered, its a weimos D1 mini clone ESP8266 board, just connected and powered via USB.
After crashing and automatic rebooting for 4 or 5 times - sometimes the problem goes away. Sometimes it gets stuck in that mode and keep resetting.
Can you please let me know what is causing this interrupt which appears to be uncaught some where
Beta Was this translation helpful? Give feedback.
All reactions