lorawan_downlink
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
lorawan_downlink [2017/08/22 21:50] – [4.1. Autonomo with LoRaBee] samer | lorawan_downlink [2017/12/13 17:30] – [5. Selecting the Receive Windows] samer | ||
---|---|---|---|
Line 6: | Line 6: | ||
According to the [[https:// | According to the [[https:// | ||
- | * The first receive window is implemented on the same channel and data rate as the uplink | + | * The first receive window is implemented on the same channel and data rate as the uplink. |
* The second receive window is implemented on a predefined channel and data rate. This window can also be modified by MAC commands. | * The second receive window is implemented on a predefined channel and data rate. This window can also be modified by MAC commands. | ||
Line 33: | Line 33: | ||
You can use mqtt-spy to debug the messages received from the LoRaWAN devices. Start by configuring a new connection to the MQTT broker by simply adding the IP address of the broker in the '' | You can use mqtt-spy to debug the messages received from the LoRaWAN devices. Start by configuring a new connection to the MQTT broker by simply adding the IP address of the broker in the '' | ||
- | In order to send downlink data to a specific device, you should publish the encoded message in the corresponding topic '' | + | In order to send downlink data to a specific device, you should publish the encoded message in the corresponding topic '' |
< | < | ||
Line 47: | Line 47: | ||
The payload sent by the MQTT client must be encoded in Base64. | The payload sent by the MQTT client must be encoded in Base64. | ||
</ | </ | ||
- | |||
==== -. Using IoT MQTT Dashboard ==== | ==== -. Using IoT MQTT Dashboard ==== | ||
[[https:// | [[https:// | ||
Line 55: | Line 54: | ||
{{: | {{: | ||
{{: | {{: | ||
+ | |||
Line 62: | Line 62: | ||
In the LoRaWAN platform, we support devices based on an [[http:// | In the LoRaWAN platform, we support devices based on an [[http:// | ||
- | This sketch {{ :: | + | This sketch {{ :: |
+ | |||
+ | <code c++> | ||
+ | void receiveData() { | ||
+ | // After we have send some data, we can receive some data | ||
+ | // First we make a buffer | ||
+ | uint8_t payload[64]; | ||
+ | // Now we fill the buffer and | ||
+ | // len = the size of the data | ||
+ | uint16_t len = LoRaBee.receive(payload, | ||
+ | String HEXPayload = ""; | ||
+ | |||
+ | // When there is no payload the lorabee will return 131 (0x83) | ||
+ | // I filter this out | ||
+ | if (payload[0] != 131) { | ||
+ | for (int i = 0; i < len; i++) { | ||
+ | HEXPayload += char(payload[i]); | ||
+ | } | ||
+ | |||
+ | if (HEXPayload == " | ||
+ | digitalWrite(LED_BUILTIN, | ||
+ | } | ||
+ | if (HEXPayload == " | ||
+ | digitalWrite(LED_BUILTIN, | ||
+ | } | ||
+ | debugSerial.println(HEXPayload); | ||
+ | // | ||
+ | } else { | ||
+ | debugSerial.println(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ==== -. Arduino with Dragino Shield ==== | ||
+ | Devices in the LoRaWAN platform can also be implemented on Arduino boards with Dragino shields. The combined module as well as the basic configuration steps are presented in [[simple_lora_prototype|Simple Prototype of LoRa Communications]]. Similarly to the Autonomo device, you can download the following sketch {{ :: | ||
<code c++> | <code c++> | ||
Line 74: | Line 107: | ||
} | } | ||
</ | </ | ||
- | ==== -. Arduino with Dragino Shield | + | ===== -. Selecting the Receive Windows ===== |
- | Devices in the LoRaWAN platform can also be implemented on Arduino boards with Dragino shields. The combined module as well as the basic configuration steps are presented in [[simple_lora_prototype|Simple Prototype of LoRa Communications]]. Similarly to the Autonomo device, you can download the following sketch {{ : | + | |
- | We tested two types of devices on the LoRaWAN platform. The first type is based on Arduino boards with Dragino shields. The combined module as well as the basic configuration steps are presented | + | The selection |
+ | - The LoraWAN-in-C library used on the Arduino based devices has only been tested for receiving downlink packets in the RX2 window. | ||
+ | - The Microchip LoRaBee is configured by default with RX2 corresponding to SF9 on the center frequency 869525000 Hz. However, the LoRaWAN specification recommends for RX2 the same sub-channel but with SF12. | ||
- | {{ ::example-code-arduino.ino.zip | + | Therefore, the recommended configuration consists of selecting to receive on RX2 for Arduino based devices (this is mandatory) and RX1 for autonomo based devices (this is the easiest configuration). Figure 3 shows the configuration interface of loraserver that enables to select the receive windows for each configured device. |
+ | |||
+ | [{{ undefined:loraserver-downlink-dr.png? | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | Without configuring the receive window, with OTAA mode, autonomo is receiving on RX1. | ||
+ | </ |
lorawan_downlink.txt · Last modified: 2021/08/28 09:53 by samer