wikiroute

networking recipes

User Tools

Site Tools


exploring_lorawan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
exploring_lorawan [2018/10/29 14:41] – [4. Applications] samerexploring_lorawan [2019/10/23 14:51] – [4. Applications] samer
Line 13: Line 13:
  
 [{{ :lora-pilot-architecture.png?direct&650 | Figure 1. Architecture of the LoRaWAN Platform}}] [{{ :lora-pilot-architecture.png?direct&650 | Figure 1. Architecture of the LoRaWAN Platform}}]
 +
 +{{ :img_20170124_160141.jpg?nolink&400 | Outdoor antenna of ESIB}}
  
 <WRAP center round help 100%> <WRAP center round help 100%>
Line 24: Line 26:
 [{{ :app-loraserver.png?direct&600 | Figure 2. Loraserver web interface}}] [{{ :app-loraserver.png?direct&600 | Figure 2. Loraserver web interface}}]
  
-Start by choosing the application named ''IDOE-1819'' to create a new device. You should provide the following information: +Start by choosing the application named ''IoT-Course-19-20'' to create a new device. You should provide the following information: 
-  * A unique device name: ''IDOE-GX'' (where ''X'' is your group number)+  * A unique device name: ''IoT-GX'' (where ''X'' is your group number)
   * The device description   * The device description
-  * A unique device EUI on 64 bits: Random identifiers can be generated on [[https://www.random.org/bytes/]]+  * A unique device EUI on 64 bits: click on the circular arrow to generate a random EUI.
   * A unique application key on 128 bits also obtained by random generation.   * A unique application key on 128 bits also obtained by random generation.
    
Line 40: Line 42:
 Devices in the LoRaWAN platform are implemented on Arduino boards with Dragino shields. The combined module as well as the basic configuration steps are presented in [[exploring_lora|Exploring LoRa lab]].  Devices in the LoRaWAN platform are implemented on Arduino boards with Dragino shields. The combined module as well as the basic configuration steps are presented in [[exploring_lora|Exploring LoRa lab]]. 
  
-Start by verifying the installation on your PC of the latest Arduino IDE. Unzip the Arduino {{ :arduino-lmic-master.zip |LMIC library}} and copy it to your sketchbook library folder as detailed in [[https://www.arduino.cc/en/Guide/Libraries]]. Then, download and open the example sketch {{ :example-code-idoe-iot-lab.zip |example-code-idoe-iot-lab.ino}} with Arduino IDE.+Start by verifying the installation on your PC of the latest Arduino IDE. Unzip the Arduino {{ :arduino-lmic-mcci.zip |LMIC library}} and copy it to your sketchbook library folder as detailed in [[https://www.arduino.cc/en/Guide/Libraries]]. Then, download and open the example sketch {{ :example-code-idoe-iot-lab.zip |example-code-idoe-iot-lab.ino}} with Arduino IDE.
  
 Now you should configure your device with the same identifiers ''DEVEUI'' and ''APPKEY'' as in the backend: Now you should configure your device with the same identifiers ''DEVEUI'' and ''APPKEY'' as in the backend:
Line 59: Line 61:
 </WRAP> </WRAP>
  
-Let us analyze to radio parameters in the sketch by answering the following questions.+Let us analyze the radio parameters in the sketch by answering the following questions.
  
 <WRAP left round help 100%> <WRAP left round help 100%>
Line 67: Line 69:
 </WRAP> </WRAP>
  
-The LMIC library defines a set of events corresponding to the protocol machine state. These events appear in the ''onEvent()'' function.+The LMIC library (see {{ :lmic-v1.5.pdf | documentation}}) defines a set of events corresponding to the protocol machine state. These events appear in the ''onEvent()'' function.
  
 <WRAP left round help 100%> <WRAP left round help 100%>
Line 82: Line 84:
 </WRAP> </WRAP>
  
-Now you are ready to compile the sketch and upload it to the LoRaWAN device. Connect the device a USB port on your PC, choose the board type as presented in [[exploring_lora|Exploring LoRa lab]] and select the corresponding port. Compile and upload!+Now you are ready to compile the sketch and upload it to the LoRaWAN device. Connect the device to a USB port on your PC, choose the board type as presented in [[exploring_lora|Exploring LoRa lab]] and select the corresponding port. Compile and upload!
  
 Open the serial monitor in the Arduino IDE at 115200 baud and analyse the debug messages. Open the serial monitor in the Arduino IDE at 115200 baud and analyse the debug messages.
Line 101: Line 103:
 mqtt-spy is an open source utility intended to help you with monitoring activity on MQTT topics. It has been designed to deal with high volumes of messages, as well as occasional publications. mqtt-spy is a JavaFX application, so it should work on any operating system with an appropriate version of **Java 8 installed**. A very useful tutorial is available on [[https://github.com/eclipse/paho.mqtt-spy/wiki]]. The tool can be directly downloaded from this {{ :mqtt-spy-1.0.0.jar.zip |link}}. mqtt-spy is an open source utility intended to help you with monitoring activity on MQTT topics. It has been designed to deal with high volumes of messages, as well as occasional publications. mqtt-spy is a JavaFX application, so it should work on any operating system with an appropriate version of **Java 8 installed**. A very useful tutorial is available on [[https://github.com/eclipse/paho.mqtt-spy/wiki]]. The tool can be directly downloaded from this {{ :mqtt-spy-1.0.0.jar.zip |link}}.
  
-You can use mqtt-spy to debug the messages received from the LoRaWAN devices. After starting the application, configure a new connection to the MQTT broker by simply adding the IP address of the broker in the ''Server URI'' field. Now you can subscribe to any MQTT topic. If you want to receive all messages arriving at the backend, you can use the generic topic ''#''. You can also limit to the topic including the messages of any specific device: ''application/APPLICATION_ID/node/DEVICE_EUI/rx''+You can use mqtt-spy to debug the messages received from the LoRaWAN devices. After starting the application, configure a new connection to the MQTT broker by simply adding the IP address of the broker in the ''Server URI'' field. Now you can subscribe to any MQTT topic. If you want to receive all messages arriving at the backend, you can use the generic topic ''#''. You can also limit to the topic including the messages of any specific device: ''application/APPLICATION_ID/device/DEVICE_EUI/rx''
  
 <WRAP left round help 100%> <WRAP left round help 100%>
Line 114: Line 116:
 </WRAP> </WRAP>
  
-If you need to send data to your device, you should publish an encoded message in the corresponding topic ''application/APPLICATION_ID/node/DEVICE_EUI/tx'' as follows:+If you need to send data to your device, you should publish an encoded message in the corresponding topic ''application/APPLICATION_ID/device/DEVICE_EUI/tx'' as follows:
  
 <code> <code>
Line 127: Line 129:
 The payload sent by the MQTT client must be encoded in Base64. The payload sent by the MQTT client must be encoded in Base64.
 </WRAP> </WRAP>
 +
 +You can also download a {{ :mqtt-emoncms-eguz-script.py.zip | python script}} that automates the data retrieval from the MQTT broker .
 ===== -. LoRaWAN Challenges ===== ===== -. LoRaWAN Challenges =====
 Implement and provide technical documentation for each of the following challenges. Implement and provide technical documentation for each of the following challenges.
Line 132: Line 136:
 ==== -. The End-to-End Challenge ==== ==== -. The End-to-End Challenge ====
 I can send data from the device to the application. I can send data from the device to the application.
 +
 +<WRAP center round tip 100%>
 +Note that the ''String'' function can be used to cast the message you want to send in a string format.
 +</WRAP>
  
 ==== -. The Downlink Challenge ==== ==== -. The Downlink Challenge ====
exploring_lorawan.txt · Last modified: 2021/11/02 06:31 by samer