Skip to content
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

Support for OTA updates for sensor #18

Open
zen opened this issue Dec 30, 2016 · 2 comments
Open

Support for OTA updates for sensor #18

zen opened this issue Dec 30, 2016 · 2 comments
Assignees

Comments

@zen
Copy link
Member

zen commented Dec 30, 2016

EnviroMonitorSensor has an ability to update firmware over-the-air. For this to work we need support on backend side.
From sensor perspective it's pretty straightforward - it sends GET request to server and downloads firmware binary file.
Sensor will send following request to the server:
sensor_id=XXX&token=XXX&hw_ver=XXX&sw_ver=XXX
Server should analyse this data and decide whether there is a new firmware available. If there is on, it should be send over HTTP.
What is needed on backend side:

  • admin interface to set hw_version and sw_version for every sensor
  • API interface to set hw_version and sw_version - it should be send from sensor with every request and updated on the backend side
  • admin interface to upload new firmwares and set properties: hw_version, sw_version, devel (bool), active (bool)

Additional logic for backend to decide whether there is a new firmware: every hw_version should have separate line of firmware, in each hw_version - compatible sw_versions should use semver naming, availability of new firmware is based on semver versioning.
Sensors can also request devel type of firmware (not stable) with devel=true

@zen
Copy link
Member Author

zen commented Dec 30, 2016

#18

@lechup
Copy link
Contributor

lechup commented Feb 27, 2017

For now I would use same token / auth logic as for add-metering endpoint (we can abstract some code to keep DRY'iness).

So I would suggest /api/v1/station/station-slug/ota-update endpoint and follow detailed_route pattern like here:
https://github.com/EnviroMonitor/EnviroMonitorWeb/blob/master/api/views.py#L29

@grillazz grillazz self-assigned this Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants