exploring_lorawan
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
exploring_lorawan [2018/10/29 11:48] – [3. Devices] samer | exploring_lorawan [2021/11/02 06:29] – [2. Backend] samer | ||
---|---|---|---|
Line 3: | Line 3: | ||
In this lab, you will be designing and prototyping the first IoT services based on a LoRaWAN network. | In this lab, you will be designing and prototyping the first IoT services based on a LoRaWAN network. | ||
- | ===== -. Platform ===== | + | ===== - Platform ===== |
During this lab, you will benefit from the first experimental platform implementing an end-to-end LoRaWAN solution in Lebanon. The platform consists of the following elements: | During this lab, you will benefit from the first experimental platform implementing an end-to-end LoRaWAN solution in Lebanon. The platform consists of the following elements: | ||
Line 13: | Line 13: | ||
[{{ : | [{{ : | ||
+ | |||
+ | {{ : | ||
<WRAP center round help 100%> | <WRAP center round help 100%> | ||
Line 19: | Line 21: | ||
* What elements are IP enabled in the platform? What do you think about IP support in IoT? | * What elements are IP enabled in the platform? What do you think about IP support in IoT? | ||
</ | </ | ||
- | ===== -. Backend ===== | + | ===== - Backend ===== |
- | In a LoRaWAN network, the devices communicate with a Network Server through the gateway. The backend installed in the platform is based on an open-source LoRaWAN network-server https:// | + | In a LoRaWAN network, the devices communicate with a Network Server through the gateway. The backend installed in the platform is based on an open-source LoRaWAN network-server https:// |
- | [{{ :app-loraserver.png? | + | [{{::iot-course2122.png? |
- | Start by choosing the application named '' | + | Start by choosing the application named '' |
- | * A unique device name: '' | + | * A unique device name: '' |
* The device description | * The device description | ||
- | * A unique device EUI on 64 bits: Random identifiers can be generated | + | * A unique device EUI on 64 bits: click on the circular arrow to generate a random |
* 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 36: | Line 38: | ||
* Compare the two device activation methods used in LoRaWAN by giving the advantages and shortcomings. | * Compare the two device activation methods used in LoRaWAN by giving the advantages and shortcomings. | ||
</ | </ | ||
- | ===== -. Devices ===== | + | ===== - Devices ===== |
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:// | + | Start by verifying the installation on your PC of the latest Arduino IDE. Unzip the Arduino {{ :mcci_lorawan_lmic_library.zip |LMIC library}} and copy it to your sketchbook library folder as detailed in [[https:// |
- | Now you should configure your device with the same identifiers | + | Now you should configure your device with the same identifiers '' |
<code c++> | <code c++> | ||
- | static const u1_t PROGMEM APPEUI[8]= { }; | + | // Change this! |
- | void os_getArtEui (u1_t* buf) { memcpy_P(buf, | + | // 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, | void os_getDevEui (u1_t* buf) { memcpy_P(buf, | ||
+ | // 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, | void os_getDevKey (u1_t* buf) { memcpy_P(buf, | ||
Line 57: | Line 58: | ||
<WRAP left round tip 100%> | <WRAP left round tip 100%> | ||
- | Note that the application key is in big endian format. Hence, the key '' | + | Note that the device EUI should be in little |
</ | </ | ||
- | Let us analyze | + | Let us analyze |
<WRAP left round help 100%> | <WRAP left round help 100%> | ||
Line 68: | Line 69: | ||
</ | </ | ||
- | The LMIC library defines a set of events corresponding to the protocol machine state. These events appear in the '' | + | The LMIC library |
<WRAP left round help 100%> | <WRAP left round help 100%> | ||
Line 83: | Line 84: | ||
</ | </ | ||
- | 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 '' | + | Now you are ready to compile the sketch and upload it to the LoRaWAN device. Connect the device |
- | < | + | < |
- | For Arduino | + | Debugging causes memory problems on Arduino |
</ | </ | ||
Line 92: | Line 93: | ||
<WRAP left round help 100%> | <WRAP left round help 100%> | ||
- | * What is the radio transmit parameters of the captured | + | * Explain |
- | * What is the radio receive parameters of the captured debug messages for the two receive windows? | + | |
</ | </ | ||
- | Getting back to the backend, you can monitor some important information related to your device. Click on the corresponding | + | Getting back to the backend, you can monitor some important information related to your device. Click on the corresponding |
<WRAP left round help 100%> | <WRAP left round help 100%> | ||
- | * What are the different fields that appear in the node session | + | * What are the different fields that appear in the device activation |
* 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. | ||
</ | </ | ||
- | ===== -. Applications ===== | ||
- | 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, | ||
- | You can use mqtt-spy to debug the messages received from the LoRaWAN devices. After starting the application, | + | The backend also enables to capture LoRaWAN frames. Click on '' |
+ | |||
+ | <WRAP left round help 100%> | ||
+ | * Explain the different fields in the packet header. | ||
+ | * What are the parameters of the LoRa modulation? Explain. | ||
+ | * What is the value of the payload? | ||
+ | </ | ||
+ | |||
+ | ===== - Applications ===== | ||
+ | |||
+ | <WRAP center round todo 60%> | ||
+ | If you have an android smartphone, download mqtt dashboard and try it! | ||
+ | Do not forget user credentials. | ||
+ | </ | ||
+ | |||
+ | 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, | ||
+ | |||
+ | You can use mqtt-spy to debug the messages received from the LoRaWAN devices. After starting the application, | ||
<WRAP left round help 100%> | <WRAP left round help 100%> | ||
Line 116: | Line 131: | ||
<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 |
</ | </ | ||
- | If you need to send data to your device, you should publish an encoded message in the corresponding topic '' | + | If you need to send data to your device, you should publish an encoded message in the corresponding topic '' |
< | < | ||
{ | { | ||
- | " | ||
" | " | ||
" | " | ||
Line 133: | Line 147: | ||
The payload sent by the MQTT client must be encoded in Base64. | The payload sent by the MQTT client must be encoded in Base64. | ||
</ | </ | ||
- | ===== -. LoRaWAN Challenges ===== | + | |
+ | You can also download a {{ : | ||
+ | ===== - 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. | ||
- | ==== -. The Downlink Challenge ==== | + | <WRAP center round tip 100%> |
+ | Note that the '' | ||
+ | </ | ||
+ | |||
+ | ==== - The Downlink Challenge ==== | ||
I can send data from the application to the device. | I can send data from the application to the device. | ||
- | ==== -. The Radio Challenge ==== | + | ==== - The Radio Challenge ==== |
I can tune the LoRa radio parameters. | I can tune the LoRa radio parameters. | ||
Line 152: | Line 172: | ||
</ | </ | ||
- | ==== -. The Sensor Challenge ==== | + | ==== - The Sensor Challenge ==== |
I can use different sensors to send data from the device: PIR, moisture, temperature, | I can use different sensors to send data from the device: PIR, moisture, temperature, | ||
+ | <WRAP center round important 100%> | ||
+ | When connecting sensors, check the pin mapping for unused pins https:// | ||
+ | </ | ||
exploring_lorawan.txt · Last modified: 2021/11/02 06:31 by samer