Skip to content

ssizebra/OTAUpdate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTAUpdate

OTAUpdate is a Library to perform Over-The-Air Updates of your LinkIt ONE. The library can be used to check for firmware updates and install them remotely into the flash of the board.

The update check and download is performed using HTTP connections with the included GPRS Module.

To use the OTA feature, you have to build the examples/OTA.ino sketch (or use the precompiled version in extras/b_OTA.cpp.vxp) and copy it to OTA\b_OTA.cpp.vxp on the internal flash of the LinkIt ONE.

The Library will download the update.md5 and update.vxp file at the configured location and check if the md5sum within the update fila and the installed firmware differ. If the are not the same, the updater in OTA\b_OTA.vxp.cpp will be started to update the firmware.

Example application using the update manager

#include <OTAUpdate.h>
#include <OTAUtils.h>

#include <LStorage.h>
#include <LFlash.h>
#include <LGPRSClient.h>
#include <LGPRS.h>

void setup() {
  Serial.begin(9600);

  while (!Serial.available()) {
    delay(100);
    Serial.printf("\rpress any key to start...");
  }
  Serial.printf("\r\nstarted...\r\n");
  Serial.printf("init gprs... \r\n");
  while (!LGPRS.attachGPRS()) {
    delay(500);
  }

  OTAUpdate.begin("<host or ip>", "<path>");
}

void loop() {
  // put update.md5 and update.vxp files into OTA folder...
  while (true) {
    if (OTAUpdate.checkUpdate()) {
      OTAUpdate.startUpdate();
    }

    delay(10000);
  }
}

TODO

  • use proper HTTP 1.1 download and parse HTTP headers
  • implement RSA signature to verify integrity

About

Over-The-Air Updater for the LinkIt ONE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 88.4%
  • Other 6.6%
  • C 5.0%