Register & Update Device at Once
Learn how to register a device and deploy an update at the same time.
Last updated
Was this helpful?
Learn how to register a device and deploy an update at the same time.
Last updated
Was this helpful?
Registration and Update deployment is a common use-case that might be useful for several scenarios, for such cases we created a script by using our to register the device and deploy an update at the same time.
For example, If you would like to make sure that all devices registered to your fleet are automatically updated with the latest software, or, some kind of configuration that initiates after a successful factory reset.
Instead of registering the device via the installation command or a pre-made image, we will use a Python script on the device that will register and deploy an update to itself.
Prerequisites:
REST API enabled
Be familiar with our API and tokens - Overview
An is created and ready to deploy
Python3 is installed on the device.
requests library installed on the device
The script performs the following:
Registers the Device to Connect, according to the selected project
Deploying an update flow that was previously configured in the platform.
Even if the device is already registered, the update will still be deployed.
Instructions:
Take the code below and edit with the following configuration at the top:
USER_TOKEN - Your user token, can be taken from Settings > Account > Show User Token.
PROJECT_NAME - The name of the desired project that the device will be connected to.
UPDATE_FLOW_ID - ID of the desired flow to be deployed on the device, the flow must be a part of the project above.
2. Copy the script to the device
3. Choose when the script would run, some prefer having it running after the next power-on, while others initiate it with their on-device application.
Learn how to using projects, groups, and tags.