-
-
-
Hello everybody,
I tried with different versions of firmware (2.04) and have every time the same issue:Uncaught InternalError: Failed! mbedtls_ssl_setup: Not enough memory
>process.env ={ VERSION: "2v04", GIT_COMMIT: "3956264e", BOARD: "ESP32", FLASH: 0, RAM: 524288, SERIAL: "240ac40a-ef84", CONSOLE: "Serial1", MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel", EXPTR: 1073484860 } >process.memory() ={ free: 2267, usage: 33, total: 2300, history: 10, gc: 0, gctime: 1.86 } >WARNING: Scan stop failed WARNING: set rssi scan not implemeted yet
Code Testing:
var ssid = "******"; var password = "*****"; var port = 80; var wifi = require('Wifi'); console.log("started"); wifi.connect(ssid, {password: password}, function() { console.log('Connected to Wifi. IP address is:', wifi.getIP().ip); var http = require('http'); http.get("https://www.google.com", function(res) { res.on('data', function(data) { console.log(data); }); }); // wifi.save(); // Next reboot will auto-connect });
Full Error:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v04 (c) 2019 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate >started ERROR: Wifi: event_handler STA_START: esp_wifi_connect: 12298(SSID is invalid) WARNING: Wifi:startMDNS - espressif Connected to Wifi. IP address is: 192.168.2.54 Uncaught InternalError: Failed! mbedtls_ssl_setup: Not enough memory at line 13 col 6 }); ^ in function called from system
Any help will be appreciated
Regards, pinnchus
-
-
-
-
-
-
After upload, did you a) run it and then save it? - or b) save it right away?
I have tried both options.Save will after completion call onInit, can you verify that?
Yes it does, in fact while connected it works very well. The problem happens when I connect it without a console, but in the code I do not have any call to write to the console.Compacting Flash... Calculating Size... Writing.. Compressed 81600 bytes to 19967 Running onInit()...
if force the running mode with load(), works ok...
>load() =undefined Loading 20034 bytes from flash... Running onInit()...
I 'm sure you already worked through the Troubleshooting section...
Yes I did but without success.Thanks for your help.
-
I think a my be doing something wrong, when run the code from the IDE, everything runs fine. But, when i try to save the code, wrapping the initialization code in a function and calling it from the onInit function does not run unless I call it manually with load(). When I run manually load() everything runs fine too.
The code is uggly, but it's working when i run it manually.
//All VAR are declared globally function initializeall() { require("Font6x8").add(Graphics); require("Font8x16").add(Graphics); i2c = new I2C(); i2c.setup({ scl : B6, sda: B7, bitrate: 1000000 }); g = require("SSD1306").connect(i2c, start, { height : 32 }); dht = require("DHT22").connect(B5); Start_read(); pinMode(B15,'input_pullup'); pinMode(B14,'input_pullup'); pinMode(B13,'input_pullup'); setWatch(selection, B15, { repeat: true, edge:'falling', debounce:20}); setWatch(BtnUP, B14, { repeat: true, edge:'falling', debounce:20}); setWatch(BtnDown, B13, { repeat: true, edge:'falling', debounce:20}); } function onInit() { USB.setConsole(true); setTimeout(function () { initializeall(); }, 1000); }
Does anyone has a hint?
Thanks
-
-
-
-
I would like to port it to STM32F405, should be an easy task but there is too many place with #define ... will try compiling as a PICO and change only linker file and mem.
-
-
@Stevie, Would you mind to share your C library?
Thanks,
-
-
-
If you like it, you could take a look to this js implementation http://www.movable-type.co.uk/scripts/tea.html
-
A simple but effective message encryption could be http://en.wikipedia.org/wiki/XTEA it is lightweight and should be fast enough.
-
Try with this examples http://forum.arduino.cc/index.php?topic=159851.0
-
Tried to reduce JSVARs by changing the 40,000 value in ...../targets/esp32/main.c (Did not find any other place to do it)
With little or not success, JSVARS reduced, but still not working.
My be this is exceeding my knowledge, will wait for @maze1980 version.
Thanks to all, for your efforts.