Our command line library enables you to use almost all of the features of our API directly from a terminal. But some debug features, such as the creation of a dump of the state of the Yoctopuce modules, were not available. This week, we present two new commands which could help you if your modules are not working correctly.
The first improvement is the addition of commands which enable you to unlock a module stuck in the "update" mode.
Unlocking modules which are in "update" mode
The module "update" mode is a particular state which a module goes through while its firmware is being updated. In this mode, the module is not detected anymore by traditional functions of the library and it answers only to reprogramming packages.
Usually, a module stays in this state for only a few tens of seconds and switches back to the standard mode. But if a problem occurs during the update, such as a power outage, the module can stay locked in this mode.
The get_allBootloaders command enables you to display the serial numbers of the modules in the "update" mode and the downloadAndUpdate enables you to restart the firmware update.
In the following example, we have two modules which are in the "update" mode. As you can see, both modules are not listed in the inventory anymore, but the new command get_allBootloaders detects them:
ERR: No module found
To get these two modules out of the "update" mode, we must restart their firmware update. To do so, we use the downloadAndUpdate command by prefixing it with the serial number of the module which is locked in "update" mode. Note that this command works with any module, whether it is in "update" mode or not.
ok: Update firmware of device LIGHTMK3-17F0AF.
ok: with firmware http://www.yoctopuce.com/FR/downloads/LIGHTMK3.48245.byn.
ok: 0% Firmware update started.
ok: 36% Device info retrieved.
ok: 39% Flash zone.
ok: 51% Flash zone.
ok: 63% Flash zone.
ok: 75% Flash zone.
ok: 79% Device info retrieved.
ok: 90% Firmware updated.
ok: 100% success.
ok: 100% Firmware Updated Successfully in 10.650000.
ok: Yocto-Light-V3 LIGHTMK3-17F0AF(rev=48245) is up to date.
ok: 0 / 0 hubs in 0.000000s.
ok: 0 / 0 shields in 0.000000s.
ok: 1 / 1 devices in 0.088000s 0.088000s per device.
ok: 1 / 1 bootloaders in 10.748000s 10.748000s per bootloaders.
ok: All devices are now up to date.
When the update has succeeded, the inventory shows the module again.
Get Debug Info
Like what we did in the VirtualHub some time ago, we added a showDebugInformation command which enables you to dump the state of all the modules which are connected.
This function is very useful if you need to contact support. Indeed, when customers contact us for support questions, most of the time we are missing information, such as the firmware version, the module logs, the value of some parameters, and so on.
This command retrieves all the useful information and displays it in the Markdown format.
Concretely, this command dumps the following information:
- The list of all the detected modules
- The list of all modules in the "update" mode
- The value of all the parameters of all the modules (without passwords)
- The logs of all the modules
- The list of all the files uploaded on the modules, but not their content
- The content of potential core dumps of the YoctoHubs
By default, the report is displayed on the standard output, but you can also specify an output file with the "-o" option:
OK: output saved in file debuginfo.md
You can then send the debuginfo.md file to support with a clear description of the issue.
These small additions are especially helpful for headless machines on which you intervene remotely, for example through an SSH connection. In this type of situation, it's not always possible for someone to physically go and see the state of the module. These improvements enable you to unlock some situations. If it's not the case, they will at least enable you to save some time while exchanging emails with support.