Insert a stub app that will check for work to be done, and if so do it. If no
work to be done, jump to original app.
Uploads, including password protected and signed, work through the IDE now.
DONE:
Replace boot.o with OTA.o (which will include the appropriate boot2)
Define area to store work to be done, format of work block
Add in R-O LittleFS code
Add in UZLIB compression lib
After upload erase work block and reboot
Make constants less magic in OTA code
Add simple file example
Add compressed example
Add mDNS for Arduino IDE OTA support
Add ArduinoOTA class on core and uploader Python script
Add checksum
Add Updater() to allow signed updates
Make uploads power fail safe!
Add docs
Insert a stub app that will check for work to be done, and if so do it. If no
work to be done, jump to original app.
Uploads, including password protected and signed, work through the IDE now.
DONE:
- [X] Replace boot.o with OTA.o (which will include the appropriate boot2)
- [X] Define area to store work to be done, format of work block
- [X] Add in R-O LittleFS code
- [X] Add in UZLIB compression lib
- [X] After upload erase work block and reboot
- [X] Make constants less magic in OTA code
- [X] Add simple file example
- [X] Add compressed example
- [X] Add mDNS for Arduino IDE OTA support
- [X] Add ArduinoOTA class on core and uploader Python script
- [X] Add checksum
- [X] Add Updater() to allow signed updates
- [X] Make uploads power fail safe!
- [X] Add docs
I'd rather stick w/an OpenSSL dependency. We ship our own Python3 for the Arduino IDE, and pulling in all the requirements to get a X509 signing module running would be a beast.
How would that requirement be set for P.IO?
I'd rather stick w/an OpenSSL dependency. We ship our own Python3 for the Arduino IDE, and pulling in all the requirements to get a X509 signing module running would be a beast.
How would that requirement be set for P.IO?
I wouldn't modify the dependency chain, just forward that responsibility to the user. PIO can also access all the program's in the user's PATH, so if they want signed OTA updates, PIO will just call into the same singing.py script and it will require openssl to be installed. The "standard" user won't turn on signing anyways. I could of course create a OpenSSL package make PlatformIO use it, but unless I get a feature request for that, I wouldn't start doing it.
If you want to use a Python module instead, I would have to modify the platform-raspberrypi code to install the needed dependencies. This is no problem, the official ESP-IDF PIO builder script does the same, and I've done it in my other platform too.
I wouldn't modify the dependency chain, just forward that responsibility to the user. PIO can also access all the program's in the user's `PATH`, so if they want signed OTA updates, PIO will just call into the same `singing.py` script and it will require `openssl` to be installed. The "standard" user won't turn on signing anyways. I could of course create a OpenSSL package make PlatformIO use it, but unless I get a feature request for that, I wouldn't start doing it.
If you want to use a Python module instead, I would have to modify the platform-raspberrypi code to install the needed dependencies. This is no problem, the [official ESP-IDF PIO builder script](https://github.com/platformio/platform-espressif32/blob/develop/builder/frameworks/espidf.py#L1044-L1084) does the same, and I've done it in my [other platform](https://github.com/maxgerhardt/platform-sonyspresense/blob/dc6a593a99cc21f3c373101608d9b561d565cf32/builder/main.py#L343-L366) too.
Ah, good. We'll go with letting the (rare) user who wants to sign make sure he has the tools to do so. It's in the documentation (not in this PR yet) as a requirement, and you'd generally run openssl to generate the public and private key anyways.
Ah, good. We'll go with letting the (rare) user who wants to sign make sure he has the tools to do so. It's in the documentation (not in this PR yet) as a requirement, and you'd generally run `openssl` to generate the public and private key anyways.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Insert a stub app that will check for work to be done, and if so do it. If no
work to be done, jump to original app.
Uploads, including password protected and signed, work through the IDE now.
DONE:
@@ -0,0 +21,4 @@"""Save the signed firmware to out_file (file path)."""signcmd = [ 'openssl', 'dgst', '-sha256', '-sign', priv_key ]proc = subprocess.Popen(signcmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)For people that want to use signed updates, we should declare the OpenSSL dependency somewhere or substitute with a Python library?
@@ -0,0 +21,4 @@"""Save the signed firmware to out_file (file path)."""signcmd = [ 'openssl', 'dgst', '-sha256', '-sign', priv_key ]proc = subprocess.Popen(signcmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)I'd rather stick w/an OpenSSL dependency. We ship our own Python3 for the Arduino IDE, and pulling in all the requirements to get a X509 signing module running would be a beast.
How would that requirement be set for P.IO?
@@ -0,0 +21,4 @@"""Save the signed firmware to out_file (file path)."""signcmd = [ 'openssl', 'dgst', '-sha256', '-sign', priv_key ]proc = subprocess.Popen(signcmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)I wouldn't modify the dependency chain, just forward that responsibility to the user. PIO can also access all the program's in the user's
PATH, so if they want signed OTA updates, PIO will just call into the samesinging.pyscript and it will requireopensslto be installed. The "standard" user won't turn on signing anyways. I could of course create a OpenSSL package make PlatformIO use it, but unless I get a feature request for that, I wouldn't start doing it.If you want to use a Python module instead, I would have to modify the platform-raspberrypi code to install the needed dependencies. This is no problem, the official ESP-IDF PIO builder script does the same, and I've done it in my other platform too.
@@ -0,0 +21,4 @@"""Save the signed firmware to out_file (file path)."""signcmd = [ 'openssl', 'dgst', '-sha256', '-sign', priv_key ]proc = subprocess.Popen(signcmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)Ah, good. We'll go with letting the (rare) user who wants to sign make sure he has the tools to do so. It's in the documentation (not in this PR yet) as a requirement, and you'd generally run
opensslto generate the public and private key anyways.