iot.cfg Reference
The iot.cfg file contains attribute-value pairs in JavaScript Object Notation (JSON) format that you can change to override the default device manager behavior.
On Linux devices, ensure that the user under which you run the device manager application owns the file.
The following table lists the attributes in the file and the valid values.
Attribute |
Description |
Valid Values |
---|---|---|
runtime_dir |
The base path of the upload and download directories used for file transfer if you do not specify a full path in the file_path box when you run the methods from Device Cloud. This value is not used if you specify a full path when you run the methods. Applies to the Python agent only. The C agent always uses /var/lib/iot as the base path. |
any directory on the device to which the device manager and read and write access Default: the directory named runtime relative to the location of the device manager application code |
log_level |
The types of logs that appear on the console. |
ERROR, WARNING, INFO, CRITICAL, DEBUG, ALL Python device manager default: DEBUG C device manager default: INFO |
actions_enabled |
The list of the device management methods the device manager supports. By default, all methods appear under the Methods tab for a thing. You can change the Boolean value for each action to prevent users from running the method. If you attempt to run a disabled method, the method output shows a failure message. For a description of each action, see Device Manager. |
For each method: true, false |
wait_for_file_transfer |
Specifies whether to block while waiting for the file transfer to complete or to return a result immediately to Device Cloud. Applies to the Python agent only. |
true, false Default: true |
download_timeout |
The maximum time in seconds to wait for a file download to complete. Applies to the Python agent only. |
any positive integer Default: 60 |
upload_remove_on_success |
Specifies whether the agent deletes the files in the directory if the files are retrieved successfully. All files in the directory are deleted, regardless of whether they were uploaded. Applies only to files in the upload directory. |
true, false Default: true |
upload_tar_file |
Specifies whether the agent uploads all files in a directory as a tar.gz file if you specify a directory on the Management Portal when you run the Retrieve Files method. Applies to the Python agent only. |
true, false Default: true |
thing_friendly_name |
Specifies a user-friendly thing name to show on the Management Portal. If the value None is specified, the thing name is derived from the thing key or the friendly name in the device manager code, if specified. Applies to the Python agent only. |
any valid string Default: None |
discover_services_on_init |
Specifies whether you can disable ports that are scanned on startup of the device manager. |
true, false Default: true |
remote_access_support |
An array of attributes that specifies the protocol name, port, and session timeouts the device manager supports for remote tunnel access to a device. The values in this attribute apply only if the remote_login action is enabled in the actions_enabled object. Applies to the Python agent only. For more information about remote access, see the Device Cloud Remote Access User's Guide. |
Valid values for the name attribute: Telnet, SSH, VNC, RDP. Other protocols that appear in the default configuration are for future use. Valid values for the port attribute are any well-known port on the device. Only ports that are listening are advertised to Device Cloud. The optional session_timeout attribute is specified in minutes and the maximum value is 1440 minutes (24 hours). |
This example shows the default configuration file for the Python device manager.
{
"runtime_dir":"runtime",
"log_level": "DEBUG",
"actions_enabled":{
"shutdown_device":true,
"reboot_device":true,
"reset_agent":true,
"file_transfers":true,
"software_update": true,
"decommission_device":true,
"remote_login":true
},
"wait_for_file_transfer":true,
"download_timeout":60,
"upload_remove_on_success":true,
"upload_tar_file":true,
"thing_friendly_name":"None",
"discover_services_on_init":true,
"remote_access_support":[
{ "name": "Telnet", "port":"23", "session_timeout":"60" },
{ "name": "SSH", "port":"22", "session_timeout":"60" },
{ "name": "VNC", "port":"5900" },
{ "name": "HTTP", "port":"80" },
{ "name": "HTTPS", "port":"443" },
{ "name": "RDP", "port":"3389" }
]
}