|
1 | 1 | # LoRa Semtech Bridge |
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/brocaar/lora-semtech-bridge) |
| 4 | +[](http://lora-semtech-bridge.readthedocs.org/en/latest/?badge=latest) |
| 5 | +[](http://lora-semtech-bridge.readthedocs.org/en/stable/?badge=stable) |
4 | 6 | [](https://godoc.org/github.com/brocaar/lora-semtech-bridge/cmd/semtech-bridge) |
5 | 7 |
|
6 | | -*LoRa Semtech Bridge* is a service to enable LoRa gateway communication over MQTT. |
7 | | -All incoming UDP traffic (Semtech UDP protocol) is published to a MQTT broker and |
8 | | -all messages received from the MQTT broker are sent to the gateway using UDP. |
| 8 | +LoRa Semtech Bridge is a service which abstracts the |
| 9 | +[Semtech protocol](https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT) |
| 10 | +into JSON over MQTT. This project is part of [LoRa Server](https://github.com/brocaar/loraserver). |
9 | 11 |
|
10 | | -This project is part of [LoRa Server](https://github.com/brocaar/loraserver). |
11 | 12 |
|
12 | | -## Requirements |
| 13 | +## Documentation |
13 | 14 |
|
14 | | -#### MQTT broker |
| 15 | +See the [http://lora-semtech-bridge.readthedocs.io/](http://lora-semtech-bridge.readthedocs.io/) |
| 16 | +for documentation about setting up LoRa Semtech Bridge. |
15 | 17 |
|
16 | | -[Mosquitto](http://mosquitto.org/) is a popular open-source MQTT server. |
| 18 | +## Downloads |
17 | 19 |
|
18 | | -#### LoRa gateway |
| 20 | +Pre-compiled binaries are available for: |
19 | 21 |
|
20 | | -Your gateway must be setup so that it sends UDP packets (Semtech UDP protocol). |
21 | | -Depending upon your LoRa Gateway type, you might need to install the |
22 | | -[packet_forwarder](https://github.com/TheThingsNetwork/packet_forwarder). |
23 | | - |
24 | | - |
25 | | -## Getting started |
26 | | - |
27 | | -* Download and unpack a pre-compiled binary from the [releases](https://github.com/brocaar/lora-semtech-bridge/releases) |
28 | | - page. Alternatively, build the code from source (when you have a Go development environment |
29 | | - ``make build`` should be sufficient). |
30 | | - |
31 | | -* Start the ``semtech-bridge`` service. The ``--help`` argument will show |
32 | | - you all the available config options. When everything is setup correctly |
33 | | - (your gateway is configured to send data to ``semtech-bridge``), you |
34 | | - should see ``PullData`` packets coming in. E.g. |
35 | | - |
36 | | -``` bash |
37 | | -$ ./semtech-bridge |
38 | | -INFO[0000] backend/mqttpubsub: connecting to mqtt broker server=tcp://127.0.0.1:1883 |
39 | | -INFO[0000] gateway: starting gateway udp listener addr=0.0.0.0:1700 |
40 | | -INFO[0000] backend/mqttpubsub: connected to mqtt broker |
41 | | -INFO[0006] gateway: received udp packet from gateway addr=192.168.1.8:45082 type=PullData |
42 | | -INFO[0006] backend/mqttpubsub: subscribing to topic topic=gateway/1dee08d0b691d149/tx |
43 | | -INFO[0006] gateway: sending udp packet to gateway addr=192.168.1.8:45082 type=PullACK |
44 | | -INFO[0016] gateway: received udp packet from gateway addr=192.168.1.8:45082 type=PullData |
45 | | -INFO[0016] gateway: sending udp packet to gateway addr=192.168.1.8:45082 type=PullACK |
46 | | -INFO[0021] gateway: received udp packet from gateway addr=192.168.1.8:45738 type=PushData |
47 | | -INFO[0021] gateway: stat packet received addr=192.168.1.8:45738 mac=1dee08d0b691d149 |
48 | | -INFO[0021] gateway: sending udp packet to gateway addr=192.168.1.8:45738 type=PushACK |
49 | | -INFO[0021] backend/mqttpubsub: publishing packet topic=gateway/1dee08d0b691d149/stats |
50 | | -``` |
51 | | - |
52 | | -* Now it is time to setup the [LoRa Server](https://github.com/brocaar/loraserver)! |
53 | | - |
54 | | -## Debugging |
55 | | - |
56 | | -To view all incoming and outgoing MQTT messages, you can use the ``mosquitto_sub`` |
57 | | -tool. |
58 | | - |
59 | | -```bash |
60 | | -$ mosquitto_sub -t "#" -v |
61 | | -gateway/1dee08d0b691d149/stats {"mac":"1dee08d0b691d149","time":"2016-04-16T10:08:11Z","latitude":0,"longitude":0,"altitude":0,"rxPacketsReceived":0,"rxPacketsReceivedOK":0} |
62 | | -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="} |
63 | | -gateway/1dee08d0b691d149/stats {"mac":"1dee08d0b691d149","time":"2016-04-16T10:08:41Z","latitude":0,"longitude":0,"altitude":0,"rxPacketsReceived":1,"rxPacketsReceivedOK":1} |
64 | | -``` |
65 | | - |
66 | | -## Data model |
67 | | - |
68 | | -The data model is defined in the [LoRa Server](https://github.com/brocaar/loraserver) |
69 | | -project. JSON is used as marshaling format. See: |
70 | | - |
71 | | -* [RXPacket](https://godoc.org/github.com/brocaar/loraserver/models/#RXPacket) (packet received by the gateway) |
72 | | -* [TXPacket](https://godoc.org/github.com/brocaar/loraserver/models/#TXPacket) (packet to be sent by the gateway) |
73 | | -* [GatewayStatsPacket](https://godoc.org/github.com/brocaar/loraserver/models/#GatewayStatsPacket) (gateway stats) |
| 22 | +* Linux (and ARM build for e.g. Raspberry Pi) |
| 23 | +* OS X |
| 24 | +* Windows |
74 | 25 |
|
| 26 | +See [releases](https://github.com/brocaar/lora-semtech-bridge/releases). |
75 | 27 |
|
76 | 28 | ## License |
77 | 29 |
|
78 | | -This package is licensed under the MIT license. See ``LICENSE``. |
| 30 | +LoRa Server is licensed under the MIT license. See ``LICENSE``. |
0 commit comments