Chat freely about the open source Javascript projects for ESP8266

User avatar
By kolban
#34220 I loaded it up and it worked (sort of) for me ... the reason I say "sort of" is that if you hit it too quickly in succession, it will fail. The amount of free RAM available is painfully low ... and if you keep hitting refresh on the browser, the ESP8266 will get behind and run out of RAM.

There is a debug port on the ESP8266 where additional messages are logged. Attach a second USB->UART to UART1 (GPIO 2 if I remember ... tx only) ... and attach a serial monitor, you will see the debug and that will tell us why your device is resetting. Try and slow things down ... start up the app ... run a single browser request ... wait ... and see what happens.
User avatar
By tj4shee
#34243
kolban wrote:I loaded it up and it worked (sort of) for me ... the reason I say "sort of" is that if you hit it too quickly in succession, it will fail. The amount of free RAM available is painfully low ... and if you keep hitting refresh on the browser, the ESP8266 will get behind and run out of RAM.

There is a debug port on the ESP8266 where additional messages are logged. Attach a second USB->UART to UART1 (GPIO 2 if I remember ... tx only) ... and attach a serial monitor, you will see the debug and that will tell us why your device is resetting. Try and slow things down ... start up the app ... run a single browser request ... wait ... and see what happens.



Hi ! I've never attempted more than 1 browser request.... it never lets me get any further :D it always fails on the first one......

I hooked up the debug like you said.... and got a lot more info... as you suggested it would :D

here is what I got.... much more cryptic (as expected) than the console msgs..... (at least for today)


connected with BGDigital, channel 11
dhcp client start…
Wifi connected to ssid BGDigital, ch 11
ip:192.168.1.103,mask:255.255.255.0,gw:192.168.1.1
Wifi got ip:192.168.1.103,mask:255.255.255.0,gw:192.168.1.1
> jswrap_ESP8266_wifi_getIP
< jswrap_ESP8266_wifi_getIP
> net_ESP8266_BOARD_createSocket: host: 0.0.0.0, port:80
- espconn: 0x3fffba80
Dump of espconn: 0x3fffba80
- type = TCP
- local address = 192.168.1.103 [80]
- remote address = 0.0.0.0 [0]
- state=LISTEN, link_cnt=99, reverse=0x3ffefe28
< net_ESP8266_BOARD_createSocket, socket=0
E:M 136
E:M 48
Fatal exception 28(LoadProhibitedCause):
epc1=0x4023dd9e, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000010, depc=0x%. .
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 32412, room 16
tail 12
chksum 0xa5
ho 0 tail 12 room 4
load 0x3ffe8000, len 2140, room 12
tail 0
chksum 0xdb
load 0x3ffe8860, len 30012, room 8
tail 4
chksum 0x3d
csum 0x3d




Restart info:
reason: 2=exception
exccause: 1c
epc1: 4023dd9e
epc2: 0
epc3: 0
excvaddr: 10
depc: 0
Flash map 1MB:512/512, manuf 0xE0 chip 0x4014
Heap: 5056
Variables: 1023 @12ea = 12276bytes
Time sys=303452 rtc=40289584
mode : sta(5c:cf:7f:00:5b:e6) + softAP(5e:cf:7f:00:5b:e6)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
f r-40, > initDone
> jshInit
RTC read: 196 31651961 0xd4f24b52 (0xdeadbeef)
RTC: restore sys=326445 rtc=40293249
RTC: restored time: 251 (delta=8641288 cal=6271us)
UStimer init
< jshInit
> jswrap_ESP8266_init
> jswrap_ESP8266WiFi_init
Wifi init, mode=3
< jswrap_ESP8266WiFi_init
< jswrap_ESP8266_init
> jswrap_ESP8266WiFi_init
Wifi init, mode=3
< jswrap_ESP8266WiFi_init
< initDone
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt

connected with BGDigital, channel 11
dhcp client start…
Wifi connected to ssid BGDigital, ch 11
ip:192.168.1.103,mask:255.255.255.0,gw:192.168.1.1
Wifi got ip:192.168.1.103,mask:255.255.255.0,gw:192.168.1.1
User avatar
By kolban
#34248 Howdy TJ,
I think I see the problem ... when your ESP8266 boots up, it wants to BE an access point (not just a station to an access point). As such, we run out of RAM.

To see if this is the case, here is an experiment to run from a fresh boot:

Code: Select allvar wifi = require("wifi");
wifi.getStatus();
wifi.stopAP({ default: true});


and then reboot ... now the default for being an access point should be off and we should have more RAM for being an HTTP server.
User avatar
By tj4shee
#34257
kolban wrote:Howdy TJ,
I think I see the problem ... when your ESP8266 boots up, it wants to BE an access point (not just a station to an access point). As such, we run out of RAM.

To see if this is the case, here is an experiment to run from a fresh boot:

Code: Select allvar wifi = require("wifi");
wifi.getStatus();
wifi.stopAP({ default: true});


and then reboot ... now the default for being an access point should be off and we should have more RAM for being an HTTP server.



SUCCESS ! I at first tried what you had sent.... but for some reason, it would always reset to STA + softAP mode..... I had tried using it in that Config with the AT Firmware.... but gave up.... and looked at the other ways to program this.... I never learned LUA, had a bit of a time with the Basic.... so Arduino and Espruino are my last bets.... I like Javascript.... as well as Arduino....

Anyways... to solve my problem, I had to re-flash the AT Firmware, change the config to STA only, and then refresh with Espruino.... now it's working grand !

THANK YOU !!!!!!! So Much.... TJ