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 [2017/11/24 20:36] – [5. Day One Challenges] samerexploring_lorawan [2018/10/30 08:14] – [3. Devices] samer
Line 24: Line 24:
 [{{ :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 ''RCTE-1718'' to create a new node. You should provide the following information: +Start by choosing the application named ''IDOE-1819'' to create a new device. You should provide the following information: 
-  * A unique node name: ''RCTE-GX'' (where ''X'' is your group number) +  * A unique device name: ''IDOE-GX'' (where ''X'' is your group number) 
-  * The node 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: Random identifiers can be generated on [[https://www.random.org/bytes/]]
-  * The application EUI on 64 bits: ''0badde1cafe2deca''. 
   * A unique application key on 128 bits also obtained by random generation.   * A unique application key on 128 bits also obtained by random generation.
    
-Make sure that the ''ABP activation'' button is unchecked, in order to enable OTAA join method. Finally, in advanced network settings, choose the receive window RX2.+Make sure to choose ''lora-profile'' as a ''Device-profile'' in order to enable OTAA join method.
  
 <WRAP left round help 100%> <WRAP left round help 100%>
-  * What does the application EUI mean? How is it used in LoRaWAN? 
   * What does the application key mean? How is it used in LoRaWAN security?   * What does the application key mean? How is it used in LoRaWAN security?
-  * Compare the two device activation methods used in LoRaWAN by giving the advantages and inconvenients. +  * Compare the two device activation methods used in LoRaWAN by giving the advantages and shortcomings
-  * What is the difference between the two receive windows in LoRaWAN? What are they used for?  +
 </WRAP> </WRAP>
 ===== -. Devices ===== ===== -. Devices =====
Line 43: Line 40:
 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-rcte-iot-lab.zip |example-code-rcte-iot-lab.ino}} with Arduino IDE.+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.
  
-Now you should configure your device with the same identifiers ''APPEUI'', ''DEVEUI''and ''APPKEY'' as in the backend:+Now you should configure your device with the same identifiers ''DEVEUI'' and ''APPKEY'' as in the backend:
  
 <code c++> <code c++>
-static const u1_t PROGMEM APPEUI[8]= { }; +// Change this! 
-void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);} +// This should also be in little endian format, see below.
- +
-// This should also be in little endian format, see above.+
 static const u1_t PROGMEM DEVEUI[8]= { }; static const u1_t PROGMEM DEVEUI[8]= { };
 void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);} void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}
  
 +// Change this!
 static const u1_t PROGMEM APPKEY[16] = { }; static const u1_t PROGMEM APPKEY[16] = { };
 void os_getDevKey (u1_t* buf) {  memcpy_P(buf, APPKEY, 16);} void os_getDevKey (u1_t* buf) {  memcpy_P(buf, APPKEY, 16);}
Line 60: Line 56:
  
 <WRAP left round tip 100%> <WRAP left round tip 100%>
-Note that the device and application identifiers should be in little endian format, while the application key is in big endian format. For example, ''0badde1cafe2deca'' is written as ''0xCA, 0xDE, 0xE2, 0xAF, 0x1C, 0xDE, 0xAD, 0x0B'' in the Arduino sketch.+Note that the device EUI should be in little endian format. Hence, the key, ''0badde1cafe2deca'' should be written as ''0xCA, 0xDE, 0xE2, 0xAF, 0x1C, 0xDE, 0xAD, 0x0B'' in the Arduino sketch.
 </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 71: Line 67:
 </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 86: Line 82:
 </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 ''Arduino/Genuino Mega 2560'' 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!
- +
-<WRAP left round tip 100%> +
-For Arduino Mega 2560, additional drivers can be installed on Windows from http://wch.cn/download/CH341SER_ZIP.html. +
-</WRAP>+
  
 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 99: Line 91:
 </WRAP> </WRAP>
  
-Getting back to the backend, you can monitor some important information related to your device. Click on the corresponding node session.+Getting back to the backend, you can monitor some important information related to your device. Click on the corresponding device activation.
  
 <WRAP left round help 100%> <WRAP left round help 100%>
-  * What are the different fields that appear in the node session corresponding to you device?+  * What are the different fields that appear in the device activation corresponding to you device?
   * Explain how each field is created according to the LoRaWAN specification.   * Explain how each field is created according to the LoRaWAN specification.
   * What are the different counters visible at the backend? Explain how they get incremented and how they are used.   * What are the different counters visible at the backend? Explain how they get incremented and how they are used.
Line 119: Line 111:
  
 <WRAP left round tip 100%> <WRAP left round tip 100%>
-The payload received by the MQTT client is decrypted but encoded in Base64. You should decode it to get the original message. +The payload received by the MQTT client is decrypted but encoded in Base64. You should decode it to get the original message (using for instance [[https://www.base64encode.org]])
 </WRAP> </WRAP>
  
Line 126: Line 118:
 <code> <code>
 { {
-    "reference": "abcd1234",                  // reference which will be used on ack or error (this can be a random string) 
     "confirmed": false,                        // whether the payload must be sent as confirmed data down or not     "confirmed": false,                        // whether the payload must be sent as confirmed data down or not
     "fPort": 10,                              // FPort to use (must be > 0)     "fPort": 10,                              // FPort to use (must be > 0)
Line 136: Line 127:
 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>
-===== -. LoRaWAN Milestones =====+===== -. LoRaWAN Challenges =====
 Implement and provide technical documentation for each of the following challenges. Implement and provide technical documentation for each of the following challenges.
 +
 ==== -. 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.
Line 145: Line 137:
  
 ==== -. The Radio Challenge ==== ==== -. The Radio Challenge ====
-I can tune the LoRa radio parameters and assess the results.+I can tune the LoRa radio parameters.
  
 These two commands can be helpful when used after the join event: These two commands can be helpful when used after the join event:
Line 153: Line 145:
 LMIC_setDrTxpow(DR_SF12,14); LMIC_setDrTxpow(DR_SF12,14);
 </code> </code>
 +
 ==== -. The Sensor Challenge ==== ==== -. The Sensor Challenge ====
 I can use different sensors to send data from the device: PIR, moisture, temperature, light, etc.  I can use different sensors to send data from the device: PIR, moisture, temperature, light, etc. 
  
  
exploring_lorawan.txt · Last modified: 2021/11/02 06:31 by samer