# TG-LRX2 Utilities

Utilities to generate and publish command and configuration messages for TG-LR82, TG-LR92 LoRaWAN devices.

## Example

Command source file:
```
# lora-script.txt
frame set-cfg 1,601,0,0,current-state,activity
frame set-cfg 1,43200,1,0,mag-switch
```

Generate downlink messages (lora-pub.yml) to schedule on LoRaWAN network server:
```
tg-lrx2-encode --script ./lora-script.txt --dev-desc ./tg-lrx2-2.0-desc.yml --max-len=50 --out ./lora-pub.yml
```

Optionally publish to TTN network server from CLI:
```
tg-lrx2-pub --host ./ttn-app.yml --dl-msg ./lora-pub.yml device-id
```

Example credential file:
```
# ttn-app.yml
app-id: "ttn-tag-demo@ttn"
host: "eu1.cloud.thethings.industries"
port: 1883
user: "ttn-tag-demo@ttn"
password: "NNSXS.5G..."
```

See https://help.mikrotik.com/docs/spaces/UM/pages/181338171/TG-LR for more details.

