-
Notifications
You must be signed in to change notification settings - Fork 31
Various Console Commands
Eric Berseth edited this page Mar 18, 2022
·
1 revision
$ export DEVICE_ID=<device id>
$ export PRODUCT_ID=<product id>
$ particle call $DEVICE_ID cmd '{"cmd":"get_cfg"}' --product $PRODUCT_ID
Copy and paste the desired command into the 'cmd' function on the console web page.
The advantage of using curl versus other methods is that the command can be queued by the config service and issued when sleepy devices come online.
This particular config service API will accept the configuration parameters stripped of the {"cmd":"set_cfg","cfg":
prefix.
The general form is:
$ curl -X PUT <URL> -H <content type> -d <cfg command>
$ export DEVICE_ID=<device id>
$ export PRODUCT_ID=<product id>
$ export TOK=<access token>
$ curl -X PUT https://api.particle.io/v1/products/$PRODUCT_ID/config/$DEVICE_ID\?access_token\=$TOK -H "Content-Type: application/json" -d '{"imu_trig":{"motion":"high"}}'
To get the config service oriented version of device configuration:
$ curl -X GET https://api.particle.io/v1/products/$PRODUCT_ID/config/$DEVICE_ID\?access_token\=$TOK -H "Content-Type: application/json" | jq
https://docs.particle.io/reference/device-cloud/api/#configuration
Reset the device
{"cmd":"reset"}
Get all configuration objects in the device
{"cmd":"get_cfg"}
Perform a factory reset for configuration
{"cmd":"reset_to_factory"}
Get the current location
{"cmd":"get_loc"}
Enter shipping mode
{"cmd":"enter_shipping"}