Before shipping devices out to customers, we want to flash the latest deviceOS/firmware and then put the device into shipping mode.
For overseas customers who use the Tracker 523, the devices are unable to connect at our offices, so we are unable to run {“cmd”: “enter_shipping”} through the cloud.
Is there any way for us to get the device to power off over USB?
Yes, it is possible to go into shipping mode by USB. Unfortunately, there isn't an easy way to invoke it. There are a few tools like Device Restore USB from the docs web site that have an advanced checkbox to enter shipping mode after flashing, but the regular Particle CLI doesn't have that option.
It works by using a USB control request so it can be done using the particle-usb package from a node.js script fairly easily, but unfortunately it isn't built into any standard tools.
Thanks for pointing me to the device restore, I was able to locate the related code in the docs repo.
For anyone who might stumble onto this thread in the future, heres a code snippet using the particle-usb library:
const usb = require('particle-usb');
async function main() {
const devices = await usb.getDevices();
const device = devices[0];
await device.open();
const reqObj = {
cmd: 'enter_shipping'
};
await device.sendControlRequest(10, JSON.stringify(reqObj));
await device.close();
}
main()
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.