-
• #2
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" } >
-
• #3
Wed 2019.07.17
@Unreality, Is this a continuation of the snippets that were provided in #10 at
http://forum.espruino.com/conversations/336034/#comment14814269
-
• #4
Hi thx for asking, that was ESP8266, now I'm trying ESP32
-
• #5
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
-
• #6
Would like to have some help, thanks!
-
• #7
Looks like runs out of memory. Are you doing anything that may cause the out of memory or a memory leak?
-
• #8
Sorry let me be more specific for this question
the above snippets are after
reset(true)
-
• #9
it's not out of memory, as process.memory() still showing a lot of memory available
-
• #10
I'm not an expert in ESP32's memory, but AFAIK there is a separate amount of memory for the underlying Espressif RTOS. Used for networking & stuff. And those
Cannot allocate memory (line: 34, free heap: 60 bytes)
messages seem to be complaining about that heap.If you don't use BLE, maybe you can try to disable BLE by calling
ESP32.enableBLE(false)
. That gives more JS vars, maybe some heap too. I must admit, I'm just guessing here... -
• #11
Sounds like heap memory is incredibly low! Not sure what the cause of it could be. Did you try downgrading the firmware to 1v97-1v98? These use an earlier version of the Espressif SDK. Maybe could help -- just guessing.
-
• #12
Yes it seems ESP32 wifi station connect eats up all heap memory!
This is what happened after a
reset(true)
>wifi=require("Wifi") =function () { [native code] } >wifi.startAP("test",{authMode:'open'}); =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 >E (27318) event: post event to user fail! ESP32.getState() ={ sdkVersion: "v3.1.3-dirty", freeHeap: 33856, BLE: false, Wifi: true, minHeap: 21880 } WARNING: Wifi:startMDNS - espressif connected >ESP32.getState() ={ sdkVersion: "v3.1.3-dirty", freeHeap: 3112, BLE: false, Wifi: true, minHeap: 3044 } >
You can see that the freeHeap dropped dramatically after connecting to the local network!
Here's what happened for my newly flashed ESP32S
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