Closed MaBecker closed 1 week ago
Ouch - is this new in 3.3.6?
No, just tested a 2v09 version
____ _
| __|___ ___ ___ _ _|_|___ ___
| __|_ -| . | _| | | | | . |
|____|___| _|_| |___|_|_|_|___|
|_| espruino.com
2v09.11 (c) 2021 G.Williams
Espruino is Open Source. Our work is supported
only by sales of official boards and donations:
http://espruino.com/Donate
Execution Interrupted
New interpreter error: LOW_MEMORY,MEMORY
>
Not sure what causes this?!
ESP32 is calling many times esp_wifi_connect()
ESP8266 is just calling it in jswrap_wifi_connect()
The ESP32 is calling it additionally in event_handler()
I think there is a way of turning on some extra debug logging for ESP32? Memory errors are frustrating to debug because as there's no memory left a stack trace can't be stored.
Is it reproducible every time with that code you added?
Just build new app and esp-ifd files and the error disappeared ....... will run some more tests
Ok, it still happens ....
>
Execution Interrupted
New interpreter error: LOW_MEMORY,MEMORY
{ "free": 4036, "usage": 59, "total": 4095, "history": 0,
"gc": 0, "gctime": 16.768, "blocksize": 13 }
{
"sdkVersion": "v3.3.6",
"freeHeap": 2876068, "BLE": true, "Wifi": true, "minHeap": 2874536 }
>
>
>
>console.log(wifi.getIP());
{
"ip": "192.168.101.103",
"netmask": "255.255.255.0",
"gw": "192.168.101.1",
"mac": "34:94:54:c0:bd:f0"
}
=undefined
Was'nt this changed to use jsWarn, jsError etc. long time ago ?
Am Fr., 9. Dez. 2022 um 09:26 Uhr schrieb Gordon Williams < @.***>:
I think there is a way of turning on some extra debug logging for ESP32? Memory errors are frustrating to debug because as there's no memory left a stack trace can't be stored.
Is it reproducible every time with that code you added?
— Reply to this email directly, view it on GitHub https://github.com/espruino/Espruino/issues/2295#issuecomment-1343998640, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPYNHVLYY7AUAASSDDIUA3WMLULDANCNFSM6AAAAAASLH6HRI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
workaround is call to E.reboot() and than upload the code
Edit: Do not connect if already connected
var ssid="SSID";
var password="password";
var wifi=require("Wifi");
wifi.stopAP(()=> {
print(wifi.getStatus());
var status = wifi.getStatus();
if (status.ssid == ssid && status.station == "connected"){
print(wifi.getIP());
} else {
wifi.connect(ssid, {password: password}, function() {
print(wifi.getIP());
});
}
});
@gfwilliams: Should this be handle internaly by the wifi.connect() function? Or is handling it in JS good enough?
The wifi.connect function should really handle this, yes. I think if it's already connected it should probably attempt to stop the connection first, as in some cases a user might want to force a reconnect to an existing AP.
You mentioned in https://forum.espruino.com/conversations/395499/?offset=125#17501763 that it might be 'broken again' so do you still think this is the issue?
When I tested here I enabled all the wifi debug messages and I didn't see any sign that the C3 had even managed to get a wifi connection before .connect
was called.
fixed in the latest build.
The wifi.connect function should really handle this, yes. I think if it's already connected it should probably attempt to stop the connection first, as in some cases a user might want to force a reconnect to an existing AP.
You mentioned in https://forum.espruino.com/conversations/395499/?offset=125#17501763 that it might be 'broken again' so do you still think this is the issue?
When I tested here I enabled all the wifi debug messages and I didn't see any sign that the C3 had even managed to get a wifi connection before
.connect
was called.
We can use disconnect or connect with different setting.
Running test wifiEvents.js