-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best place to store AWS IoT client private_key+certificate? #5860
Comments
|
Tasmota currently uses all flash space made available by the Arduino core library within a 1MB image. As flash is accessesed in 4k chunks minimal this leads to Image flash adresses from 00xxx to FFxxx. To serve OTA images as large as possible it temporarly moves the settings area to location FB000 used by the Arduino core library for EEPROM data. Pages FC to FF are being used by the SDK. If you make a dump of the flash area from FC to FF (4 pages) you'll noticed that a lot of space doesn't seem to be used. If you are adventurous you could try to use 1k5 of a 4k SDK page for the TLS private Key and certificate. Accessing page FC is probably problematic as the Arduino core library simulates this page with dedicated settings. You might want to try page FF which only seems to use the first 32 bytes... Any other flash location would reduce OTA file. |
Thanks @arendst |
@arendst Thanks for the excellent suggestion. I tried using page FF and it works like a charm. I'm storing the credentials (~800 bytes) from location 0x402FF400 to 0x402FF7FF. |
Apologies if it’s the wrong place to discuss a development question.
I’m reviving an old topic: connecting Tasmota to AWS IoT for remote MQTT, and still using Web/Hue Emulation.
I've been working on it for the last weeks and I have a working prototype using as low 6.3KB of heap memory in nominal state (+ 1KB of stack), and an additional transient 8.0KB during TLS handshake (connect or reconnect). TLS handshake takes 1.3s at 80MHz or 0.7s at 160MHz.
Here is my question:
Each device needs to have a distinct TLS Private Key and Certificate. They can be in string (PEM) format but would ideally be stored as binary format to spare some decoding code. Size is ~1.5KB. What would be the best option to store them?
For the curious:
For the curious, here are some implementation details about memory optimization.
It is now possible to have both Web/Hue and TLS because of the following (see #2031)
Even if BearSSL use little memory, the stock WifiSecureClient takes at least 18KB of heap.
I was able to aggressively reduce the memory requirements:
The text was updated successfully, but these errors were encountered: