B4R Question esp32 ap server scan networks stack crash

John Decowski

Member
Licensed User
Longtime User
trying to add a little web interface for setting ssid and passing password through post method. I receive a crash of module occasionally. It does work sometimes but crashes most times. It will actually reboot program. It will work fine if I remove the HTML code and just send ssid as text. Not sure if I can increase the stack size.
the log reads this during crash:


ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
modeIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11392
entry 0x40078a9c
AppStart
StartAP: 1
My AP ip: 192.168.4.1
Trying to connect to: decowski password: microbrand
Connected successfully to: decowski
192.168.2.7
GET /scan HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Accept:
Found: 8 networks.
132
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/./queue.c:1442 (xQueueGenericReceive)- assert failed!
aborassertion "res == coreID || res == portMUX_FREE_VAL" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/./portmux_impl.h", line 105, function: vPortCPUAcquireMutexIntsDisabled
abort() was called at PC 0x400d8683 on core 1
Backtrace: 0x40087c84:0x3ffccec0 0x40087d83:0x3ffccee0 0x400d8683:0x3ffccf00 0x40085933:0x3ffccf30 0x40085000:0x3ffccf50 0x400d41b0:0x3ffccf90
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
modeIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11392
entry 0x40078a9c
AppStart
StartAP: 1
My AP ip: 192.168.4.1
Trying to connect to: decowski password: microbrand



code is :

else If bc.IndexOf(Buffer, "/scan") <> -1 Then

Log("Found: ", numberOfNetworks, " networks.")

Log(StackBufferUsage)
Astream.Write("HTTP/1.1 200").Write(CRLF)
Astream.Write("Content-Type: text/html").Write(CRLF).Write(CRLF)
Astream.Write("900:").Write("<start>").Write(CRLF).Write(CRLF)
Astream.Write("<form action='/set.asp' method='post'>").Write(CRLF).Write(CRLF)

For i = 0 To numberOfNetworks - 1

'Astream.write("<").Write(i).Write(">")
'Astream.write(Main.wifi.ScannedSSID(i)).Write("<BR>")
Astream.Write("<input type='radio' name='ssid' ")
Astream.Write("value='").Write(Main.wifi.ScannedSSID(i)).Write("'>")

Astream.write(Main.wifi.ScannedSSID(i))
'Astream.write("</").Write(i).Write(">").Write(CRLF).Write(CRLF)





Next
Astream.Write("<input type='text' name='password'>").Write(CRLF).Write(CRLF)
Astream.Write("<input type='submit' name='submit'>").Write(CRLF).Write(CRLF)


CallSubPlus("CloseConnection", 200, 0)
 
Last edited:

John Decowski

Member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

Why not use the much simpler and more powerful approach: https://www.b4x.com/android/forum/threads/esp-configurator-based-on-b4rserializator.81452/#content


I'm making a simple iot device and wanted a simple way for anyone to configure network settings simply through any browser. Including a list of local ssids found. I did consider configuring through an app. But wanted to try and configure through browser if able.
 
Upvote 0
Top