-
-
-
-
okay, found out that after ESP32S serving as an AP, and connected with a client, then i need to disconnect it and wait for 10+ seconds before change it to station mode and connect to local wifi, however, after a minute or so, it will start to prompt errors :
E (348565) MDNS_Networking: Cannot allocate memory (line: 34, free heap: 60 bytes) E (364028) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (364132) MDNS_Networking: Cannot allocate memory (line: 34, free heap: 60 bytes) E (366178) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (374166) MDNS_Networking: Cannot allocate memory (line: 34, free heap: 108 bytes) E (470118) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (470425) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (472170) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (485172) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (486402) MDNS: Cannot allocate memory (line: 113, free heap: 32 bytes) E (490277) event: post event to user fail! WARNING: Wifi:startMDNS - espressif WARNING: Wifi:stopMDNS
-
-
and here's what happened when I try to startAP and also connect wifi:
>wifi.startAP("test",{authMode:'wpa2',password:"88888888"}); =undefined >wifi.connect("xxxx",{password:"xxxxxxxx"},(err)=>{if (err){print(err);return;}print("connected");}); ERROR: Wifi: event_handler STA_START: esp_wifi_connect: 12298(SSID is invalid) =undefined >wifi.getIP() ={ ip: "0.0.0.0", netmask: "0.0.0.0", gw: "0.0.0.0", mac: "3c:71:bf:4c:a4:d4" } WARNING: Wifi:startMDNS - espressif connected >wifi.getIP() ={ ip: "192.168.11.31", netmask: "255.255.240.0", gw: "192.168.1.253", mac: "3c:71:bf:4c:a4:d4" } >E (774880) event: post event to user fail! E (777720) event: post event to user fail! E (780562) event: post event to user fail! E (783403) event: post event to user fail! >wifi.getIP() ={ ip: "0.0.0.0", netmask: "0.0.0.0", gw: "0.0.0.0", mac: "3c:71:bf:4c:a4:d4" } >wifi.getDetails() ={ status: "NO_AP_FOUND" } >
-
Here's what happened for my newly flashed ESP32S
>require("Wifi").getStatus() ={ station: "Unknown reason", mode: "AP", powersave: "modem" } >require("Wifi").save("sta+ap"); =undefined >require("Wifi").getStatus() ={ station: "Unknown reason", mode: "AP", powersave: "modem" } >E.reboot() ets Jun 8 2016 00:22:57 rst:0xc (SW_CPU_RESET),boot:0x13 (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 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:2668 load:0x40078000,len:7304 load:0x40080000,len:5312 entry 0x40080274 E (536) spiram: SPI RAM enabled but initialization failed. Bailing out. ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v04.3 (c) 2019 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate WARNING: jswrap_wifi_restore: AP=ESP_4CA4D5 >require("Wifi").getStatus() ={ station: "Unknown reason", mode: "AP", powersave: "modem" } >process.env ={ VERSION: "2v04.3", GIT_COMMIT: "83fba1f3", BOARD: "ESP32", FLASH: 0, RAM: 524288, SERIAL: "3c71bf4c-a4d4", CONSOLE: "Serial1", MODULES: "Flash,Storage,hea" ... "lnetServer,crypto", EXPTR: 1073484860 } >
so how to make my ESP32S to support "sta+ap" ?
This MCU can run both mode when I script it in Arduino, but when I script it in Espruino, it will automatically disconnect station wifi when it has Access point on.also, how to fix "E (536) spiram: SPI RAM enabled but initialization failed. Bailing out." ?
thanks for reading
-
-
-
Hi all, I'm making an access portal for client to connect, using code from https://gist.githubusercontent.com/wilberforce/cc6025a535b8a4c7e2910d4ba7845f11/raw/1e119c8ce11e81b190dc368cf7bfe4f4567ba82d/gistfile1.txt
I tried to connect it using my iPhone, sometimes the captive portal doesn't prompt and I have to manually open iOS Chrome and fill in 192.168.4.1 to load the portal page
moreover, when I fill in the wifi info for the ESP12e, and that the ESP-12e connected to the local wifi network successfully, obtained an IP of 192.168.8.12, then something strange happened: the ESP-12e webserver no longer listen web request from 192.168.4.1, and it now only listen to 192.168.8.12, which means, my iPhone failed to have any new interaction with ESP-12e thr 192.168.4.1, which made the captive portal unresponsive, and therefore the captive portal failed to notify my iPhone that it has obtained an IP of 192.168.8.12 from the local network
as a result, I have no way to figure the ESP-12e's wifi IP address from its captive portal page :( this is bad
how to ensure the web server listen to both wifi staton (192.168.8.12) and AP (192.168.4.1) ? thanks in advance
-
-
-
-
@fanoush
This is how blockly implemented waitForSeconds in their additional layer of Javascript interpreter:https://blockly-demo.appspot.com/static/demos/interpreter/async-execution.html
You can see that the 'waitForSeconds' work completely fine.
There is way to make the blockly makes sense in execution, so I think Espruino could do something to support 'waitForSeconds' like that Javascript Interpreter layer, and thus would make kids far more easier to play with Espruino?
-
@Robin
For kids to use blockly to program the microcontroller, so the javascript should exactly reflect what it intends, that is, to wait between loops' interations -
the current 'wait x seconds' for Espruino blockly doesn't always work as intended.
for example, if a
while(true)
loop containing await x seconds
block, for javascript, it doesn't really wait for the setTimeout function and will just immediately execute the next iteration.e.g. the attached image will be converted to:
while (true) { setTimeout(function() { digitalWrite(LED, 0); setTimeout(function() {}, 1000*1); }, 1000*1); }
Which is pretty confusing for the blockly user
So I implement a sleep function as stated in https://stackoverflow.com/a/16624104/63226
var sleep = function (miliseconds) { var currentTime = new Date().getTime(); while (currentTime + miliseconds >= new Date().getTime()) { } }
It works when I execute like sleep(1000) or sleep(2000), but for sleep(3000) the nodeMCU resets itself.
Is there a max execution time that forced the nodeMCU to reset? if yes, then how to increase it?
Thanks
-
-
-
-
I would like to store make a tool to copy all files of a mini website onto ESP12 and make it to serve the site
48 pages aren't quite enough to store it.
I made my own File Structure (without researching the right way to do so) using Storage Module, so that it can map the full folder structure & file content, i.e. mapping "/img/longFileName.js" with its content inside Storage module.
-
-
-
-
Yes it seems ESP32 wifi station connect eats up all heap memory!
This is what happened after a
reset(true)
You can see that the freeHeap dropped dramatically after connecting to the local network!