In the ZDM a device is a peripheral that can execute Zerynth bytecode. In order to do so a device must be prepared and customized with certain attributes. The main attributes of a device are:

  • uid a unique id provided by the ZDM with the device creation command
  • name a name given by the user to the device in order to identify it
  1. The first step to connect your device to the ZDM, once you are logged, is the device creation.
  2. Then you have to type the provision command

There also are commands to list your devices, to get a single device info, update a device

List of device commands:

The list of supported devices is available here

Device creation

To connect your device to the ZDM you must first create a new device on ZDM, to obtain a new device uid. The creation command is:

zdm device create name

where name is the name that you want to give to your new device

If you create your device using this command, it will be associated to your default fleet inside your default workspace. If you want, you can choose to associate the device to another fleet with the optional argument:

--fleet-id uid

If you want to associate the device to another fleet, see the update command

Device provisioning

To create a set of device credentials an existent device uid is needed.

The provisioning command is:

zdm device provision device_id --credentials ctype --endpoint_mode etype --output dest-folder

where device_id is the device uid, ctype is the credentials type (chosen from device_token or cloud_token), etype is the endpoint security mode (choosen from secure or insecure), and dest-folder is the path where to save the credential file (named zdevice.json).

All options are not mandatory and if not given a default value is assigned:

  • device_token for ctype
  • secure for etype
  • current directory for dest-folder

List devices

If you want to list all your devices, you can use this command to see a table with a device for each rows with the device uid, name and the uid of the fleet and workspace containing them. To see all your devices use the command:

zdm device all

Get device

To get a single device information, you can use this command to see the device name and the uid of the fleet and the workspace that contain the device.

zdm device get uid

where uid is the device uid.

Update a device

Once you’ve created a device, you can use this command to update the device name, or to change the fleet uid. To update a device you just need its uid as argument, then you can use optional arguments to update its name or fleet uid. Use the command:

zdm device update uid

And the optional arguments are:

  • --fleet-id uid the uid of the fleet you want to associate the device to
  • --name name the name you want to give to the device