Skip to content
Get SDK Access

Firmware Update Example (Python)

This is a small Python script that connects to an RCSP server, subscribes to the UpdateFwEvents publisher, and runs an UpdateFirmware flow against the first connected device (or a device you pick with --device-id). It is the companion script for the Firmware updates guide.

The flow is:

  1. Open a TCP socket to the RCSP server (default localhost:45451).
  2. (If no --device-id is given) ListDevices and pick the first one.
  3. Subscribe to the UpdateFwEvents publisher.
  4. Send UpdateFirmware — this returns Ok only when the update finishes; progress is reported through events along the way.
  5. Read events until we see Done or Failure.
  6. Unsubscribe.

The full script is available in the SDK’s examples/python folder as rcsp_fw_update_example.py.

To run the script, navigate to $ROKOKO_SDK_HOME/examples/python in a terminal, and execute:

Terminal window
python3 rcsp_fw_update_example.py --host localhost path/to/firmware.bin