Skip to content

Latest commit

 

History

History
109 lines (86 loc) · 2.84 KB

File metadata and controls

109 lines (86 loc) · 2.84 KB

Fixposition Software Update

Command line software update support.

Python

This Python script uploads the software image to the system and then waits for the notification of success or failure of the flash process.

Dependencies

Usage

$ ./software_update.py -h
usage: software_update.py [-h] path ip timeout

positional arguments:
  path
  ip
  timeout

optional arguments:
  -h, --help  show this help message and exit

The software update process will take several minutes.

Example

$ python3 ./software_update.py image.swu 10.0.2.1 600
Start uploading image...

Software image uploaded successfully. Wait for installation to be finished...

Wait update finished
Software update successful !

Curl

The HTTP upload API can also be used directly with curl. In this case only the software image is uploaded and a response about success or failure of the flash process is not waited or checked.

Example (For software version 2.63 or newer - after 09.03.2023)

curl -v -F [email protected] http://10.0.2.1/update/upload
*   Trying 10.0.2.1:8080...
* TCP_NODELAY set
* Connected to 10.0.2.1 (10.0.2.1) port 80 (#0)
> POST /update/upload HTTP/1.1
> Host: 10.0.2.1
> User-Agent: curl/7.66.0
> Accept: */*
> Content-Length: 435603202
> Content-Type: multipart/form-data; boundary=------------------------5ee14ea9339300b5
> Expect: 100-continue
>
* Done waiting for 100-continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Mongoose/6.18
< Content-Type: text/plain
< Connection: close
<
Ok, image.swu - 435602944 bytes.

Example (For software version 2.58.2 or older - before 17.01.2023)

curl -v -F [email protected] http://10.0.2.1:8080/upload
*   Trying 10.0.2.1:8080...
* TCP_NODELAY set
* Connected to 10.0.2.1 (10.0.2.1) port 8080 (#0)
> POST /upload HTTP/1.1
> Host: 10.0.2.1:8080
> User-Agent: curl/7.66.0
> Accept: */*
> Content-Length: 435603202
> Content-Type: multipart/form-data; boundary=------------------------5ee14ea9339300b5
> Expect: 100-continue
>
* Done waiting for 100-continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Mongoose/6.18
< Content-Type: text/plain
< Connection: close
<
Ok, image.swu - 435602944 bytes.

License

software_update.py is licensed under GNU General Public License v3.0 or later - see the LICENSE file for details