iot_leb_hackathon
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
iot_leb_hackathon [2019/03/03 13:14] – [3. Devices] samer | iot_leb_hackathon [2021/08/28 09:55] (current) – samer | ||
---|---|---|---|
Line 7: | Line 7: | ||
In the evolution towards the Internet of Things, an increasing number of devices equipped with sensors and communication interfaces will interact and collect data, communicate over the internet, and provide valuable monitoring and automation services. IoT-Leb Hackathon is a unique opportunity to get acquainted with the technologies that are set to play an essential role in the IoT landscape. During the Hackathon, you will get exclusive access to the latest IoT technologies. | In the evolution towards the Internet of Things, an increasing number of devices equipped with sensors and communication interfaces will interact and collect data, communicate over the internet, and provide valuable monitoring and automation services. IoT-Leb Hackathon is a unique opportunity to get acquainted with the technologies that are set to play an essential role in the IoT landscape. During the Hackathon, you will get exclusive access to the latest IoT technologies. | ||
- | ===== -. 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 19: | Line 19: | ||
[{{ : | [{{ : | ||
- | ===== -. 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:// | ||
Line 27: | Line 27: | ||
* 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 on [[https:// | + | * A unique device EUI on 64 bits |
- | * A unique application key on 128 bits also obtained by random generation. | + | * A unique application key on 128 bits |
Make sure to choose '' | Make sure to choose '' | ||
- | ===== -. Devices ===== | + | ===== - Devices ===== |
Devices in the LoRaWAN platform are implemented on [[https:// | Devices in the LoRaWAN platform are implemented on [[https:// | ||
- | Start by verifying the installation on your PC of the latest Arduino IDE and the presence of the LoRaWAN {{ : | + | Start by verifying the installation on your PC of the latest Arduino IDE and the presence of the LoRaWAN {{ : |
Now you should configure your device with the same identifiers '' | Now you should configure your device with the same identifiers '' | ||
<code c++> | <code c++> | ||
- | // Change this! | + | // This EUI must be in little-endian format, |
- | // This should | + | // first. When copying an EUI from loraserver, this means to reverse |
- | static const u1_t PROGMEM DEVEUI[8]= { }; | + | // the bytes. |
+ | 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! | + | // This key should be in big endian format (or, since it is not really a |
- | static const u1_t PROGMEM APPKEY[16] = { }; | + | // number but a block of memory, endianness does not really apply). In |
- | void os_getDevKey (u1_t* buf) { memcpy_P(buf, | + | // practice, a key taken from loraserver can be copied as-is. |
+ | |||
+ | static const u1_t PROGMEM APPKEY[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // MSB mode | ||
+ | void os_getDevKey (u1_t* buf) { memcpy_P(buf, | ||
</ | </ | ||
Line 54: | Line 58: | ||
</ | </ | ||
- | The LMIC library (see {{ : | + | The LMIC library (see {{ : |
- | <WRAP left round help 100%> | + | The '' |
- | * What is the difference between the JOINING and the JOINED events? | + | |
- | * When is the EV_TXCOMPLETE event called? | + | |
- | </ | + | |
- | + | ||
- | Finally let us look at the message sending on the device. | + | |
- | + | ||
- | <WRAP left round help 100%> | + | |
- | * 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 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! | + | 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 ('' |
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. | ||
Getting back to the backend, you can monitor some important information related to your device such as the activation status, frame counters, and live data. | Getting back to the backend, you can monitor some important information related to your device such as the activation status, frame counters, and live data. | ||
- | ===== -. Applications | + | ===== - Capturing Received Messages |
- | mqtt-spy is an open source | + | mqtt.fx is a 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. |
- | You can use mqtt-spy to debug the messages received from the LoRaWAN devices. After starting the application, | + | You can use mqtt.fx to debug the messages received from the LoRaWAN devices. After starting the application, |
- | <WRAP left round help 100%> | + | The payload received by the MQTT client is decrypted but encoded |
- | * Summarize the concepts and functionalities of the MQTT protocol. | + | ===== - Sending Downlink Data ===== |
- | * What are the possible strengths and weaknesses | + | |
- | * What are the different types of topics used by the backend? Explain. | + | |
- | * Explain | + | |
- | </ | + | |
- | <WRAP left round tip 100%> | + | If you need to send data to your device, you should publish an encoded message in the corresponding topic '' |
- | 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:// | + | |
- | </ | + | |
- | + | ||
- | If you need to send data to your device, you should publish an encoded message in the corresponding topic '' | + | |
< | < | ||
- | { | + | {" |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
</ | </ | ||
- | <WRAP left round tip 100%> | + | Note that the payload |
- | The payload sent by the MQTT client must be encoded in Base64. | + | |
- | </WRAP> | + | |
- | You can also download a {{ : | ||
- | ===== -. LoRaWAN Challenges ===== | ||
- | Implement and provide technical documentation for each of the following challenges. | ||
- | |||
- | ==== -. The End-to-End Challenge ==== | ||
- | I can send data from the device to the application. | ||
- | |||
- | <WRAP center round tip 100%> | ||
- | Note that the '' | ||
- | </ | ||
- | |||
- | ==== -. The Downlink Challenge ==== | ||
- | I can send data from the application to the device. | ||
- | |||
- | ==== -. The Radio Challenge ==== | ||
- | I can tune the LoRa radio parameters. | ||
- | |||
- | These two commands can be helpful when used after the join event: | ||
- | |||
- | <code c++> | ||
- | LMIC_disableChannel(N); | ||
- | LMIC_setDrTxpow(DR_SF12, | ||
- | </ | ||
- | ==== -. The Sensor Challenge ==== | ||
- | I can use different sensors to send data from the device: PIR, moisture, temperature, | ||
iot_leb_hackathon.1551615270.txt.gz · Last modified: 2019/03/03 13:14 by samer