...
The process varies based on gateway model. Please refer to gateway guide/manuals or contact manufacturer.
Collecting MAC State of the end device from The Things Stack (Network Server):
MAC State describes the current state of the end device in the current session. It contains the current parameters, desired parameters, as well as the last 20 uplinks and downlinks of the end device. To download the device's MAC state, follow the below steps.
Step 1: Navigate to the Device Overview page tab in TTS Console
Step 2: Click on the Download MAC data
button from the MAC data section at the bottom of The Things Stack Console.
Collecting Events from The Things Stack (Network Server):
...
Method 2: Using CLI
Prerequisites:
Install CLI. Ref: https://www.thethingsindustries.com/docs/getting-started/cli/
Create a User API Key:
Login to The Things Stack Console.
Click on
Username
from the top right corner of the Console.Click on
Personal API keys
from the dropdownClick
+Add API
key buttonYou can create a
User API Key
in The Things Stack Console by assigning the relevant rights. Please consider the below rights as minimum rights.Link as Application to a Network Server for traffic exchange, i.e. read uplink and write downlink
Read application traffic (uplink and downlink)
View gateway status
Read gateway traffic
Step 1:
Login to CLI using the below ttn-lw-cli
command.
...
Now, the GATEWAY-events.log
and DEVICE_ID-events.log
files will keep logging the events till you terminate the streams. These can be used for further analysis.
Ref: https://thethingsindustries.com/docs/getting-started/events/
Tips:
You can use multiple CMD/terminal windows to run the above commands simultaneously for devices and gateways of a particular test case.
Make sure to let the command run in the CMD over a period in which you observe the issue and then terminate.
Login to the CLI using the
OAuth Access
token will allow subscribing to the events, but only for a shorter-duration as theOAuth Access
token expire after an hour. Hence, login usingUser API Key
is suggested in this guide.
Additionally, if you are on self-hosted/enterprise deployments, you can also access more logs to know what is happening at the stack level. Refer below.
...
Enterprise/Open Source Deployment:
Edit The Things Stack configuration
ttn-lw-stack-docker.yml
file and add the below lines.Code Block log: level: debug
Restart the stack using the below command.
Code Block docker-compose restart
Collect the logs using the below command
Code Block docker logs -t <stack_container_name>
Note: Make sure you are in the right directory that has the docker-compose.yml
to restart the stack.
AWS AMI Deployment:
SSH into the EC2 instance. Please see How can I SSH into my machine reference for information to SSH into the EC2 instance.
Add the following lines to the file
/tti/lorawan-stack/config.yml
.
Code Block |
---|
log: level: debug |
...
Code Block |
---|
$ sudo journalctl -f -u lorawan-stack.service |
AWS ECS Deployment:
Go to the
4-2a-configuration
CloudFormation stack.Navigate to the
Resources
section and findGlobalConfiguration
Go to its Physical ID and edit the configuration
Add the below lines to the configuration file.
Code Block log: level: debug
Restart the ECS tasks to apply the configuration.
Check the CloudWatch log events for DEBUG logs.