|
| 1 | +# MQTT topics |
| 2 | + |
| 3 | +To receive data from your gateways, you need to subscribe to its MQTT topic(s). |
| 4 | +For debugging, you can use a (command-line) tool like ``mosquitto_sub`` |
| 5 | +which is part of the [Mosquitto](http://mosquitto.org/) MQTT broker. |
| 6 | + |
| 7 | +Use ``+`` for a single-level wildcard, ``#`` for a multi-level wildcard. |
| 8 | +Examples: |
| 9 | + |
| 10 | +```bash |
| 11 | +mosquitto_sub -t "gateway/#" -v # show data from all gateways |
| 12 | +mosquitto_sub -t "gateway/0101010101010101/+" -v # show all data for the given gateway |
| 13 | +``` |
| 14 | + |
| 15 | +## gateway/[MAC]/stats |
| 16 | + |
| 17 | +Topic for gateway statistics. Example payload: |
| 18 | + |
| 19 | +```json |
| 20 | +{ |
| 21 | + "altitude": 0, |
| 22 | + "latitude": 0, |
| 23 | + "longitude": 0, |
| 24 | + "mac": "1dee08d0b691d149", |
| 25 | + "rxPacketsReceived": 2, |
| 26 | + "rxPacketsReceivedOK": 1, |
| 27 | + "time": "2016-06-10T14:04:53Z" |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +## gateway/[MAC]/rx |
| 32 | + |
| 33 | +Topic for received packets (from nodes). Example payload: |
| 34 | + |
| 35 | +```json |
| 36 | +{ |
| 37 | + "phyPayload": "AAEBAQEBAQEBAgICAgICAgJpNbxrAh8=", // base64 encoded LoRaWAN packet |
| 38 | + "rxInfo": { |
| 39 | + "channel": 1, |
| 40 | + "codeRate": "4/5", |
| 41 | + "crcStatus": 1, |
| 42 | + "dataRate": { |
| 43 | + "bandwidth": 125, |
| 44 | + "modulation": "LORA", |
| 45 | + "spreadFactor": 7 |
| 46 | + }, |
| 47 | + "frequency": 868300000, |
| 48 | + "loRaSNR": 7, |
| 49 | + "mac": "1dee08d0b691d149", |
| 50 | + "rfChain": 1, |
| 51 | + "rssi": -57, |
| 52 | + "size": 23, |
| 53 | + "time": "0001-01-01T00:00:00Z", |
| 54 | + "timestamp": 2074240683 // gateway internal timestamp (32 bit) with microsecond precision |
| 55 | + } |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +## gateway/[MAC]/tx |
| 60 | + |
| 61 | +Topic for publishing packets to be transmitted by the given gateway. |
| 62 | +Example payload: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "phyPayload": "IKu70cumKom7BREUFrxlHtM=", |
| 67 | + "txInfo": { |
| 68 | + "codeRate": "4/5", |
| 69 | + "dataRate": { |
| 70 | + "bandwidth": 125, |
| 71 | + "modulation": "LORA", |
| 72 | + "spreadFactor": 7 |
| 73 | + }, |
| 74 | + "frequency": 868300000, |
| 75 | + "immediately": false, |
| 76 | + "mac": "1dee08d0b691d149", |
| 77 | + "power": 14, |
| 78 | + "timestamp": 2079240683 |
| 79 | + } |
| 80 | +} |
| 81 | +``` |
0 commit comments