1) The document discusses over-the-air (OTA) firmware upgrades for internet of things (IoT) devices using JFrog Bintray.
2) It describes the limited capabilities of typical IoT devices and challenges of upgrading their firmware.
3) It presents PlatformIO as an open source ecosystem that can be used to develop IoT firmware and JFrog Bintray as a universal distribution platform that can manage IoT firmware updates at scale through a REST API.
1 of 16
More Related Content
swampUP: Over-The-Air (OTA) firmware upgrades for Internet of Things devices with PlatformIO and JFrog Bintray
1. Copyright @ 2018 JFrog, PlatformIO - All rights reserved
Over-The-Air (OTA)
firmware upgrades for
Internet of Things devices
with JFrog Bintray
Dr. Ivan Kravets, CEO at PlatformIO
2. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
IoT Devices
30 billion devices by 2020 (wiki)
¢ Smart homes
¢ Smart cities
¢ Smart grids
¢ Virtual power plants
¢ Intelligent transportation
¢ ...
3. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
What¨s Inside?
Copyright ? 2018 JFrog, PlatformIO. All Rights Reserved
4. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
¢ Limited CPU ( ~100MHz )
¢ Limited RAM ( ~256KB )
¢ Limited Flash ( ~1MB)
¢ Limited communication bandwidth
¢ Limited TLS support
¢ Limited power supply resources
Average constrained device
Limited processing and storage capabilities
5. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Flash Map
Fixed User Application (No OTA)
Boot (optional) Application EEPROM SPIFFS
To upgrade the application, you reprogram it
6. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
¢ Open source, Apache 2.0 license
¢ Zero dependency, written in pure Python
¢ Rich command line interface (CLI)
¢ Use your favorite IDE or OS
¢ Multi-platform build system
¢ Automatic toolchain and library management
¢ Built-in support for CI / CD
¢ ^1-click ̄ debugging
¢ Run unit test on a remote IoT device
How to program IoT device?
PlatformIO: an open source ecosystem for IoT development
7. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Flash Map
Fixed User Application (No OTA)
Boot (optional) Application EEPROM SPIFFS
Upgradable User Application (OTA)
Boot OTA State Application Application* EEPROM SPIFFS
OTA needs 2 partitions to upgrade safely
8. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
¢ Free For Open Source
¢ 100% Automated via REST API
¢ Custom attributes per release
¢ Super fast CDN, don¨t worry about continents!
¢ Full Control and Security
¢ Unlimited number of IoT devices
¢ Bulk upgrades
¢ Release provisioning and analytics
How to manage IoT updates?
JFrog Bintray: Universal Distribution Platform
9. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Flash Map
Fixed User Application (No OTA)
Boot (optional) Application EEPROM SPIFFS
Upgradable User Application (OTA)
Boot OTA State Application Application* EEPROM SPIFFS
Bintray API
10. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Build
(compile firmware)
Local Test
(native, host OS)
Remote Test
(on a physical remote device)
Delivery
(publish firmware)
CI / CD
Over-The-Air Firmware Upgrades Workflow
Smart homes Smart cities Smart grids Virtual power plants Intelligent transportation
11. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Demo
Copyright ? 2018 JFrog, PlatformIO. All Rights Reserved
https://github.com/platformio/bintray-secure-ota.git
12. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Secure Bintray Client
C++ open source library by PlatformIO
#include <BintrayClient.h>
const BintrayClient bintray(
BINTRAY_USER,
BINTRAY_REPO,
BINTRAY_PACKAGE
);
const String version = bintray.getLatestVersion();
const String firmwarePath = bintray.getBinaryPath(version);
// download & flash image...
13. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Initial configuration
platformio.ini
; Please navigate to https://bintray.com/, create an account,
; repository, and add a package where PlatformIO will deploy firmwares
; api_token = Bintray.com > Edit Profile > API Key
[bintray]
user = ivankravets
repository = platformio-ota
package = bintray-secure-ota
api_token = ${env.BINTRAY_API_TOKEN}
; Wi-Fi network settings
[wifi]
ssid = ${env.PIO_WIFI_SSID}
password = ${env.PIO_WIFI_PASSWORD}
[common]
; firmware version, please modify it between releases; positive integer value
release_version = 1
14. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
Unit Testing
Local & Remote
#include <unity.h>
void test_bintray_binary_path_is_valid(void) {
const String binaryPath = bintray.getBinaryPath(bintray.getLatestVersion());
TEST_ASSERT_TRUE(binaryPath.length() > 0);
TEST_ASSERT_TRUE(binaryPath.endsWith(".bin"));
TEST_ASSERT_TRUE(binaryPath.indexOf(BINTRAY_USER) > 0);
}
// ...
void setup() {
UNITY_BEGIN();
RUN_TEST(test_bintray_client_credentials);
RUN_TEST(test_wifi_connection);
RUN_TEST(test_bintray_binary_path_is_valid);
// ...
UNITY_END();
}
15. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
CI/CD Pipeline
Automated firmware delivery: any OS, any CI service
install:
- pip install -U platformio
- platformio upgrade --dev
- platformio update
script:
# Check compiler errors
- platformio run
# List remote devices
- platformio remote device list
# Run embedded test on a remote device
- platformio remote test -r
deploy:
provider: script
script: platformio run -e release -t upload
16. Copyright @ 2018 JFrog, PlatformIO - All rights reserved. Ribbit with us: #swampUP
THANK YOU!