How does LoRa work in ESP32

Thread Starter


Joined Nov 29, 2015
Hey. I want to try to make low power device based on ESP32 to send readings to the server.
I have come across this tutorial that describes how to get lora working on ESP32:

Lora reicever function:
void getLoRaData() {
  Serial.print("Lora packet received: ");
  // Read packet
  while (LoRa.available()) {
    String LoRaData = LoRa.readString();
    // LoRaData format: readingID/temperature&soilMoisture#batterylevel
    // String example: 1/27.43&654#95.34
    // Get readingID, temperature and soil moisture
    int pos1 = LoRaData.indexOf('/');
    int pos2 = LoRaData.indexOf('&');
    int pos3 = LoRaData.indexOf('#');
    readingID = LoRaData.substring(0, pos1);
    temperature = LoRaData.substring(pos1 +1, pos2);
    humidity = LoRaData.substring(pos2+1, pos3);
    pressure = LoRaData.substring(pos3+1, LoRaData.length());   
  // Get RSSI
  rssi = LoRa.packetRssi();
  Serial.print(" with RSSI ");   
What are the indexes '/' , '&' . and '#'.

Also, I am mainly concerned how does it understand which transceiver is sending the data? What if I have multiple LORA transceivers and want to just receive from one of them? How do I ignore the rest? What if I am sending/receiving some sensitive data and my neighbour has LORA receiver on the same frequency band? Is he also gonna receive the message?

For example. in MODBUS RTU we have slave ID, thats how we determine to which and from which device to read/send data. I am not certain how do we determine that in LoRa

Thread Starter


Joined Nov 29, 2015
Sounds like you have a lot of learning and reading to do!

I recommend:

and read the datasheet for the ESP32 LoRa and chip.

Same as we all do to learn these things.
Thanks for pointing me to this website. The key bit that I was hoping to find: LoRa.setSyncWord(0xF3);

Anyways, I should look more at LoRaWAN. But I dont know if that is a simple thing to implement on ESP32 or simmilar modules.