-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Added node API to allow in place firmware uprade #2606
Comments
I'd rather not keep around both then, no? |
What happens when power fails during unpack? Some fallback? Or stuck in-the-middle with required repair with PC? |
Hint for anyone interested in OTA... A Mongoose architect wrote an eye-opening (for me) article about things to consider if you want to do OTA reliably: https://www.embedded.com/design/prototyping-and-development/4443082/Updating-firmware-reliably |
Yuri,I have been doing this crap for decades, so I am not about to start making beginners mistakes 😄 Have a review of the LFS code, for example. Your Qs are entirely valid, but I have also already discussed and addressed most of these points. The one failure mode that we would be vulnerable to using is that the new firmware image isn't functional, and this could be mitigated in a number of ways and we should certainly discuss and agree which is the most appropriate.
|
Thanks Marcel, this is a good into for the sort of issues that you need to address, but nothing new for me in this case. Yes, this sort of stuff is complicated but it is not new to IoT devices. Just remember that the guys who wrote the S/W for the Apollo programme computers had less total processing capacity on the Command Module and LEM than in a single ESP826, but they still faced the same sorts of issues. I would ask all reviewers to focus on specific functional issues at this stage, and accept that the implementers are competent at the basic technologies. An example of a functional issue here is the implementation of reversion images, do we:
Also even if we do facilitate image automated image reversion, establishing a simple and robust algo for triggering this isn't easy. |
I know 😉 |
Having a rollback scenario would be nice indeed but beggers are not choosers. If we have the ability to upgrade forward reliably, I'd be happy with that. Support for rollback could be a subsequent enhancement. Presumably the "new" build has been tested at length before being deployed. |
Done in SDK 3.0 tranche 2 update. |
Not sure why I closed this one. It wasn't part of SDK 3.0 tranche 2 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Don't even think about that, 'stale bot' |
@KT819GM Modestas, in the current environment and developer resourcing, I can't see us getting around to this so I don't think it sensible to leave an aspirational issue open. Feel free to reopen it if you can identify a realistic development resource. |
Missing feature
(This FR replaces #1496.) At the moment there is no facility for remote upgrade of the Lua Firmware.
Justification
Currently Lua applications can be field upgraded by updating the SPIFFS and LFS. However there is no functionality on the ESP8266 to similarly upgrade the firmware, so we can't update libraries or introduce new firmware functionality. We should provide Lua developers with the ability to remotely upgrade firmware on ESP8266 devices.
There are broadly two approaches to implementing this functionality.
Workarounds
Devices must be upgraded by a field visit.
Proposed Approach
My suggested functionally the same approach as with LFS reload, only by moving the code into a pre_load stub, there is nothing preventing this also being used to load the firmware itself.
node
API call to communicate context to the bootstrap.uzlib/inflate.c
and somelua/lfash.c
functions as well as a cut-down version of SPIFFS readonly, so this isn't a small piece of work.If we go to this approach then I suggest that we move the LFS reflash into this pre-init and unify the two lots of code. The main reason that I would like to do this is that the LFS deflate format is differs from RFC 1951 in one annoying aspect: The RFC stipulates a 32Kb dictionary and on top of this I need another 3 × 2Kb buffers and I can't guarantee that I can map these at our current entry point so I have dropped the dictionary size back down to a non-standard 16Kb. This means that whilst you can use the standard inflate (gzip) library and utilities host-side to inflate LFS images, I can't use the same standard deflate libraries as these will use a 32Kb dictionary which craters as runtime.
I have though of using alternative approaches such as switching to a 16Kb ICACHE for the LFS unpack as this would release another 16Kb of RAM buffers for the dictionary. But more though on this is needed.
The text was updated successfully, but these errors were encountered: