Mobius OTA - description
# clone it
git clone https://github.com/sistechai/mobius-ota.git
cd mobius-otanpm install or yarncp .env.example .env# start server
npm run dev or yarn devServer listening on http://127.0.0.1:7580, in development mode
npm run build or yarn build1. @route GET /fw/:aeid/version
2. @route GET /fw/:aeid/:version/size
3. @route GET /fw/:aeid/:version/download
4. @route GET /fw/:aeid/:version/data/block?seq=:k
5. @route POST /fw/:aeid/rawfile/**
* This function responding with the firmware version as character string
* @route GET /fw/:aeid/version
* @param { string } aeid.required - Application Entity ID
*/curl -X GET http://127.0.0.1:7580/fw/:aeid/version -iIt will return something like:
HTTP/1.1 200 OK
...
version/**
* This function responding with the firmware file size
* @route GET /fw/:aeid/:version/size
* @param { string } aeid.required - Application Entity ID
* @param { string } version.required - Firmware version
*/curl -X GET http://127.0.0.1:7580/fw/:aeid/:version/size -iIt will return something like:
HTTP/1.1 200 OK
...
size/**
* This function responding with the firmware file
* @route GET /fw/:aeid/:version/download
* @param { string } aeid.required - Application Entity ID
* @param { string } version.required - Firmware version
*/curl -X GET http://127.0.0.1:7580/fw/:aeid/:version/download -iIt will return something like:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: Size
...
file/**
* This function responding with the file contents of the k-th block of the firmware file
* @route GET /fw/:aeid/:version/data/block
* @param { string } aeid.required - Application Entity ID
* @param { string } version.required - Firmware version
* @param { string } seq.query.required - k-th block
*/curl -X GET "http://127.0.0.1:7580/fw/:aeid/:version/data/block?seq=:k" -iIt will return something like:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=fragment:k
Access-Control-Expose-Headers: Is-Next, Seq
Content-Length: BufferSize
Seq: k
...
buffer/**
* This function saving the uploaded file into a data folder with the filename provided
* @route POST /fw/:aeid/rawfile
* @param { string } aeid.required - Application Entity ID
* @property { file } file.required - Raw data file
*/curl -X POST http://127.0.0.1:7580/fw/:aeid/rawfile -F "file=@data.log" -iIt will return something like:
HTTP/1.1 200 OK
...
{"message":"Successfully uploaded!"}