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 09:16] – samer | esib_iot_challenge [2017/05/17 22:27] – [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 ===== |
- | Here below you can find a detailed description of the experimental platform implementing an end-to-end LoRaWAN solution. The platform consists of the following elements: | + | During this challenge, |
* 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 13: | Line 13: | ||
[{{ : | [{{ : | ||
- | ===== -. Devices ===== | ||
- | ==== -. Autonomo with LoRaBee ==== | ||
- | Starting | + | <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 | ||
+ | * 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? | ||
+ | </WRAP> | ||
+ | ===== -. Backend ===== | ||
+ | In a LoRaWAN network, the devices communicate | ||
- | In order to configure the Autonomo with LoRaBee device, you should follow these steps: | + | [{{ :app-loraserver.png? |
- | | + | Start by choosing the application named '' |
- | - Install the board files as noted in [[http:// | + | * A unique node name: '' |
- | - Add the following library {{ :sodaq_rn2483_2.zip |}} to your Arduino IDE as explained in [[https:// | + | * The node description |
- | + | * A unique device EUI on 64 bits: Random identifiers can be generated on [[https:// | |
- | Now you are ready to write a sketch for the device. Here is one example sketch {{ :test-lorawan-combined-loraserver-example.zip |}} where the autonomo is connected to three sensors: light, moisture, and temperature. Let us analyse some extracts of the code. | + | * The application EUI on 64 bits: '' |
- | + | * A unique application key on 128 bits also obtained by random generation. | |
- | In this part, you should put the keys for Over-The-Air Activation (OTAA) as explained in the {{ : | + | |
- | <code c++> | + | |
- | // USE YOUR OWN KEYS! | + | |
- | const uint8_t devEUI[8] = | + | |
- | { }; | + | |
- | + | ||
- | // USE YOUR OWN KEYS! | + | |
- | const uint8_t appEUI[8] = | + | |
- | { }; | + | |
- | + | ||
- | const uint8_t appKey[16] = | + | |
- | { }; | + | |
- | </ | + | |
- | The pins for connecting | + | Make sure that the '' |
- | <code c++> | + | |
- | int light_pin = A0; | + | |
- | int moisture_pin = A2; | + | |
- | int temperature_pin = 0; | + | |
- | int temperature_vcc_pin = 1; | + | |
- | int moisture_vcc_pin = 8; | + | |
- | int moisture_gnd_pin = 7; | + | |
- | </ | + | |
- | The OTAA method | + | <WRAP left round help 100%> |
- | <code c++> | + | * What does the application EUI mean? How is it used in LoRaWAN? |
- | LoRaBee.initOTA(loraSerial, | + | * What does the application key mean? How is it used in LoRaWAN security? |
- | </code> | + | * 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? | ||
+ | </WRAP> | ||
+ | ===== -. Devices ===== | ||
- | Eight different sub channels | + | Devices in the LoRaWAN platform |
- | <code c++> | + | |
- | LoRaBee.configChFreq(0, | + | |
- | LoRaBee.configChFreq(1, | + | |
- | LoRaBee.configChFreq(2, | + | |
- | LoRaBee.configChFreq(3, | + | |
- | LoRaBee.configChFreq(4, | + | |
- | LoRaBee.configChFreq(5, | + | |
- | LoRaBee.configChFreq(6, | + | |
- | LoRaBee.configChFreq(7, | + | |
- | </ | + | |
- | Finally, | + | Start by verifying |
- | <code c++> | + | |
- | LoRaBee.send(1, (uint8_t*)message.c_str(), | + | |
- | </code> | + | |
- | ==== -. Arduino | + | |
- | === -. Periodic Message Sending === | + | |
- | 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 | + | <WRAP left round help 100%> |
+ | * Give the characteristics of the Arduino you are using: model, number | ||
+ | * Give the main characteristics of the LoRa shield from Dragino (www.dragino.com). | ||
+ | * 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 (as in the Autonomo case): | + | static const u1_t PROGMEM APPKEY[16] = { }; |
- | <code c++> | + | void os_getDevKey |
- | LMIC_setTxData2(1, (uint8_t*) buffer, message.length() | + | |
</ | </ | ||
- | The adaptive data rate is not supported, | + | <WRAP left round tip 100%> |
- | <code c++> | + | Note that the device |
- | LMIC_setDrTxpow(DR_SF7,14); | + | </WRAP> |
- | </code> | + | |
- | === -. Triggered Message Sending === | + | Let us analyze to radio parameters in the sketch by answering the following questions. |
- | You can also find another example of sketch to download: {{ : | + | <WRAP left round help 100%> |
- | ===== -. Gateways ===== | + | * In the setup function, which channels are activated on the device? |
- | ==== -. Single Channel Gateway ==== | + | * What are the different spreading factors on each channel? |
+ | * What is the regulation | ||
+ | </ | ||
- | The single channel gateway includes | + | The LMIC library defines |
- | [{{ : | + | <WRAP left round help 100%> |
+ | * What is the difference between the JOINING and the JOINED events? | ||
+ | * When is the EV_TXCOMPLETE event called? | ||
+ | </ | ||
- | In order to assemble | + | Finally let us look at the message sending on the device. |
- | [{{ : | + | |
- | [{{ : | + | |
- | Connect | + | <WRAP left round help 100%> |
- | * Enable SPI on the Raspberry Pi using raspi-config | + | * What is the function for sending messages on the device? How it is called? |
- | * Download and unzip the source code: | + | * What is the period |
+ | * Is this period guaranteed according to the LoRaWAN specification? | ||
+ | </ | ||
- | <code bash> | + | 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 '' |
- | wget https:// | + | |
- | unzip master.zip | + | |
- | </ | + | |
- | * Install | + | Open the serial monitor in the Arduino IDE at 115200 baud and analyse the debug messages. |
- | <code bash> | + | <WRAP left round help 100%> |
- | apt-get update | + | * What is the radio transmit parameters of the captured debug messages? |
- | apt-get install wiring | + | * What is the radio receive parameters of the captured debug messages for the two receive windows? |
- | </code> | + | </WRAP> |
+ | ===== -. 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. The tool is provided at the beginning of the challenge. After starting the application, | ||
- | Compile the packet forwarder: | + | <WRAP left round help 100%> |
- | <code bash> | + | * Summarize the concepts and functionalities of the MQTT protocol. |
- | make all | + | * What are the possible strengths and weaknesses in terms of security of MQTT? |
- | </code> | + | * 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> | ||
+ | ===== -. The End-to-End Challenge ===== | ||
- | For gcc version 4.6.3, a compilation error results in the following warning '' | + | ===== -. The Downlink Challenge ===== |
- | < | + | |
- | CFLAGS | + | |
- | </ | + | |
- | Now, you need to configure the single channel packet forwarder. This is done in the {{ : | + | ===== -. The Radio Challenge ===== |
- | + | ||
- | Finally, you can run the packet forwarder as root! | + | |
- | + | ||
- | <code bash> | + | |
- | nohup ./ | + | |
- | </ | + | |
- | ==== -. Kerlink IoT Station | + | |
< | < | ||
- | # activates eth0 at startup | + | // LMIC_disableChannel(1); |
- | ETHERNET=yes | + | // LMIC_disableChannel(2); |
- | # claims dhcp request on eth0 | + | // LMIC_disableChannel(3); |
- | ETHDHCP=yes | + | // LMIC_disableChannel(4); |
- | + | // LMIC_disableChannel(5); | |
- | # Selector operator APN | + | // LMIC_disableChannel(6); |
- | GPRSAPN=gprs.touch.com.lb | + | // LMIC_disableChannel(7); |
- | # Enter pin code if activated | + | // |
- | GPRSPIN=0000 | + | // LMIC_setDrTxpow(DR_SF10,14); |
- | # Update | + | |
- | GPRSDNS=yes | + | |
- | # PAP authentication | + | |
- | GPRSUSER= | + | |
- | GPRSPASSWORD= | + | |
- | + | ||
- | # Bearers priority order | + | |
- | # | + | |
- | BEARERS_PRIORITY=" | + | |
</ | </ | ||
< | < | ||
- | ./gps-pkt-fwd.sh > /dev/null & | + | { |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | } | ||
</ | </ | ||
- | |||
- | < | ||
- | 3270 root 2548 S /bin/sh ./ | ||
- | 3288 root 34908 S ./ | ||
- | </ | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | [root@Wirgrid_0b03008c demo_gps_loramote]# | ||
- | pppd (pid 5273) is running... | ||
- | Session: Rx=58, Tx=163 | ||
- | Globals: Rx=1130457, Tx=1195592 | ||
- | Sum: | ||
- | [root@Wirgrid_0b03008c demo_gps_loramote]# | ||
- | </ | ||
- | |||
- | ===== -. Backend ===== | ||
- | ==== -. Loraserver ==== | ||
- | |||
- | The Loraserver has a web interface for configuring the applications and devices on the platform. Full details for installing the software are provided on [[https:// | ||
- | |||
- | [{{ : | ||
- | |||
- | Start by creating and application as in Figure 5. Then create a node in this application and provide the following information: | ||
- | * 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: 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 '' | ||
- | |||
- | |||
- | ==== -. The Things Network ==== | ||
- | |||
- | ===== -. Applications ===== | ||
- | ==== -. mqtt-spy ==== | ||
- | |||
- | 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. For this, you should download the software tool from [[https:// | ||
- | ==== -. Emoncms ==== |
esib_iot_challenge.txt · Last modified: 2021/08/28 09:53 by samer