Update specific Notecards part of a Notehub project to a specific firmware file, and record the update information in the device comments to act as a firmware update log.
-
Obtain a Notehub API session token
-
Obtain the Notehub Project UID (
app:xxxxxx-xxxx-xxxx-xxxx-xxxxxxx) -
Determine the firmware type (
cardoruser) -
Determine the name of the file to update to (
notecard-x.y.z$20240202111213.bin) -
Determine which Notecards to update by the device UID (
dev:xxxxxxxxxxxxxxxx) -
Navigate to the folder where the
firmwareUpdateutility is installed -
Create a folder to store any generated log files
>> mkdir .logs -
Activate the Python Virtual environment
>> .venv/Scripts/activate -
Enter the following at the system command prompt
python main.py -t <user-token> -p <project-uid> -f <firmware-file-name> -w <card or user> -d <device-uid-1> <device-uid-2> <device-uid-3> --dryrun
Include the
--dryrunflag to test the procedure without actually requesting the update to the device. To enable the update, remove the--dryrunflag -
Wait
The process will print out a JSON formatted report of all of the devices updated.
To see this list of available options, enter
>> python main.py --helpWhen a firmware file is uploaded to Notehub, the file name is amended with a timestamp.
You must use the name of the file created by the upload process, and that includes the timestamp.
To see what files are available in your Notehub Project select Settings > Firmware in the Notehub project.
Here you can view both user defined and Notecard firmware files
card |
or | user |
|---|
It's important to select the appropriate firmware type to be either user or card.
The default is user, so it will attempt to pass the firmware file to the host MCU connected to the Notecard.
Selecting card is required to update the Notecard's own firmware.
- Python 3.11
- Pip package manager
Check requirements.txt
-
Download the folder containing this readme
-
In the downloaded location, create a Python virtual environment
python -m venv .venv
-
Activate the virtual environment
>> .venv/Scripts/activate -
Install the required packages
pip install -r requirements.txt