How exactly does LoRa work transmission/reception ESP32

Hey. I am not familiar with LoRa network yet but I am reading more and more about it. I would like to implement my first lora transmit/receive on ESP32 microcontrollers. I have found this guide to explain how to get it running on ESP32 :

I have a few questions regarding LoRa though:

  1. How does LoRa transmission and reception work exactly? From the example codes for ESP32 microcontrollers I can see that one device just simply transmits data on the selected frequency, and the other ESP32 just picks that data up. I cannot get my head around that because that seems so unreliable. For example, what if by any chance my neighbour is running some program on his microcontroller to receive LoRa data on the same frequency that I am sending? Is he going to receive my data? What if I am sending some sensitive data and dont want anyone to be able to read it so easily?

  2. Is there any identifier? For example in modbus RTU every device has slave_ID so its very easy to keep track which device is sending some data or receiving data. What about LoRa. If I have 5 devices that are transmitting data, how will my server know which device is which one? I cant see any identifier based on the example code provided in my link

Appreciate any clarification. Thanks in advance

You are looking at basic Lora which is just a radio layer. This forum is dedicated to The Things Network which uses LoRaWAN which includes defined packet formats, addressing, encryption and more.

Can you explain a little bit more about that? Is it possible to achieve that on ESP32 or simmilar microcontrollers

There are posts here on implementing LoRaWAN on the ESP32. In fact here are quite a lot of them, as it’s proved to be a somewhat challenging platform on which to get things working. It would almost be fair to say that it’s not easy on any platform; but the ESP32 has some added complications in working a little bit differently from many other chips, so when porting software (all of it originally written for something else) there have been some unique quirks people have had to deal with.

Okay I understood. Thanks for the response. If you have any experience in microcontrollers, I was initially thinking between STM32 and ESP32, but everything seemed much more simple on the ESP32 than STM32 but im not so sure anymore.

Very much the opposite, once you get into a situation where details all the way up and down the stack need to be considered. Also, build time :wink:

Granted the ESP32 does have a lot of capability at a low price point, and if you need the WiFi it can make sense. But it’s a development process dominated by a very large amount of stock code you basically have to work within the norms of (norms for which typical LoRaWAN code was not written). The Arduino-on-ESP32 solution tries to hide some of that in the background, but incompletely, if one is going to use an ESP32 one should probably work with the ESP-IDF framework directly. It also has very limited and awkward transitions into and out of its low power mode. But people do it; there are many threads here on their progress.

STM32’s are in contrast very traditional MCU’s at a wide variety of price/performance/power points. And there are a far greater variety of software archiectures and development approaches that work. A particular STM32L073 (alas, under an Arduino approach) is also one of the two reference platforms for the MCCI branch of LMiC, which is the version that project currently seeing maintenance efforts.

Personally, I’d avoid doing WiFi or really any IP networking on an STM32 (been there, ouch!). But I’d avoid an ESP32 unless I needed to do those things. The cross-cases are certainly possible (IP networking on the STM32 often uses some of the same open source libraries as on the ESP32) it’s just that a bunch of factors from price to flexibility to power point in different directions for different applications.