Skip to content

Over the air MicroPython application update tool for ESP8266 type microcomputer. With this tool you can track and you can publish the changed files from your developer PC to your microchips via HTTP.

License

Notifications You must be signed in to change notification settings

pappz/ota-promoter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTA-promoter

Over the air MicroPython application update tool for ESP8266 type microcomputer.

With this tool you can track and you can publish the changed files from your developer PC to your microchips via HTTP.

Motivation

I designed this solution for decrease the testing-development period times during the MicroPython application development. In my personal cases I am not using or I can not using USB wire for upload the Python files to my devices during the development circles.

How does it work

The service registers some information about the promoted files.

  • file names and full path of it
  • generated unique hashes of the files
  • version hash code of the current state of the promoted files

This service is listening on HTTP and with inotify are watching the modifications in a specified folder. Every time has occur a changes it will update the version information from the files and it will generate a new version hash code. With an HTTP client can get the current version code and the list of the available files. Based on the hash code the HTTP client can download the modified files.

You can set a list of ignored file. Create a .promoterignore file in the root path of your Python source and in it you can set the list of the ignored files. The service can process reqular expressions.

API

Get current version code

Request

GET /files/version

Example Response

{"version":"8a841114726b9f327a6b94d6d129ec8588b5bdc7"}

Cmd line example

$ curl -v http://192.168.0.10:9090/files/version
{"version":"8a841114726b9f327a6b94d6d129ec8588b5bdc7"}

List of available files

Request

GET /files

Example Response

{
    "files": [
        {
            "path": "README.txt",
            "checksum": "96f264583956281570cc591158c9371f8bba3736"
        }
    ],
    "version": "8a841114726b9f327a6b94d6d129ec8588b5bdc7"
}

Cmd line example

$ curl  http://192.168.0.10:9090/files | python3 -m json.tool
{
    "files": [
        {
            "path": "README.txt",
            "checksum": "96f264583956281570cc591158c9371f8bba3736"
        }
    ],
    "version": "8a841114726b9f327a6b94d6d129ec8588b5bdc7"
}

Download file by hash

Request

GET /files/{file_hash}

Example Response

< HTTP/1.1 200 OK
< Content-Disposition: attachment; filename=powermgm.py
< Content-Length: 1078
< X-Target-Path: powermgm.py
< Date: Mon, 14 Nov 2022 18:38:37 GMT
< Content-Type: text/plain; charset=utf-8

Cmd line example

curl  http://192.168.0.10:9090/files/96f264583956281570cc591158c9371f8bba3736

Client side library

MicroPython lib

About

Over the air MicroPython application update tool for ESP8266 type microcomputer. With this tool you can track and you can publish the changed files from your developer PC to your microchips via HTTP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages