Skip to content

Commit f376e9b

Browse files
committed
Update documentation.
1 parent 24f85c6 commit f376e9b

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ INFO[0006] backend/mqttpubsub: publishing message topic=gateway/1dee08d0b
4848

4949
* Now it is time to setup the [LoRa Server](https://github.com/brocaar/loraserver)!
5050

51+
## Debugging
52+
53+
To view all incoming and outgoing MQTT messages, you can use the ``mosquitto_sub``
54+
tool.
55+
56+
```bash
57+
$ mosquitto_sub -t "#" -v
58+
gateway/1dee08d0b691d149/stats {"mac":"1dee08d0b691d149","time":"2016-04-16T10:08:11Z","latitude":0,"longitude":0,"altitude":0,"rxPacketsReceived":0,"rxPacketsReceivedOK":0}
59+
gateway/1dee08d0b691d149/rx {"rxInfo":{"mac":"1dee08d0b691d149","time":"2016-04-16T10:08:30.005418Z","timestamp":1623489499,"frequency":868300000,"channel":1,"rfChain":1,"crcStatus":1,"codeRate":"4/5","rssi":-48,"loRaSNR":10,"size":23,"dataRate":{"modulation":"LORA","spreadFactor":7,"bandwidth":125}},"phyPayload":"AAEBAQEBAQEBAgICAgICAgJzTIBGXXg="}
60+
gateway/1dee08d0b691d149/stats {"mac":"1dee08d0b691d149","time":"2016-04-16T10:08:41Z","latitude":0,"longitude":0,"altitude":0,"rxPacketsReceived":1,"rxPacketsReceivedOK":1}
61+
```
62+
63+
## Data model
64+
65+
The data model is defined in the [LoRa Server](https://github.com/brocaar/loraserver)
66+
project. JSON is used as marshaling format. See:
67+
68+
* [RXPacket](https://godoc.org/github.com/brocaar/loraserver/models/#RXPacket) (packet received by the gateway)
69+
* [TXPacket](https://godoc.org/github.com/brocaar/loraserver/models/#TXPacket) (packet to be sent by the gateway)
70+
* [GatewayStatsPacket](https://godoc.org/github.com/brocaar/loraserver/models/#GatewayStatsPacket) (gateway stats)
71+
72+
5173
## License
5274

5375
This package is licensed under the MIT license. See ``LICENSE``.

cmd/semtech-bridge/doc.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
NAME:
3-
semtech-bridge - Semtech UDP protocol speaking gateway <-> MQTT
3+
semtech-bridge - communicate with a LoRa gateway (Semtech UDP protocol) over MQTT
44
55
USAGE:
66
main [global options] command [command options] [arguments...]
@@ -13,9 +13,13 @@ GLOBAL OPTIONS:
1313
--mqtt-server "tcp://127.0.0.1:1883" MQTT server [$MQTT_SERVER]
1414
--mqtt-username MQTT username [$MQTT_USERNAME]
1515
--mqtt-password MQTT password [$MQTT_PASSWORD]
16+
--log-level "4" debug=5, info=4, warning=3, error=2, fatal=1, panic=0 [$LOG_LEVEL]
1617
--help, -h show help
1718
--version, -v print the version
1819
20+
COPYRIGHT:
21+
See http://github.com/brocaar/lora-semtech-bridge for copyright information
22+
1923
2024
*/
2125
package main

cmd/semtech-bridge/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func run(c *cli.Context) {
7272
func main() {
7373
app := cli.NewApp()
7474
app.Name = "semtech-bridge"
75-
app.Usage = "Semtech UDP protocol speaking gateway <-> MQTT"
75+
app.Usage = "communicate with a LoRa gateway (Semtech UDP protocol) over MQTT"
7676
app.Copyright = "See http://github.com/brocaar/lora-semtech-bridge for copyright information"
7777
app.Version = version
7878
app.Action = run

0 commit comments

Comments
 (0)