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:50] – [4.1. Autonomo with LoRaBee] samer | lorawan_downlink [2017/12/12 08:24] – [4.1. Autonomo with LoRaBee] 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 {{ :: |
+ | |||
+ | |||
+ | ==== -. 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++> | ||
- | case EV_TXCOMPLETE: | + | void receiveData() { |
- | | + | // After we have send some data, we can receive some data |
- | if (LMIC.dataLen) { | + | // First we make a buffer |
- | // data received in rx slot after tx | + | 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++) { | ||
+ | | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | } | ||
+ | if (HEXPayload == "off" | ||
+ | digitalWrite(LED_BUILTIN, | ||
+ | } | ||
+ | debugSerial.println(HEXPayload); | ||
+ | // | ||
+ | } else { | ||
+ | debugSerial.println("no payload" | ||
+ | } | ||
+ | } | ||
</ | </ | ||
- | ==== -. 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 {{ : | ||
- | We tested two types of devices on the LoRaWAN platform. The first type is based on Arduino | + | ===== -. Selecting the Receive Windows ===== |
+ | |||
+ | The selection | ||
+ | |||
+ | - The LoraWAN-in-C library used on the Arduino | ||
+ | - The Microchip LoRaBee | ||
+ | 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