项目作者: imcatwhocode

项目描述 :
Sign your ArduinoOTA updates right in the Platform.io build system
高级语言: C++
项目地址: git://github.com/imcatwhocode/esp8266-platformio-signed-ota.git
创建时间: 2019-12-22T02:48:51Z
项目社区:https://github.com/imcatwhocode/esp8266-platformio-signed-ota

开源协议:MIT License

下载


Signed ArduinoOTA example for Platformio

Example repository with a small wrapper (“espota-signed”), which allows you to build & deploy signed OTA updates directly from Platform.io build system.
ArduinoOTA library documentation covers almost all you need to know, so check it out!

Currently, it works only on Unix, so this time Windows is not invited to the party.

I want to create my project with this wrapper, what I need to do?

I assume that you have already read ArduinoOTA documentation,
so you have a keyring and necessary configuration in code. If not — please read a related article and check my example in src/main.ino.

Copy “espota-signed” script into your project root, then add new environment into platformio.ini:

  1. [env:example-signed-ota]
  2. platform = espressif8266
  3. framework = arduino
  4. board = nodemcu
  5. upload_protocol = espota
  6. upload_port = 172.16.0.15
  7. upload_command = ./espota-signed --ota-sign-private private.key --upload-built-binary $SOURCE -i $UPLOAD_PORT $UPLOAD_FLAGS

Ensure that the path to your private key is correct and adjust other configuration parameters. Signing wrapper requires only specific upload_command, as in the example above.
You can change any other options, including the upload_flags parameter.

Never store your private key in a repository — it’ll be a massive pain in the ass in case of the leak. In production usage, you should keep your private key on the isolated machine or HSM.