ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By mharizanov
#6611 I am experiencing resets after a 'malloc assert!' error, @pvvx has tracked the issue down to to LWIP releasing connections upon timer expiration in 60 seconds and not upon espconn_disconnect()

see here for his demo of the issue: https://www.youtube.com/watch?v=fAYhE389BbM

He suggests calling a "patch" function to force cleanup, but that doesn't seem to help much in my case.

Any suggestions to handle this in a more elegant way?
User avatar
By banitama
#6699 Hello everyone,

I encountered problem when trying to join an access point. When going to /wifi page, the module could detect my WPA2-secured AP, but failed to join when I entered the password and clicked "Connect!" button. It just keep scanning and scanning, no indication of connecting to my AP.

Here is the serial log:
Code: Select allCon req, conn=0x3fff4d80, pool slot 0
URL = /wifi/connect.cgi
Mallocced buffer for 54 bytes of post data.
Post data: essid=Baliteam&passwd=password&connect=Connect%21
Is url index 9
findArg: essid=Baliteam&passwd=password&connect=Connect%21
findArg: val Baliteam&passwd=password&connect=Connect%21 len 8
findArg: essid=Baliteam&passwd=password&connect=Connect%21
findArg: passwd=password&connect=Connect%21
findArg: val password&connect=Connect%21 len 13
Conn 0x3fff4d80 is done. Closing.
Con req, conn=0x3fff50e0, pool slot 0
URL = /wifi
Is url index 5
Conn 0x3fff50e0 is done. Closing.
Con req, conn=0x3fff5a70, pool slot 0
URL = /wifi/wifi.tpl
Is url index 8
Heatshrink compressed file; decode parms = b4
Con req, conn=0x3fff5c70, pool slot 1
URL = /wifi/style.css
Is url index 10
Heatshrink compressed file; decode parms = b4
Con req, conn=0x3fff5d90, pool slot 2
URL = /wifi/140medley.min.js
Is url index 10
Heatshrink compressed file; decode parms = b4
Conn 0x3fff5c70 is done. Closing.
Conn 0x3fff5d90 is done. Closing.
Con req, conn=0x3fff4d80, pool slot 1
URL = /wifi/wifiscan.cgi
Is url index 7
STA status = 0. Disconnecting STA...
Conn 0x3fff4d80 is done. Closing.


Compiled using Ubuntu 14.04 x64, using ESP8266-01 powered by 3.3v Arduino Due (should provide max. 800mA). Any idea on how to resolve this problem?
User avatar
By dnts
#6719
Sprite_tm wrote:
dnts wrote:How to save the ST SSID and password into the flash as they get reset to MYAP default on every power cycle (let alone re-flashing). I think I've traced the mode changing function wifi_set_opmode to user_interface.h which exposes some of the library commands so the mode itself is persistent but SSID and password are not.

You mean the SSID and password of the AP it connects to in STA mode? It should save that, at least, last time I checked the SDK itself does that. What version of the SDK do you use?

P.S. another quick one - is there a way to stop all printing to the UART and only have my specific functions access it? so that I can run an HTTPD server that receives some GET and POST requests and transfer only their arguments to the UART without all the current debug printing getting in the way?


You can disable the printfs in the httpd code (I should create a define for that) but that doesn't disable the printfs of the SDK itself. The usual trick, I believe, is to install a putchar handler using os_install_putc1 and either use that to send the data to UART1 or drop it alltogether, and then use the putchar routine of uart0 to send your data.


So I'm on 0.9.4 and it does not save network SSID and password for STA mode and after it successfully connects and sets mode for STA only (in resetTimerCb function) and resets.. it goes back to default SSID/PWD defined in the user_config.h. By the way - had to extend the on_timer_arm time from 4000ms to 10000ms for the resetTimerCb function to succeed.. otherwise it would get executed while connection was still being established. Probably due to my slow network DHCP server at home.
Nir
User avatar
By Sprite_tm
#6723 Banitama, dtns: If you compile the AT code with the SDK and flash that, then use AT commands to connect to the access point, does the ESP connect to / remember the access point data then?

dnts: The timer thing is a nice observation: I perhaps should code that a bit differently to account for slower DHCP servers like yours.