https esp32 #7171
Replies: 1 comment
-
Posted at 2019-12-21 by Robin Sat 2019.12.21 Good morning @Pinnchus, while I've chosen not to provide support for non official supported boards, I commend you on the structure of your request. Providing that detail is what is necessary for others to grasp what is going on. In the mean time, some thoughts. . . . Is there any additional detail spelled out in the console dump? From the error 'mbedtls_ssl_setup' for memory requirements, I'm not sure https is supported for the ESP32. Could it be the 's' in L9?
Are any of the other WiFi functions returning valid detail after L7 but before L8? I ran into a situation a year ago and the others walked me through that.
EDIT: Had an Espruino Wifi lying around to check for memory size/usage. The second 'Code Testing' snippet, while it doesn't run without error (it does when I strip out L7-L13 -- callback missing perhaps?), doesn't appear to use but a quarter of available memory. So should be good for the ESP32
Did a quick sanity test using the first example at Connecting to an AP as run time errors occurred using the above snippet, and that ran without fail. Maybe the subtle code line differences will assist in locating the error in your particular case.
EDIT: Remove L7 and it works on an Espruino Wifi
But, look at the usage
My S.W.A.G. guess is that the ESP32 doesn't have sufficient memory with less than ~400JsVars remaining for Espruino housekeeping. The Wifi has nearly three times. Maybe build a custom .hex to flash?
Posted at 2019-12-21 by @allObjects Getting ip address may need to be done with a callback... at least that was the case a while back under certain circumstances (independent processors... not like Espruino on ESP8266... and it may be the same in ESP32... (w/ Espruino on ESP8266 I have not much experience, w/ ESP32 none so far, and with Espruino paired w/ ESP8266 / CC3000 some). - Just looked Put your (active) stuff into 'the'
Recommended code beginning w/ line 6 is something like that to catch errors (see https://www.espruino.com/Reference#l_Wifi_connect ):
You may think of an app watch dog to retry - deferred - what ever brings your app down or does not get it started... Did you consult forum conversation http://forum.espruino.com/conversations/313576/ - HTTPS on ESP32? ...and yep, if your app eats away too much vars, that may be the problem... Posted at 2019-12-21 by maze1980 https is not working on 2.04 You have to build your own version, using less jsvars. However no details on how much to reduce the variables. See also: espruino/Espruino#1613 I'll make a custom build, sooner or later, maybe end of this year. (Without the graphics library, without telnet and without ota.). And, if necessary for https, less jsvars. Posted at 2019-12-21 by Robin Sat 2019.12.21 Nice find @maze1980
Starting to look like at least ~500-600 JsVars a good place to start. My S.W.A.G. response. @Pinnchus take a looksy at the Feb 12, 2019 post by @wilberforce in the above link. Then in 2v01, 2300 JsVars were used, which as you'll realize is beyond the available memory for the device you are working with. :-( Posted at 2019-12-23 by Pinnchus Thanks.... Posted at 2019-12-23 by Pinnchus Thanks for the answers, will try to compile with less jsvars. Posted at 2019-12-23 by Pinnchus 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. Posted at 2019-12-23 by @MaBecker Well, if you can build your own firmware and do not need a filesystem than remove it https://github.com/espruino/Espruino/blob/master/boards/ESP32.py#L34 Posted at 2019-12-24 by Robin Mon 2019.12.23
My belief is that the understanding of what a JsVar really is, is well, . . . misunderstood. From L2, the available memory 267 free blocks is an indication here as the board started with 2300 originally. As @MaBecker is pointing out, it will be necessary to remove those sections of un-necessary code to allow the compiler to build a version that takes up less memory, than the one currently at release. Posted at 2019-12-24 by AkosLukacs Or try removing bluetooth, if you don't use it. The buffer allocated to bluetooth is roughly 2000jsVars, so a pretty big one. Posted at 2020-01-08 by hungryforcodes HTTPS has been broken for ages no? -- since moving to recent versions of the ESP-IDF. The problem appears to be a lack of available heap memory. Either way there is an open github ticket still for it. Would be great if it worked -- I'd dig out my ESP32s again. -hfc Posted at 2020-01-12 by hungryforcodes Just as an after thought -- the issue might clear up if using a WROOM module with PSRAM. I believe in theory Espruino was updated to support it. The extra memory might be recognized and allocated correctly when doing TLS requests. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-20 by Pinnchus
Hello everybody,
I tried with different versions of firmware (2.04) and have every time the same issue:
Code Testing:
Full Error:
Any help will be appreciated
Regards, pinnchus
Beta Was this translation helpful? Give feedback.
All reactions