esib_iot_challenge
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
esib_iot_challenge [2017/05/17 10:26] – samer | esib_iot_challenge [2017/05/17 22:44] – [4. Applications] samer | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ESIB IoT Challenge ====== | ====== ESIB IoT Challenge ====== | ||
- | Welcome to the ESIB IoT Challenge. In this challenge, you will designing and prototyping the first IoT services based on a LoRaWAN network. | + | Welcome to the ESIB IoT Challenge. In this challenge, you will be designing and prototyping the first IoT services based on a LoRaWAN network. |
- | ===== -. What is a LoRaWAN | + | ===== -. Platform ===== |
- | In this challenge, 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 |
* Devices that communicate to one or more gateways via a wireless interface using single hop LoRa and implementing the LoRaWAN protocol. These devices are physically connected to sensors that generate data. | * Devices that communicate to one or more gateways via a wireless interface using single hop LoRa and implementing the LoRaWAN protocol. These devices are physically connected to sensors that generate data. | ||
Line 14: | Line 14: | ||
[{{ : | [{{ : | ||
+ | <WRAP center round help 100%> | ||
+ | * Where is the LoRa modulation implemented on the platform? | ||
+ | * What are the advantages of the LoRa modulation? | ||
+ | * How LoRa is compatible with LPWAN requirements and constraints? | ||
+ | * What is LoRaWAN? What is the difference between LoRaWAN and LoRa? | ||
+ | * Illustrate the protocol stacks on the LoRaWAN platform. | ||
+ | * What elements are IP enabled in the platform? What do you think about IP support in IoT? | ||
+ | </ | ||
+ | ===== -. 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:// | ||
+ | |||
+ | [{{ : | ||
+ | |||
+ | Start by choosing the application named '' | ||
+ | * A unique node name: '' | ||
+ | * The node description | ||
+ | * A unique device EUI on 64 bits: Random identifiers can be generated on [[https:// | ||
+ | * The application EUI on 64 bits: '' | ||
+ | * A unique application key on 128 bits also obtained by random generation. | ||
+ | |||
+ | Make sure that the '' | ||
+ | |||
+ | <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? | ||
+ | * Compare the two device activation methods used in LoRaWAN by giving the advantages and inconvenients. | ||
+ | * What is the difference between the two receive windows in LoRaWAN? What are they used for? | ||
+ | </ | ||
===== -. Devices ===== | ===== -. Devices ===== | ||
- | In orde to program | + | Devices in the LoRaWAN |
- | * Arduino IDE | + | Start by verifying the installation on your PC of the latest |
- | * LMIC Library | + | |
- | Devices in the LoRaWAN platform are implemented on Arduino | + | <WRAP left round help 100%> |
+ | * Give the characteristics of the Arduino | ||
+ | * Give the main characteristics | ||
+ | * What type of Antenna are you using? Explain | ||
+ | </ | ||
- | The pin mapping corresponds to the Dragino electronic schematic: | + | Now you should configure your device with the same identifiers '' |
- | <code c++> | + | |
- | const lmic_pinmap lmic_pins = { | + | |
- | .nss = 10, | + | |
- | .rxtx = LMIC_UNUSED_PIN, | + | |
- | .rst = 9, | + | |
- | .dio = {2, 6, 7}, | + | |
- | }; | + | |
- | </ | + | |
- | The send function is rescheduled TX_INTERVAL seconds after each transmission complete event: | ||
<code c++> | <code c++> | ||
- | case EV_TXCOMPLETE: | + | static const u1_t PROGMEM APPEUI[8]= { }; |
- | Serial.println(F(" | + | void os_getArtEui |
- | if(LMIC.dataLen) { | + | |
- | // data received in rx slot after tx | + | |
- | Serial.print(F(" | + | |
- | Serial.write(LMIC.frame+LMIC.dataBeg, LMIC.dataLen); | + | |
- | Serial.println(); | + | |
- | | + | |
- | // Schedule next transmission | + | |
- | os_setTimedCallback(& | + | |
- | break; | + | |
- | </ | + | |
- | The send function is initially scheduled here: | + | // This should also be in little endian format, see above. |
- | <code c++> | + | static const u1_t PROGMEM DEVEUI[8]= { }; |
- | do_send(& | + | void os_getDevEui |
- | </ | + | |
- | The message containing the sensor values is transmitted on one of the radio channels: | + | static const u1_t PROGMEM APPKEY[16] = { }; |
- | <code c++> | + | void os_getDevKey |
- | LMIC_setTxData2(1, (uint8_t*) buffer, message.length() | + | |
</ | </ | ||
- | === -. Triggered Message Sending === | + | <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, '' | ||
+ | </ | ||
- | You can also find another example of sketch | + | Let us analyze |
- | ===== -. Backend ===== | + | <WRAP left round help 100%> |
- | The Loraserver has a web interface for configuring | + | * In the setup function, which channels are activated |
+ | * What are the different spreading factors | ||
+ | * What is the regulation on the radio channels in LoRa? | ||
+ | </WRAP> | ||
- | [{{ : | + | The LMIC library defines a set of events corresponding to the protocol machine state. These events appear in the '' |
- | Start by creating and application as in Figure 5. Then create a node in this application and provide the following information: | + | <WRAP left round help 100%> |
- | * A unique node name | + | * What is the difference between the JOINING and the JOINED events? |
- | * The node description | + | * When is the EV_TXCOMPLETE event called? |
- | * A unique device EUI on 64 bits: Random identifiers can be generated on [[https:// | + | </WRAP> |
- | * The application EUI on 64 bits: this can be a common identifier for all nodes using the same application. | + | |
- | * A unique application key on 128 bits | + | |
- | In order to enable OTAA join method, you have to make sure that the '' | + | Finally let us look at the message sending on the device. |
- | ===== -. Applications ===== | + | <WRAP left round help 100%> |
- | ==== -. mqtt-spy ==== | + | * What is the function for sending messages on the device? How it is called? |
+ | * What is the period of message sending? Explain the implementation choice. | ||
+ | * Is this period guaranteed according to the LoRaWAN specification? | ||
+ | </ | ||
+ | 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 '' | ||
+ | |||
+ | Open the serial monitor in the Arduino IDE at 115200 baud and analyse the debug messages. | ||
+ | |||
+ | <WRAP left round help 100%> | ||
+ | * What is the radio transmit parameters of the captured debug messages? | ||
+ | * 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 node session. | ||
+ | |||
+ | <WRAP left round help 100%> | ||
+ | * What are the different fields that appear in the node session corresponding to you device? | ||
+ | * 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. | ||
+ | </ | ||
+ | ===== -. 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, | 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. | + | You can use mqtt-spy to debug the messages received from the LoRaWAN devices. |
- | ==== -. Emoncms | + | |
+ | <WRAP left round help 100%> | ||
+ | * Summarize the concepts and functionalities of the MQTT protocol. | ||
+ | * What are the possible strengths and weaknesses in terms of security of MQTT? | ||
+ | * What are the different types of topics used by the backend? Explain. | ||
+ | * Explain the different fields in a captured MQTT message received from you device. | ||
+ | </ | ||
+ | |||
+ | <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 End-to-End Challenge | ||
+ | |||
+ | ===== -. The Downlink Challenge ===== | ||
+ | |||
+ | ===== -. The Radio Challenge ===== | ||
+ | |||
+ | < | ||
+ | // LMIC_disableChannel(1); | ||
+ | // LMIC_disableChannel(2); | ||
+ | // LMIC_disableChannel(3); | ||
+ | // LMIC_disableChannel(4); | ||
+ | // LMIC_disableChannel(5); | ||
+ | // LMIC_disableChannel(6); | ||
+ | // LMIC_disableChannel(7); | ||
+ | // LMIC_disableChannel(8); | ||
+ | // LMIC_setDrTxpow(DR_SF10, | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ |
esib_iot_challenge.txt · Last modified: 2021/08/28 09:53 by samer