Skip to content
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

Remove redundant libraries (FirebaseJson and Crypto) #958

Merged
merged 2 commits into from
May 6, 2024

Conversation

schlimmchen
Copy link
Member

@schlimmchen schlimmchen commented May 5, 2024

The firmware for environments generic and generic_esp32 (and probably more) finally became too large, see #950.

This changeset removes the FirebaseJson and the rweather/Crypto libs from the build and implements the functionality they provided using existing libs. This saves nearly 20kB of flash memory. The firmware now works again on non-S3 ESP32.

Closes #950.

we used this library solely to interpret the answer of an HTTP web
server as JSON and find a particular value using a path expression in
the HTTP power meter implementation.

since we ran out of flash memory on non-S3 ESP32, we need to cut some
corners. removing FirebaseJson is the last low-hanging fruit that we
currently know of. we can get rid of it by using ArduinoJson (which is
already integral part of the firmware) and implementing a custom logic
to extract a value based on a path expression.

other than the FirebaseJson path "finder", the new implementation
only knows how to access sub-keys delimited by a forward slash. in
particular, accessing array members is not supported any more. I am
hoping that this is simply not an issue. if so, we will have users
complaining and we can add this functionality in a later release.
mbedtls is already integral part of the firmware. use it in favor of
rweather/Crypto library to calculate a sha256 checksum of a string, as
used in the HTTP power meter implementation.
@schlimmchen schlimmchen merged commit b7a8bdf into development May 6, 2024
10 checks passed
@schlimmchen schlimmchen deleted the remove-redundant-libs branch May 6, 2024 09:04
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot install Firmware 2024.05.03 via OTA --> [HTTP ERROR] Bad Request
1 participant