Open TribesTom opened 6 years ago
Another test this morning.
I launched the webserver before the others threads this time
>>> Send to thread 1073607652 data : {"humidity": "52.06", "temperature": "22.51", "pressure": "980.91"} publish to test/bureau/microsensor/test1 msg : {"humidity": "52.08", "temperature": "22.52", "pressure": "980.91"} ***ERROR*** A stack overflow in task MicroWebServer has been detected. abort() was called at PC 0x40095d88 on core 1 Backtrace: 0x40095ba8:0x3ffda170 0x40095d6f:0x3ffda190 0x40095d88:0x3ffda1b0 0x4009172a:0x3ffda1d0 0x40093944:0x3ffda1f0 0x400938fa:0x3ffda1f8 CPU halted.
I have tested with 4k and 8k stack in thread launch.
It crash when i try to load the index.html example in the browser.
Hello,
Here is a link with the code :
https://git.open-nt.be/TribesTom/MicroSensor-pub
The part about the ota is disabled as I m not using an OTA firmware for now. The progupdate is the same as the ota but for the py code.
After this is the real program :
I have 1 thread for a BME280 sensor. 1 thread for the MQTT which receive notification from BME thread And one thread for the webserver which will be used later for updating the configuration.
Thanks
I'll try to test the code next week.
Hi all,
just to report that I have a very similar issue (LoadProhibited) when using MicroWebSrv with websockets. In my application, the websocket is used to receive some updated values from the user (at roughly a 100ms period). In the websocket RecvTextCallback callback I set the received value in a variable. Then a callback triggered by a timer reads such value and use it. Is it possible that we are hitting a concurrency issue? I have also tried to use machine.disable_irq()/machine.enable_irq() in the critical section in the RecvTextCallback, but it didn't fix the problem.
also still struggeling with similar issue with LoadProhibited https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/issues/165
i have neopixel animations running in a thread. as soon as i try to change sth with the webserver i got that error.
after alot of reading i checked the sizes of the threads with _thread.list() and found out that the pixel animatios are very memory consuming. means that max_used was always just a bit smaller than max_size of the thread.
so i increased the stack size of the pixel animations..
now guruMeditationError is almost gone but ended up with another error:
assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "/home/chrissi/coding/microPy/MicroPython_ESP32_psRAM_LoBo/MicroPython_BUILD/components/micropython/py/gc.c", line 699, function: gc_realloc
hey guys, i don't think this is an issue. Did u ever think of fragmentation?
i implemented the whole stuff with the original microPy framework. When trying to create a Thread i got an error - memory allocation failed. So i took a look on the memory.
Thats what my memory looks like after crash:
>>> micropython.mem_info(1) stack: 768 out of 15360 GC: total: 80000, used: 42992, free: 37008 No. of 1-blocks: 356, 2-blocks: 59, max blk sz: 383, max free sz: 381 GC memory layout; from 3ffc4b30: 00000: MDMhhhDhhShhShShq=======Q======================================= 00400: ================================================================ 00800: ================================================================ 00c00: ================================================================ 01000: ================================================================ 01400: ================================================================ 01800: =======================MhhBTSSBDhhSShMDSShSMDSSMDhBSSh=Shhh==hhh 01c00: Fh=FSh=Sh=SSh=Sh=SSSSShh===h=TBThhhLBBhhSq=======SSSSSSSSSq===== 02000: ==SSSSSShSSq=======hhhMDh=hhhTFSShh=TMDBSh==LSFFShhhSSSFFFFFFFFS 02400: h===h===FFFFFFFFh=SFFFh==SSh======Shh=Sh=h=============Sh=h===== 02800: =SSShSSq=======h==============h=========Shh==h=SSh====h=======Sh 02c00: =h======================h==h===============SSSSSh=BTTBTDh=DBBBhB 03000: hSh=h==================h==Shh============hh=h==h=h===Bh==Dhh==== 03400: ==h========hh=Bhq=======h======hSh=====Sh=h===========hhh=h===== 03800: ==hq=======h=========ShhhhSh=hh=h===hh==h=============Sh=h====== 03c00: ======================h================FFSh==============h====== 04000: =======h==============h============h============h=============== 04400: ===========h=============TB=h===hh===BBBhB=BhBh===========h===== 04800: Sh=h===========h===========h=========hhSh=h================h=q== 04c00: ================hq======SSShq===========BBBBTBhBhB=hB=hB=BBhB=h= 05000: hB=B=BBB=BB==BBBBBh====h===hh=BBhhhhhhhhhDTBhhh=h===B=BBBh====== 05400: =====h=====Bh===h==q=======BBBBBh==============hSh=BBh===h=h==h= 05800: Bhh========h============h=h=hh=Sh=B.....h=....h=.......h........ 05c00: .......Sh=h=====...hhh====h==========h====h=============h======= 06000: h=========.........................................h============ 06400: =====================h==========h======h=====h================h= 06800: ================================================================ 06c00: ===......hhhhh==hh.....hq=========...............h============== 07000: =========..........................hh=====================...... (2 lines all free) 07c00: ..................hq=======..................................... 08000: ..................h===========================.................. (2 lines all free) 08c00: ...........................................................hq=== 09000: ====...............hhh==h.....hhhh=.hhhhh.....hh...hhh...h.....h 09400: ...................................................h======h===== 09800: =====..hq=======................................................ (2 lines all free) 0a400: h====h========h================h=======h===========h============ 0a800: =h=====..........................q=======h====================== 0ac00: =========================....................................... (3 lines all free) 0bc00: .............q=================================................. 0c000: ................................................................ 0c400: .....h.....hhh.................................................. (2 lines all free) 0d000: ..............hh...h............................................ 0d400: .......................................................hh......h 0d800: hh........................h=.................................... 0dc00: ................................................................ 0e000: .............h==========================h=====h=====h===h====h== 0e400: h=====h=========h======h======hh=========hh=============hh=====h 0e800: h====hh==========h=h===================hh=========h=h=========== 0ec00: =hh==============h=h=============hh=================h=========== 0f000: ===============hh==h================hh==hh===hh==hh===hh==hh===h 0f400: h======h=h==hh==hh=hh==hh===hh==hh===hh===hh===hh===hh==h....... (5 lines all free) 10c00: ..h============================================================= 11000: ================================================================ 11400: ================================================================ 11800: ================================================================ 11c00: ================================================================ 12000: ===========..................................................... (5 lines all free) 13800: ........
Hello Loboris,
I have some strange problem with MicroWebSrv.
When I launch the MicroWebSrv, I have either a kernel panic or another thread crashing
1 case : `>>>
2nd case : `>>>
I have only the example index.html in the www directory.
It seems the microserver thread is accessing some memory it shouldn't.
If you need other example or the code to test I can try to plublish it.
Thanks