Notehub API Requests for DFU
Along with using the Notehub UI to manage firmware releases, the Notehub API provides methods for initiating and monitoring both Notecard and host MCU firmware updates.
Get Available Firmware
The Get Available Firmware API allows you to retrieve information about available host and Notecard firmware binaries.
For example, to retrieve host firmware binaries, you would issue this request:
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/firmware?firmwareType=host'
-H 'Authorization: Bearer <access_token>'
The response includes an array with information from the available firmware binaries:
[
{
"filename": "notecard-wl-7.2.2.16518$20240410043100.bin",
"version": "notecard-wl-7.2.2",
"MD5": "8c1f7737a134f108dab02ec6d6b4bf25",
"organization": "Blues Wireless",
"type": "notecard",
"created": "1712780230",
"target": "wl"
},
...
]
Create DFU Action
Once you know which firmware binaries are available, you can use the Create DFU Action API to update (or cancel) host MCU and/or Notecard firmware updates.
The following example will initiate a Notecard firmware update for relevant devices in the selected project:
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/dfu/notecard/update'
-H 'Authorization: Bearer <access_token>'
-d '{"filename":"notecard-u5-8.1.3.17044$20241220135610.bin"}'
Get Device DFU Status
Once a host or Notecard firmware update is initiated, you may use the Get Device DFU Status API or Get Devices DFU Status API to get updated information on the current status of the DFU request for a single device or multiple devices, respectively.
For example, the following request will return Notecard firmware update status information for an individual device:
curl -X GET
-L '/v1/projects/<projectUID>/devices/<deviceUID>/dfu/notecard/status'
-H 'Authorization: Bearer <access_token>'
The response:
{
"device_uid": "dev:000000000000000",
"dfu_in_progress": true,
"current": {
"version": "1.5.3.12345",
"organization": "Blues Wireless",
"product": "Notecard",
"built": "Mar 23 2021 08:31:26"
},
"status": {}
}
Get Device DFU History
To retrieve a comprehensive history of host and/or Notecard DFU actions, you may use the Get Device DFU History API or Get Devices DFU History API for a single device or multiple devices, respectively.
For example, the following request will return a history of Notecard firmware updates for an individual device:
curl -X GET
-L '/v1/projects/<projectUID>/devices/<deviceUID>/dfu/notecard/history'
-H 'Authorization: Bearer <access_token>'
The response:
{
"device_uid": "dev:000000000000000",
"current": {
"version": "1.5.3.12345",
"organization": "Blues Wireless",
"product": "Notecard",
"built": "Feb 19 2021 13:45:28"
},
}