ESP32-LoRa Heltec



ESP32 (32 bits, 2 cores, 180 MHz)
 * Connectivity
 * WiFi
 * BLE
 * LoRa (SX1276) 433MHz, 868MHz, 915MHz

Links
 * ESP32 WiFi LoRa
 * Diagram Pinout
 * Github

=Installation=


 * On MacOS

mkdir -p ~/Documents/Arduino/hardware cd ~/Documents/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

=Configuration=

=Programs=

Board 1 (Sender)
Open and load the schetch : Examples > LoRaLibrary > OLED_LoRa_Sender

Board 2 (Receiver)
Open and load the schetch : Examples > LoRaLibrary > OLED_LoRa_Receiver

Add LoRaWAN configuration
Add the following statements into the 2 schetches.

...

// LoRa API https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/esp32/libraries/LoRa/API.md

// LoRaWAN Parameters
 * 1) define BAND   868100000  //you can set band here directly,e.g. 868E6,915E6
 * 2) define PABOOST false
 * 3) define TXPOWER 14
 * 4) define SPREADING_FACTOR 12
 * 5) define BANDWIDTH 125000
 * 6) define CODING_RATE 5
 * 7) define PREAMBLE_LENGTH 8
 * 8) define SYNC_WORD 0x34

void configForLoRaWAN { LoRa.setTxPower(TXPOWER); LoRa.setSpreadingFactor(SPREADING_FACTOR); LoRa.setSignalBandwidth(BANDWIDTH); LoRa.setCodingRate4(CODING_RATE); LoRa.setPreambleLength(PREAMBLE_LENGTH); LoRa.setSyncWord(SYNC_WORD); LoRa.crc; }

String loraCfg = "Cfg:"; void displayLoRaConfig(int x, int y){ loraCfg = "fr " + String(BAND/1000000, DEC) + " sf" + String(SPREADING_FACTOR, DEC) + " bw" + String(BANDWIDTH/1000, DEC) + " cr" + String(CODING_RATE, DEC) + "/4"; display.drawString(x, y, loraCfg); loraCfg = + " pr" + String(PREAMBLE_LENGTH, DEC) + " pw" + String(TXPOWER, DEC) + " sw" + String(SYNC_WORD, HEX) ; display.drawString(x, y+10, loraCfg); }

...

// should be done before LoRa.begin configForLoRaWAN; if (!LoRa.begin(BAND,PABOOST)) { display.drawString(0, 0, "Starting LoRa failed!"); display.display; while (1); } displayLoRaConfig(0,20); display.drawString(0, 0, "LoRa Initial success!");

...

display.display; ...

Simple LoRaWAN Sender (in ABP mode / No ADR)
Under construction

Install LMIC

 * https://github.com/berkutta/esp32_lmic
 * https://github.com/espressif/esp-idf
 * https://github.com/matthijskooijman/arduino-lmic

=Misc=
 * https://github.com/unprovable/LoRaChat
 * https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic/10247/18