Cli credentials --file option change in behaviour

Hi there :wave:

We had been using the v3.18.1 version of the cli for our production programming of Argon devices. During this we load several sets of WiFi credentials on using the particle serial wifi --file credentials.json command.
While updating firmware at our production facility cli v3.21.0 was installed, and the command for loading the credentials from a file has changed in it's behaviour and is preventing us from loading the sets of credentials, we can only seem to load the credentials for the WiFi at our production facilty as it looks to be doing some sort of scan now when loading rather than just loading the credentails.

This is causing us production problems, can the behaviour be reverted to the way it worked in v3.18.1?

It is not simple to roll back the cli version.

Hi Gary,

What OS version are you in?

DeviceOS 5.6.0

Unfortunately the new CLI behavior is unlikely to change. On Gen 3 and later devices, the Particle CLI now uses a USB control request to handle particle serial wifiwhich makes the behavior consistent with the web-based setup. However the main reason is that removing the USB CDC serial listening mode commands freed up space in the system part that was necessary for features in Device OS 6.0 so the old method will not be usable in the future.

The Argon (also the P2, Photon 2, and M-SoM) verify that the credentials specified by control request are valid before saving them. This is part of Device OS and has been the case on all versions.

In theory an optional parameter could be added to allow saving of credentials without verification, but this would be a change in Device OS, particle-usb, protobufs, and particle-cli and it's not currently a planned change.

CLI version 3.22.0 has been released that reverts the behavior back to using CDC serial configuration on Gen 3 devices temporarily so you can configure Wi-Fi credentials that are not available at your current location.

Eventually the control requests will be modified to allow off-line configuration but for now this should unblock your setup scenario.

1 Like