Once you have added your end device to The Things Stack, you can also set its location to be displayed on a map widget.
To do this on the console, click the Change location settings option on the end device.
The end device location can be manually set in two ways.
- Pinning the location on the map widget.
- Entering the Latitude, Longitude and Altitude values.
Make sure you select Save Changes at the bottom of the page.
Once you have added your end device to The Things Stack, you can also set its location.
Set your end device’s location with:
LAT="43.84"
LONG="18.32"
ALT="500"
ttn-lw-cli end-devices set $APP_ID $DEVICE_ID \
--location.latitude $LAT \
--location.longitude $LONG \
--location.altitude $ALT \
You can also set the end device location to be updated from various sources with the --location.source
flag.
The source of the location data can be the registry, GPS data, results of the LoRa RSSI geolocation, etc. Use ttn-lw-cli end-devices set $APP_ID $DEVICE_ID --help
command to see the full list of the available location sources and other relatable info. If you set the alternative location source, the location settings you manually set will be overwritten by the automatic updates from that source.
The CLI will return something like:
{
"ids": {
"device_id": "dev1",
"application_ids": {
"application_id": "app1"
},
"dev_eui": "0004A30B001C0530",
"join_eui": "800000000000000C"
},
"created_at": "2020-05-27T15:50:38.567Z",
"updated_at": "2020-12-25T11:16:20.592Z",
"locations": {
"user": {
"latitude": 43.84,
"longitude": 18.32,
"altitude": 500,
"source": "SOURCE_REGISTRY"
}
}
}