ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By gipmad
#1961 Jeroen, you never cease to amaze me. Beerware? I'll make sure you'll have all the Italian Grappa that your body can handle (and more) at next years CCC! :D
I'm playing with the code, but compiling from the main source I get an error when scanning for networks in the page wifi.tpl:
Code: Select allCon req, conn=0x3fff3eb0, pool slot 0
URL = /wifi/wifi.tpl
Is url index 8
Heatshrink compressed file; decode parms = b4
Conn 0x3fff3eb0 is done. Closing.
Con req, conn=0x3fff40a8, pool slot 0
URL = /wifi/style.css
Is url index 10
Heatshrink compressed file; decode parms = b4
Con req, conn=0x3fff4268, pool slot 1
URL = /wifi/140medley.min.js
Is url index 10
Heatshrink compressed file; decode parms = b4
Conn 0x3fff40a8 is done. Closing.
Conn 0x3fff4268 is done. Closing.
Con req, conn=0x3fff4388, pool slot 0
URL = /wifi/wifiscan.cgi
Is url index 7
Fatal exception (28):
epc1=0x402411a9, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000aa, depc=0x00000000

And then the device resets. The module can only see one network, so I don't think it's an overflow..
User avatar
By Sprite_tm
#1964 CheapB: I haven't looked at the official SDK yet, but apart from some paths that may be different (which you should be able to solve by setting the correct environment variables to override them).

Gipmad: You're Mastro Gippo, if I'm not mistaken? Yeah, last CCC was a blast, and I don't have any bad memories of the Grappa :)

Hmm, I don't have had that error yet... but the wireless scan result gathering is a bit flakey in general. I'll see what I can do. In the meanwhile, it may help to run arm-xtensa-whatever-objdump -S on the elf file that's generated and see what's at the SP in the error message. (Sorry for not being clearer, I don't have the SDK installed here.)
User avatar
By gipmad
#1976 Yep, that's me! Can't wait to meet you again this summer! I may also be @ hackadaymunich! :)
I never did that kind of debugging before, but I tried; I "randomly" looked up on the generated file. I couldn't find epc1=0x402411a9, I guess they are cpu registers. By looking at excvaddr=0x000000aa, I found the probable culprit (line "aa"):
Code: Select all   //Copy access point data to the static struct
   bss_link = (struct bss_info *)arg;
   while (bss_link != NULL) {
  9c:   000e86           j   da <wifiScanDoneCb+0xae>
  9f:   380000           excw
      cgiWifiAps.apData[n]=(ApData *)os_malloc(sizeof(ApData));
  a2:   e01c         movi.n   a0, 30
  a4:   fe             .byte 0xfe
  a5:   33fa11           l32r   a1, fffcd090 <tplWlan+0xfffccc3c>
  a8:   222c         movi.n   a2, 34
  aa:   0139         s32i.n   a3, a1, 0
  ac:   ffdd01           l32r   a0, 20 <wifiScanDoneCb-0xc>

Thank you for pointing me to the right path; I have to do some "real" work now, I will try to place some printf to debug these lines when I get some more spare time!