-
• #2
Wed 2019.09.18
Hi @tcpipchip
This seems to be a continuation of content from this thread, am I correct?
http://forum.espruino.com/conversations/323658/?offset=50#comment14901112
See #64 in above thread, for Gordon's succinct position with ESP32 on this matter.
While @Gordon is focusing his skill set on Authentic Espruino boards, and his time is valuable, others might be able to assist. It would be nice to know the environment and available memory. Please post the results of
process.memory()
andprocess.env
for others to garner detail in your setup. -
• #3
Yes, i was on wrong topic, sorry!
I will post that values before to run the script that call routine with certificates
Sorry again! I have to make that work to put to in my AWS IOT book with ALEXA
-
• #4
| __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| 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 >Saving ca Saving key Saving cert Connecting to Wifi Connected... { "free": 2155, "usage": 145, "total": 2300, "history": 485, "gc": 0, "gctime": 2.03 } { "VERSION": "2v04", "GIT_COMMIT": "3956264e", "BOARD": "ESP32", "FLASH": 0, "RAM": 524288, "SERIAL": "a4cf1275-31c8", "CONSOLE": "Serial1", "MODULES": "Flash,Storage,heatshrink,fs,net,dgram,tls,http,NetworkJS,Wifi,TelnetServer,crypto,neopixel", "EXPTR": 1073484860 } Acessing AWS IOT Connecting... Uncaught InternalError: HTTPS init failed! mbedtls_x509_crt_parse of 'ca': Invalid format at line 75 col 10 }).end(); ^ in function called from system >
Source code
https://www.dropbox.com/s/3i0cig5pl9qtd7e/code.js?dl=0Let me know if runs in your ESP32
-
• #5
Confirming: Is the amount of free mem that after the entire upload of source code?
"free": 2155, "usage": 145
The usage seems to suggest that no certificate code has been uploaded?
-
• #6
@Robin the certificates end up in flash memory so won't use RAM.
You could try confirming that the certificates really are the same as you put in... eg:
oca == atob("MIIFgDCCA2gCCQD1KANs3obrTjANBgkqhkiG9w0BAQsFADCBgTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1BMQ8wDQYDVQQHEwZCb3N0b24xEzARBgNVBA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QsFAAOCAgEAS9mpX4QgnwntvH9wutY+zOWBLejd/psjjVmZdYzeVC6fkCaw0Qj1unszq58EHlA8275ARTYyicRHIYLF3ZDYwMxUCu7iIQJUzVYJRqowV2Ap4OeMlh5sUb/Wlmhs5TauSZ1gz4LqMqnGkVMrvvU+1WX2ePFl81nnr1UMb2+dLzC0Gj2jH3tlzW76yFD4gElR8W4ypgvAw9pFKlSuOc4y6KS32jaOJk9zWSigPQadI1pOSSk+iKuPp98BBY/gDw+FBKUNARo3ci5F2s1dJZwQSCnuBhVb1r+3aHjnp4PAO7Mq7YyFf7qwSmuA++nF7TGhu3lf3hY1Jzgo+rOi+pFZtebCsewLDJjyNUxhQkOIf4TutC9wPJUtCKDpLA0iJso1AX5297iap5g7y0J0fUls16U+F0arsBHhgIN5ARifImeE+1bVVx7kLtklA23njczUt88ylgsCEnYyu0U+0+kwAkMDyPWDd3KPfDhykhQJ0Ev/44+JTDk3zydO2YvCpqMqLuhbZr9mvmV7uzJVbFnLr3sU75upv0N4JQLIn3XyTtDbWjTqA8d6qbG5BxYL5xkrWRxo3Fd6r1AyFje1ilKUkwZ1YZZCDvgv/2uEFyL0VlgfHfBhNbN2nsTTxijKc19ROeIRXl7eqWq/cyIbA/5LzEy2UbbEhKIroPGosQML4sc=")
But as a start, since you have the RAM on ESP32, maybe ignore all the flash storage stuff for now. Just remove
fwrite
and set the variables directly to the result of running atob.... also use the certificates that I used in the example rather than making your own - for now.
-
• #7
I did the changes suggested team!
looks memory problem!____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| 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 >Connecting to Wifi ERROR: Wifi: event_handler STA_START: esp_wifi_connect: 12298(SSID is invalid) Connected... { "free": 1964, "usage": 336, "total": 2300, "history": 495, "gc": 0, "gctime": 1.864 } { "VERSION": "2v04", "GIT_COMMIT": "3956264e", "BOARD": "ESP32", "FLASH": 0, "RAM": 524288, "SERIAL": "a4cf1275-31c8", "CONSOLE": "Serial1", "MODULES": "Flash,Storage,heatshrink,fs,net,dgram,tls,http,NetworkJS,Wifi,TelnetServer,crypto,neopixel", "EXPTR": 1073484860 } WARNING: Wifi:startMDNS - espressif ############################################## { "ip": "192.168.0.16", "netmask": "255.255.255.0", "gw": "192.168.0.1", "mac": "a4:cf:12:75:31:c8" } Acessing AWS IOT Connecting... Uncaught InternalError: Failed! mbedtls_ssl_setup: Not enough memory at line 35 col 10 }).end(); ^ in function called from system Acessing AWS IOT Connecting... Uncaught InternalError: Failed! mbedtls_ssl_setup: Not enough memory at line 35 col 10 }).end(); ^ in function called from system Disconnected >
Here the the software
https://www.dropbox.com/s/3i0cig5pl9qtd7e/code.js?dl=0
Gordon
I followed the instructions
http://www.espruino.com/Storing+HTTPS+Certificates
And make execute
https://www.dropbox.com/s/dj6fcj0039064bj/gordon.png?dl=0
But got always the same error during executing...
have you idea about ?
1 Attachment