lorawan_downlink
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
lorawan_downlink [2017/08/22 21:44] – [4. Receiving Downlink Messages] samer | lorawan_downlink [2017/12/12 08:24] – [4.2. Arduino with Dragino Shield] 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:// | ||
- | The following | + | This sketch {{ :: |
- | <codec++> | + | |
+ | ==== -. 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++> | ||
case EV_TXCOMPLETE: | case EV_TXCOMPLETE: | ||
Serial.println(F(" | Serial.println(F(" | ||
Line 74: | Line 78: | ||
} | } | ||
</ | </ | ||
+ | ===== -. Selecting the Receive Windows ===== | ||
- | <code c++> | + | The selection |
- | 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, 64); | + | |
- | 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 | + | |
- | + | ||
- | + | ||
- | We tested | + | |
- | + | ||
+ | - 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. | ||
+ | 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. | ||
- | {{ ::example-code-arduino.ino.zip |}} | + | [{{ undefined:loraserver-downlink-dr.png? |
lorawan_downlink.txt · Last modified: 2021/08/28 09:53 by samer