The Things Network include command line tool called ttnctl. The following guide will help you setup the command line tool for the public network and private networks.
Info |
---|
Download the latest version on the reference guide. |
This guide will not explain how to use ttnctl for this, please head here. Before starting you should know that ttnctl can interact with any TTN/TTI server, it is only a matter of configuration. The standard configuration point to the European region server.
Step-by-step
Create a file called .ttnctl.yml in your home directory and fill it with the following information:
Code Block auth-server: https://account.<domain_id>.thethings.industries allow-insecure: false data: /home/<user_name>/.ttnctl router-id: <domain_id>-router mqtt-address: <domain_id>.thethings.industries:1883 handler-id: <domain_id>-handler discovery-address: <domain_id>.thethings.industries:1900
Now ttnctl is configured to use your private network !
Info For windows user make sure to use the --config flag with the full path to the confifuration file
Code Block ttnctl.exe --config fullpath/config.yml
- Get the an access code https://<domain_id>.thethings.industries/users/authorize?client_id=ttnctl&redirect_uri=/oauth/callback/ttnctl&response_type=code
Login:
Code Block ttnctl user login [access_code]
You are now login on your private network ! You should now see a folder named /.ttnctl in your home directory with private files. Make sure this are protected.
Info The following steps aren't necessary if you don't plan on using the public network
Create a file called community.yml in /home/<user_name>/.ttnctl/ with the following (for other region use the respective region name instead of eu):
Code Block data: /home/neugdae/.ttnctl/community discovery-address: discover.thethingsnetwork.org:1900 allow-insecure: false mqtt-address: eu.thethings.network:1883 gateway-id: dev router-id: ttn-router-eu auth-server: https://account.thethingsnetwork.org handler-id: ttn-handler-eu
- Get the access code https://account.thethingsnetwork.org/users/authorize?client_id=ttnctl&redirect_uri=/oauth/callback/ttnctl&response_type=code
Login:
Code Block ttnctl --config /home/<user_name>/.ttnctl/community.yml user login [access_code]
Tip Define an alias on ttnctl --config /home/<user_name>/.ttnctl/community.yml to go faster !
Info |
---|
In other articles when no configuration is specified it refer to your private networks. If there is an ambiguity on which configuration to use it will specified in the command line provided in the guide. |
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||
---|---|---|
| ||
|