It works for me:
-
Downloaded the latest version for the Mac and renamed the unzipped executable to
ttnctl. - Followed the instructions to log in.
- Listed the applications:
ttnctl applications list - Followed the instructions to select the active application for the subsequent commands:
ttnctl applications select - Listed the active application’s devices:
ttnctl devices list - Executed:
ttnctl devices set my-device-id --attr-set my1stkey:my1stvaluettnctl devices set my-device-id --attr-set my2ndkey:"my 2nd value"ttnctl devices set my-device-id --attr-set "my 3rd key":"my 3rd value"ttnctl devices set my-device-id --attr-set "my 4th key:my 4th value"ttnctl devices set my-device-id --attr-set my5thkey:123
…and am nicely getting the additional attributes in each uplink I see using mosquitto_sub -h eu.thethings.network -u my-app-id -P ttn-account-v2.w1...Gk -t my-app-id/devices/+/+
{
"app_id": "my-app-id",
"dev_id": "my-device-id",
...
"payload_raw": "By4HLgkSKXUpmSnKACEAIQApYQ==",
"metadata": {
"time": "2018-10-27T11:35:41.447910401Z",
...
},
"attributes": {
"my 3rd key": "my 3rd value",
"my 4th key": "my 4th value",
"my1stkey": "my1stvalue",
"my2ndkey": "my 2nd value",
"my5thkey": "123"
}
}
Also, running ttnctl devices info my-device-id nicely shows:
Attributes:
my 3rd key: my 3rd value
my 4th key: my 4th value
my1stkey: my1stvalue
my2ndkey: my 2nd value
my5thkey: 123
So:
-
ttnctlis quite lenient when it comes to quoting whitespace. - All values are string values, even when they could be numeric.
- Beware that at most 5 attributes are supported:
Could not set device on Handler: Maximum number of custom attributes (5) exceeded.