By default, all the simulated devices have a connection behavior configured in the corresponding profile that simulates if the device is always connected, disconnects at a scheduled rate, or have connection issues.
See profile connection-settings
.
But, the Digi IoT Device Simulator allows you to connect or disconnect a device at any time through the CLI using the connect
feature of the set
command.
Connect a device
If a simulated device is disconnected, you can connect it to the cloud using the connect
feature of the set
command and specifying yes
as parameter.
The full syntax of this operation is as follows:
simulator> set devices <device> connect yes
Where:
-
<device>
corresponds to the ID or name of the device to connect
This code connects the device with ID EE0D1E60-EE0EE001
:
simulator> set devices EE0D1E60-EE0EE001 connect yes
Disconnect a device
You can force the disconnection of a specific device through the CLI of the IoT Device Simulator using the connect
feature of the set
command and specifying no
as parameter.
In this case, the full syntax of the operation is as follows:
simulator> set devices <device> connect no
Where <device>
corresponds to the ID or name of the device to disconnect
For example, to disconnect the device with ID EE0D1E60-EE0EE001
, type the following line:
simulator> set devices EE0D1E60-EE0EE001 connect no