wikiroute

networking recipes

User Tools

Site Tools


reliable_lora_communication

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
reliable_lora_communication [2016/07/19 19:25] – [6. Modifying the Radio Parameters] samerreliable_lora_communication [2016/10/12 15:08] (current) – removed samer
Line 1: Line 1:
-====== Simple Prototype of LoRa Communications ====== 
  
-===== -. Hardware and Cost ===== 
- 
-  * Arduino Uno or Mega (x2) for [[https://www.amazon.fr/SODIAL-ATmega2560-Microcontroleur-Arduino-Module/dp/B00OPO44UE/ref=sr_1_3?ie=UTF8&qid=1468680586&sr=8-3&keywords=arduino+mega | 10 USD]]. 
-  * Dragino shields (x2) for [[http://www.aliexpress.com/store/product/Long-distance-wireless-lora-shield-for-Arduino-Leonardo-UNO-Mega2560-Duemilanove-Due/1390863_32591527766.html|20 USD]]. 
-  * 868 MHz Antenna (x2) for [[http://fr.farnell.com/rf-solutions/ant-8whip3h-sma/ant-868mhz-whip-hinged-sma-3dbi/dp/2305899?MER=BN-2305899| 5 USD]]. 
- 
-===== -. Software ===== 
- 
-  * RadioHead: The Packet Radio library for embedded microprocessors can be downloaded from [[http://www.airspayce.com/mikem/arduino/RadioHead/]] or from this [[http://www.airspayce.com/mikem/arduino/RadioHead/RadioHead-1.61.zip|direct link]].  
-  * Arduino IDE: Specific OS versions can be downloaded from [[https://www.arduino.cc/en/Main/Software]].  
- 
-===== -. Compatibility ===== 
- 
-This tutorial is written for : 
-  * Arduino IDE 1.6.9. 
-  * RadioHead 1.61. 
-  * Dragino hardware release v1.3.  
-  * Mac OS 10.11.5. 
- 
-Beware of the necessary modifications, if any of the previous specifications is not supported in your case. 
-===== -. Installation ===== 
- 
-Start by plugging the Dragino shields on the Arduino devices and mounting the antennas as shown in Fig. 1. 
- 
-[{{ :dragino-arduino-mega.jpg?nolink&300 |Figure 1. Arduino with LoRa Dragino shield.}}] 
- 
-Connect the two Arduino devices to USB ports on your computer. If this is the first time you use Arduino IDE, make sure to install the necessary USB drivers by selecting ''Tools'' > ''Boards Manager'' and installing Arduino AVR boards. 
- 
-Now, you have to select the corresponding ''Board'' and ''Port'' in the ''Tools'' menu to program your Arduino. For example, you can use the following: 
- 
-  * For Arduino Uno: Board = Arduino/Genuino Uno Mega, Port = /dev/cu.wchusbserial1420. 
-  * For Arduino Mega: Board = Arduino/Genuino Mega 2560, Port = /dev/cu.usbmodem141511. 
- 
-Unzip the RadioHead library and copy it to your sketchbook library folder as detailed in [[https://www.arduino.cc/en/Guide/Libraries]]. 
- 
- 
-===== -. Running Basic Sketches ===== 
-Start by setting the central frequency of the LoRa modules. For this, open the ''RH_RF95.cpp'' file and change the frequency to 868.1 Mhz: 
- 
-<file cpp RH_RF95.cpp> 
-setFrequency(868.1); 
-</file> 
- 
-Download the {{ :client-server-reliable-lora.zip | basic sketches}} that implement a reliable LoRa communication between the two modules. Open the sketches with Arduino IDE, compile and upload on the two arduino modules, respectively. On the serial interfaces, you should obtain similar results as in Fig. 2.  
-===== -. Modifying the Radio Parameters ===== 
- 
-Bw125Cr48Sf4096 
-Bw = 125 kHz, Cr = 4/8, Sf = 4096chips/symbol, CRC on. Slow+long range 
- 
-RH_RF95.cpp 
-//setModemConfig(Bw125Cr45Sf128); // Radio default 
-setModemConfig(Bw125Cr48Sf4096); // slow and reliable? 
- 
-RHReliableDatagram.h 
-#define RH_LONG_TIMEOUT 8000 
- 
-RHReliableDatagram.cpp 
- 
-RHReliableDatagram::RHReliableDatagram(RHGenericDriver& driver, uint8_t thisAddress)  
-    : RHDatagram(driver, thisAddress) 
-{ 
-    _retransmissions = 0; 
-    _lastSequenceNumber = 0; 
-    //_timeout = RH_DEFAULT_TIMEOUT; 
-    _timeout = RH_LONG_TIMEOUT; 
-    _retries = RH_DEFAULT_RETRIES; 
-} 
reliable_lora_communication.1468949133.txt.gz · Last modified: 2016/07/19 19:25 (external edit)