Difference between revisions of "LoRa research"

From Woodland Harvest Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
LoRa technology was developed by a company called Semtech and it is a new wireless protocol designed specifically for long-range, low-power communications. LoRa stands for Long Range Radio and is mainly targeted for M2M and IoT networks. This technology will enable public or multi-tenant networks to connect a number of applications running on the same network [^digikey-lora].
+
LoRa technology was developed by a company called Semtech and it is a new wireless protocol designed specifically for long-range, low-power communications. LoRa stands for Long Range Radio and is mainly targeted for M2M and IoT (internet of things) networks [^digikey-lora]. In the US, LoRa communication works on 915 Mhz, which is a license free spectrum.  
  
For different types of arduino, we can use a long range transciever LoRa shield called the [^dragino-lora].
+
For different types of Arduino, we can use a long-range transceiver LoRa shield called the [Dragino shield](https://wiki.dragino.com/index.php?title=Lora_Shield)[^dragino-lora].
  
## Set up LoRa on your laptop
+
## LoRa
 +
For a large amount of differently placed sensors and devices, it is recommended to set up a LoRaWAN network. However, if you seek to establish simple device-to-device communication for a separate system, LoRa with the RadioHead library works great.
  
1. Get the RadioHead library from [http://www.airspayce.com/mikem/arduino/RadioHead/](http://www.airspayce.com/mikem/arduino/RadioHead/). There is a link with the ending _.zip_ that you can click to download.
+
The RadioHead library from [www.airspayce.com](http://www.airspayce.com/mikem/arduino/RadioHead/) works for communication between two devices, a server and a client. If you want to install the RadioHead library, click on the link with the ending _.zip_ on the previously mentioned website.</br>
 +
Then, add the library to your Arduino IDE. Once added, you can open the example file under examples --> radiohead --> rf95 --> client or server</br>
 +
In the (example) sketch, make sure to assign LED to something other than 9. If set to 9, the restart of the LoRa board will be triggered.
  
2. Add the library to your Arduino IDE. Once added, you can open the example file under examples --> radiohead.  
+
## LoRa WAN
 +
[[File:LoRaWANSystemDiagram.JPG|750px]]
 +
 
 +
LoRa WAN is the internet-based version of LoRa. While LoRa communication only works between generally two devices, LoRa WAN can communicate between hundreds of devices by the means of a gateway. LoRa WAN consists of end-nodes and at least one gateway. Communication between the gateway and the nodes is bidirectional and based on LoRa radio communication.
 +
 
 +
__List of tutorial videos on some useful related LoRa WAN subjects__
 +
 
 +
[LGo1-N configuration](https://www.youtube.com/watch?v=BqUpkWl_EsQ)</br>
 +
[LoRa Wan tutorial](https://www.youtube.com/watch?v=VldgrTKdAqo)</br>
 +
[LG01-N gateway setup](https://www.youtube.com/watch?v=VJEOu2AATXU)</br></br>
 +
 
 +
[Different device types - Class A,B,C - Youtube tutorial](https://www.youtube.com/watch?v=ShJ5RERof5I)</br>
 +
[Fresnel zone](https://www.youtube.com/watch?v=HWOivbJjw7s)</br>
 +
[EIRP and ERP](https://www.youtube.com/watch?v=LEucMthGJtc)</br>
 +
[RSSI and SNR](https://www.youtube.com/watch?v=RpTw1fGhI68)</br>
 +
[LoRa Packet Format, Time on Air and Adaptive Data Rate](https://www.youtube.com/watch?v=C_Rh5GSENA4)</br>
 +
[Different types of LoRa chips](https://www.youtube.com/watch?v=0FaFVD5fedc&list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g&index=18)</br>
 +
[LoRa End Node Libraries](https://www.youtube.com/watch?v=0dnnqToK28A&list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g&index=20)
 +
 
 +
## Gateway
 +
 
 +
A gateway can be  a [LG01-N Single Channel Gateway](https://www.seeedstudio.com/LG01-N-Single-Channel-LoRa-IoT-Gateway-p-2935.html). It works in a LoRaWAN setup and communicates with the nodes. In a LoRaWAN setup, the nodes don't communicate with each other. A gateway creates a connection with the internet and uploads the data to a platform such as TheThingsNetwork (TTN). This is a potential great opportunity for improving the current system at the farm.</br>
 +
[[File:DraginoLG01-N.JPG|250px]]
  
3. In the (example) sketch, make sure to assign LED to something other than 9. If set to 9, the restart of the LoRa board will be triggered.
 
  
 
## Nanopb protocol buffer
 
## Nanopb protocol buffer
  
This [_dfrobot_ tutorial](https://www.dfrobot.com/blog-1161.html) leads you through installing the Nanopb library and compiler on your laptop. _Nanopb_ is a version of the protocol buffer in the programming language C, which works well with 32 bit systems such as the Arduino. You can use [this online proto buffer decoder](https://protogen.marcgravell.com/decode) to decode proto buffer messages that were encoded for sending.  
+
Protocol buffers are a data serialization format from Google which are supported in multiple programming languages. Protocol Buffers messages are encoded in a binary format, which means they are not human-readable unless we decode them back to a readable format. One of the main advantages of using Protocol Buffers is that the serialization and deserialization process is fast and the generated messages are small.[^protob]  _Nanopb_ is a version of the protocol buffer in the programming language C, which works well with 32 bit systems such as the Arduino.
 +
 
 +
This [_dfrobot_ tutorial](https://www.dfrobot.com/blog-1161.html) leads you through installing the Nanopb library and compiler on your laptop. You can use [this online proto buffer decoder](https://protogen.marcgravell.com/decode) to decode proto buffer messages that were encoded for sending.  
  
Protocol buffers are a data serialization format from Google which are supported in multiple programming languages. Protocol Buffers messages are encoded in a binary format, which means they are not human-readable unless we decode them back to a readable format. One of the main advantages of using Protocol Buffers is that the serialization and deserialization process is fast and the generated messages are small.[^protob] The Nanopb library needs a `.proto` file that clarifies the variables that will be serialized. Once, the different types of variables are serialized or encoded, they are unreadable for humans in a binary format. This number is expressed as a hexadecimal that can easily be sent over wireless radio as it requires small amounts of data.  
+
The Nanopb library needs a `.proto` file that clarifies the variables that will be serialized. Once, the different types of variables are serialized or encoded, they are unreadable for humans in a binary format. This number is expressed as hexadecimal that can easily be sent over wireless radio as it requires small amounts of data.  
  
 
The encoded message needs to be decoded on the side of the receiver. The receiver also needs to know the specific variable types in the message to properly decode the message. The [abovementioned tutorial](https://www.dfrobot.com/blog-1161.html) only walks you through setting up the Nanopb environemnt on your laptio and encoding a message. A [different tutorial by _dfrobot_ shows how to encode and decode messages between an Arduino and ESP32](http://dfrobot.blogspot.com/2019/02/esp32-arduino-tutorial-25-3-protocol.html).  
 
The encoded message needs to be decoded on the side of the receiver. The receiver also needs to know the specific variable types in the message to properly decode the message. The [abovementioned tutorial](https://www.dfrobot.com/blog-1161.html) only walks you through setting up the Nanopb environemnt on your laptio and encoding a message. A [different tutorial by _dfrobot_ shows how to encode and decode messages between an Arduino and ESP32](http://dfrobot.blogspot.com/2019/02/esp32-arduino-tutorial-25-3-protocol.html).  

Latest revision as of 16:12, 13 April 2021

LoRa technology was developed by a company called Semtech and it is a new wireless protocol designed specifically for long-range, low-power communications. LoRa stands for Long Range Radio and is mainly targeted for M2M and IoT (internet of things) networks 1. In the US, LoRa communication works on 915 Mhz, which is a license free spectrum.

For different types of Arduino, we can use a long-range transceiver LoRa shield called the Dragino shield2.

LoRa

For a large amount of differently placed sensors and devices, it is recommended to set up a LoRaWAN network. However, if you seek to establish simple device-to-device communication for a separate system, LoRa with the RadioHead library works great.

The RadioHead library from www.airspayce.com works for communication between two devices, a server and a client. If you want to install the RadioHead library, click on the link with the ending .zip on the previously mentioned website.
Then, add the library to your Arduino IDE. Once added, you can open the example file under examples --> radiohead --> rf95 --> client or server
In the (example) sketch, make sure to assign LED to something other than 9. If set to 9, the restart of the LoRa board will be triggered.

LoRa WAN

LoRaWANSystemDiagram.JPG

LoRa WAN is the internet-based version of LoRa. While LoRa communication only works between generally two devices, LoRa WAN can communicate between hundreds of devices by the means of a gateway. LoRa WAN consists of end-nodes and at least one gateway. Communication between the gateway and the nodes is bidirectional and based on LoRa radio communication.

List of tutorial videos on some useful related LoRa WAN subjects

LGo1-N configuration
LoRa Wan tutorial
LG01-N gateway setup

Different device types - Class A,B,C - Youtube tutorial
Fresnel zone
EIRP and ERP
RSSI and SNR
LoRa Packet Format, Time on Air and Adaptive Data Rate
Different types of LoRa chips
LoRa End Node Libraries

Gateway

A gateway can be a LG01-N Single Channel Gateway. It works in a LoRaWAN setup and communicates with the nodes. In a LoRaWAN setup, the nodes don't communicate with each other. A gateway creates a connection with the internet and uploads the data to a platform such as TheThingsNetwork (TTN). This is a potential great opportunity for improving the current system at the farm.
DraginoLG01-N.JPG

Nanopb protocol buffer

Protocol buffers are a data serialization format from Google which are supported in multiple programming languages. Protocol Buffers messages are encoded in a binary format, which means they are not human-readable unless we decode them back to a readable format. One of the main advantages of using Protocol Buffers is that the serialization and deserialization process is fast and the generated messages are small.3 Nanopb is a version of the protocol buffer in the programming language C, which works well with 32 bit systems such as the Arduino.

This dfrobot tutorial leads you through installing the Nanopb library and compiler on your laptop. You can use this online proto buffer decoder to decode proto buffer messages that were encoded for sending.

The Nanopb library needs a .proto file that clarifies the variables that will be serialized. Once, the different types of variables are serialized or encoded, they are unreadable for humans in a binary format. This number is expressed as hexadecimal that can easily be sent over wireless radio as it requires small amounts of data.

The encoded message needs to be decoded on the side of the receiver. The receiver also needs to know the specific variable types in the message to properly decode the message. The abovementioned tutorial only walks you through setting up the Nanopb environemnt on your laptio and encoding a message. A different tutorial by dfrobot shows how to encode and decode messages between an Arduino and ESP32.

References