Jonny999999 / armchair_fw

Firmware for a homemade automated electric armchair using an esp32 controller on a custom pcb
https://pfusch.zone/electric-armchair-v2
0 stars 0 forks source link

Fix error when trying to **start wifi at mode select** #1

Closed Jonny999999 closed 9 months ago

Jonny999999 commented 2 years ago

Issue

It was planned that wifi only starts when changing to HTTP mode (in control.cpp) however wifi_init_client() or wifi_init_ap() fails / crashes the controller with the below error when run from control.cpp.

When run from main.cpp wifi_init and wifi_deinit works totally fine every time for some reason?!

I (11707) control: noting to execute when changing FROM this mode
W (11717) control: switching to http mode -> enabling http and wifi
I (11717) control: init wifi...

assert failed: xQueueSemaphoreTake queue.c:1549 (pxQueue->uxItemSize == 0)

Backtrace:0x40081a5e:0x3ffbd2d00x40088575:0x3ffbd2f0 0x4008f225:0x3ff
...

Current workaround

currently starting wifi every time at startup (never disable) independent of mode...

Jonny999999 commented 9 months ago

Implemented this behavior again in 77ba81e99634954874e5548993faabb07cc676e5 with no errors/crashes. The meanwhile major changes/optimizations in program structure most likely fixed this issue we had before.