>onInit()
=undefined
Connecting to WiFi
192.168.1.117
Wait a minute, and it says:
Connecting to Google
Connecting with TLS...
Loading the CA root certificate...
Loading the Client certificate...
Loading the Client Key...
ERROR: Failed! mbedtls_ssl_setup: Not enough memory
ERROR: Unable to create socket
Connecting with TLS...
Loading the CA root certificate...
Loading the Client certificate...
Loading the Client Key...
Performing the SSL/TLS handshake...
(so it fails)
wait another minute, and I get:
Connecting to Google
Connecting with TLS...
Loading the CA root certificate...
Loading the Client certificate...
Loading the Client Key...
Performing the SSL/TLS handshake...
>Verifying peer X.509 certificate...
Connected to Google
Google connection closed, 6294 bytes received
So it works - but it's properly tight on memory.
What's happening is the first time it's got the command history and other stuff in memory, and it tries to allocate everything it needs but it can't find enough continuous space, even after it's freed everything.
Next time the history's already been freed so it's able to 'fill the gaps' while executing, leaving a much larger contiguous amount of memory.
I just modified onInit as follows, and it works first time:
function onInit() {
clearInterval();
// initialise the ESP8266, after a delay
setTimeout(function() {
// try and free some memory
delete fwrite;
delete onInit;
global["\xff"].history=[];
// original code.....
digitalWrite(B9,1); // enable on Pico Shim V2
However I've just pushed the new version of the Web IDE (0.65.2) with the send module as function enhancement, so you could give that a try too.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, so I do the following:
upload. It says:
type 'onInit()'. It says:
Wait a minute, and it says:
(so it fails)
wait another minute, and I get:
So it works - but it's properly tight on memory.
What's happening is the first time it's got the command history and other stuff in memory, and it tries to allocate everything it needs but it can't find enough continuous space, even after it's freed everything.
Next time the history's already been freed so it's able to 'fill the gaps' while executing, leaving a much larger contiguous amount of memory.
I just modified
onInit
as follows, and it works first time:However I've just pushed the new version of the Web IDE (0.65.2) with the
send module as function
enhancement, so you could give that a try too.