https://github.com/bertrik/ttn-gateway-collector
Collects data from multiple TTN (v3) gateways for LoRaWAN traffic analysis
https://github.com/bertrik/ttn-gateway-collector
thethingsnetwork
Last synced: 25 days ago
JSON representation
Collects data from multiple TTN (v3) gateways for LoRaWAN traffic analysis
- Host: GitHub
- URL: https://github.com/bertrik/ttn-gateway-collector
- Owner: bertrik
- License: mit
- Created: 2021-10-01T14:13:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-12T21:36:24.000Z (2 months ago)
- Last Synced: 2025-04-17T22:10:11.065Z (about 1 month ago)
- Topics: thethingsnetwork
- Language: Java
- Homepage:
- Size: 1.57 MB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ttn-gateway-collector
Collects data from TTN (v3) gateways for LoRaWAN traffic analysisThrough the configuration file, you can specify the gateways you want to collect and log data from.
Optionally you can let it forward the data as semtech UDP protocol.## Configuration
### Creating a gateway API key
In order to receive data from a TTN gateway, you need an API key for the gateway.
You can create the API key in the TTN console. This API key needs to have permission 'Read gateway traffic' enabled.
You can only copy the gateway API key once, be careful to copy it in its entirety just after creating it and storing it somewhere safe.### Configuring the collector
Configuration is stored in the ttn-gateway-collector.yaml file.
It allows you to specify one or more gateways to collect traffic from.Additionally you can specify a host to forward the data as semtech UDP (experimental).
Example configuration file:
~~~~
---
url: "https://eu1.cloud.thethings.network/api/v3/events"
gateways:
- gatewayId: "bertrik-ttig-2"
apiKey: "NNSXS.UZHV7MYRN3R74XXY2SM3R67CEPIYX5J3AEIGGMI.secret"
log:
filename: "gateway.csv"
udp:
host: "example.com"
port: 1700
mqtt:
url: "tcp://example.com"
qos: 0
uplinkTopic: "lorawan/uplink"
downlinkTopic: "lorawan/downlink"
statusTopic: "lorawan/status"
~~~~## Running
To use with Docker:
* Install docker and docker-compose, for example on Debian:
```
sudo apt install docker.io docker-compose
```
* Pull the code from github:
```
git clone https://github.com/bertrik/ttn-gateway-collector
```
* Enter the docker directory and pull the image from the github container registry:
```
cd ttn-gateway-collector
cd docker
docker-compose pull
```
* Edit the settings file with your own settings, e.g.:
```
vi ttn-gateway-collector.yaml
```
* Run the container:
```
docker-compose up
```
This creates a gateway.csv file which a line for each uplink packet.
Application logs are available in directory log/