ESP32 LoRa Tutorial
This article based on heltec WiFi Kit 32. This a board based on ESP32 with WiFi, Bluetooth, LoRa. In the post “ESP32 LoRa Tutorial” you can learn how to use Lora with ESP32. Remember : LoRa is not available in Every ESP32 Board. I used Heltec WiFi 32 and TTGO LoRa 868 Boaard in this tutorial.
Specs
- Frequency: 240MHz
- FLASH:64M-bits
- The processor: 2个Tensilica LX6 + 1个ULPThe processor
- Main control chip:ESP32
- LoRachip support frequency band: SX1276(868-915、923MHz);SX1278(433-510MHz)
- Open communication distance:3KM
- Computing power:As high as 600 dmips
- Dual mode bluetooth: Traditional bluetooth and BLE low power bluetooth
- The development environment:Perfect support for Arduino
- Working voltage: 3.3v~ 7v
- Operating range temperature:-40~80℃
- Receiver sensitivity:-139dbm(SF12, BW125KHz)
- UDP continuous throughput:135Mbps
- USB-to-UART bridge chip:CP2102
- WIFI Support mode:sniffer、Station、softAP和Wi-Fi Direct
Recommended : Dynamic WLAN configuration for ESP32 Board | AutoConnect
Installation Instructions using Arduino IDE
Based on Arduino source codes and toolchain for WiFi_Kit_series made by HelTecAutomation. Visit this github link https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series.
Tested on 32 and 64 bit Windows 10 machines
- Download and install the latest Arduino IDE
Windows Installer
from arduino.cc - Download and install Git from git-scm.com
- If you don’t install Git,you choose
dowload zip
from the home page and Unzip the file to/Documents/Arduino/hardware/heltec
,Skip steps three to step four
- Execute the command under the \Documents\Arduino\hardware path Start
Git Bash
and run through the following steps:- Input
git clone https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series.git heltec
- Input
- Open
/Documents/Arduino/hardware/heltec/esp32/tools
and double-clickget.exe
- When
get.exe
finishes, you should see the following files in the directory - Plug your ESP32 board and wait for the drivers to install (or install manually any that might be required)
- Start Arduino IDE
- Select your board in
Tools > Board
menuWiFi_Kit_32
orWiFi_LoRa_32
- Select the COM port that the board is attached to
- Compile and upload (You might need to hold the
PRG
button while uploading)
How to update to the latest code
- Open
/Documents/Arduino/hardware/heltec
created startGit Bash
and inputgit pull
! - Wait for git to pull any changes and close
Git Bash
- Open
/Documents/Arduino/hardware/heltec/esp32/tools
and double-clickget.exe
Installation instructions for Debian / Ubuntu OS
- Install latest Arduino IDE from arduino.cc
- Open Terminal and execute the following command (copy->paste and hit enter):
sudo usermod -a -G dialout $USER && \ sudo apt-get install git && \ wget https://bootstrap.pypa.io/get-pip.py && \ sudo python get-pip.py && \ sudo pip install pyserial && \ mkdir -p ~/Arduino/hardware && \ cd ~/Arduino/hardware && \ git clone https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series.git heltec && \ cd heltec/esp32 && \ git submodule update --init --recursive && \ cd tools && \ python get.py && \ cd ~/Arduino/hardware/heltec/esp8266 && \ git submodule update --init --recursive && \ cd tools && \ python get.py
- Restart Arduino IDE
- If you have Arduino.app installed to /Applications/, modify the installation as follows, beginning at
mkdir -p ~/Arduino...
:
cd /Applications/Arduino_*/Contents/java/
mkdir -p hardware && \
cd hardware && \
git clone https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series.git heltec && \
cd heltec/esp32 && \
git submodule update --init --recursive && \
cd tools && \
python get.py && \
cd /Applications/Arduino_*/Contents/java/hardware/heltec/esp8266 && \
git submodule update --init --recursive && \
cd tools && \
python get.py
WiFi LORA 32 V2 Pinout Diagram
ESP32 LoRa Tutorial
What is LoRa?
LoRa is a wireless data communication technology that uses a radio modulation technique that can be generated by Semtech LoRa transceiver chips. LoRa allows long range communication of small amounts of data (which means a low bandwidth), high immunity to interference, while minimizing power consumption. So, it allows long distance communication with low power requirements.
LoRa Frequencies
LoRa uses unlicensed frequencies that are available worldwide. These are the most widely used frequencies:
- 868 MHz for Europe
- 915 MHz for North America
- 433 MHz band for Asia
Because these bands are unlicensed, anyone can freely use them without paying or having to get a license. Check the frequencies used in your country.
LoRaWAN
You can also build a LoRa network using LoRaWAN. The LoRaWAN protocol is a Low Power Wide Area Network (LPWAN) specification derived from LoRa technology standardized by the LoRa Alliance. We won’t explore LoRaWAN in this tutorial, but for more information you can check the LoRa Alliance and The Things Network websites.
Now i have TTGO lora 868. you can use this board If you successfully installed WiFi 32 kit. because this compatible with above configuration.
How to Use Lora 868 Module with Arduino IDE
- Open Arduino IDE
- Click Tools Tab and select “WiFi_Lora_32”Board.
- Click Tools tab and Select Port.
- Now Go to File>Example> Lora Library and select Lora Sender example program and Flash it.
- Now Flash Lora Receiver Program in another Board.
- Open Serial Monitor For logs.
Similarly you can try another Examples.
I hope you like this post “ESP32 LoRa Tutorial”. If have a query related to this post “ESP32 LoRa Tutorial”. Do you have any questions? Leave a comment down below!Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.
there doesn’t appear to be a .ino file to download in this article
In this article, i am using examples that provided by lora library.
Pingback: GPIO Pins of ESP32 | ESP32 Tutorials - IoTbyHVM - Bits & Bytes of IoT