Skip to content
dernasherbrezon edited this page May 12, 2024 · 17 revisions

r2cloud supports LoRa-based communication using lora-at. It can work in several modes

lora-at-wifi

In this mode lora-at connects to the WiFi network and starts the web server. Pros: ESP board can be installed anywhere within WiFi network range, doesn't depend on r2cloud installation. Cons: requires separate power supply and WiFi router.

lora-at-wifi

lora-at

lora-at controls LoRa transceiver via AT commands. That means ESP board have to be connected to r2cloud using serial interface. Pros: no additional power supply, no WiFi or router, lower power consumption. Cons: ESP board must be installed alongside r2cloud.

lora-at

lora-at-ble

lora-at can work in the low energy mode. In that mode ESP32 is in deep sleep most of the time and consume ~6nA. Periodically ESP32 wakes up and read the next observation via bluetooth using BLE profile (bluetooth low energy). r2cloud can schedule observations and implement that protocol to work over bluetooth. Currently it can expose GATT services via dbus/bluez. This is stack most commonly used in Linux.

lora deep sleep

Pros:

  • No need for wires. ESP32 can be installed remotely (~10m)
  • ESP32 can be powered via solar panels
  • No additional routers or cables needed

Cons:

  • Only Linux is supported
  • r2cloud should have bluetooth module on board. Installed by default on all Raspberry PI

lora-at-blec

lora-at can be controlled via bluetooth. In that mode ESP32 start bluetooth server and listen for incoming requests. r2cloud creates BLE client and schedule observations by writing data to specific BLE characteristics. BLE client connects to ESP32 server via dbus/bluez. This is stack most commonly used in Linux.

lora deep sleep

Pros:

  • No need for wires. ESP32 can be installed remotely (~10m)
  • ESP32 can expose additional BLE characteristics like battery level and solar panel parameters
  • No additional routers or cables needed

Cons:

  • Only Linux is supported
  • r2cloud should have bluetooth module on board. Installed by default on all Raspberry PI
  • ESP32 consume more energy because bluetooth server must always be up

LoRa-AT configuration

Connect ESP32 via USB to the Raspberry PI and configure using AT commands:

pio device monitor --port /dev/ttyUSB0 --baud 115200 --echo --filter esp32_exception_decoder

Enter deep sleep configuration:

AT+DSCONFIG=B8:27:EB:6C:7C:F8,10800000,30000

Where:

  • B8:27:EB:6C:7C:F8 - is the bluetooth address of the r2cloud device. Can be obtained using hciconfig command.
  • 10800000 - deep sleep period (milliseconds). ESP32 will periodically wake up to check new schedule or start observation. Whatever happens first
  • 30000 - inactivity timeout (milliseconds) before device will go to deep sleep cycle. In the deep sleep cycle it won't accept any AT commands and only hard reset will return to the main loop.

More details can be found in the lora-at documentation.

After everything configured lora-at will start sending its battery status and bluetooth signal strength:

Screenshot 2022-12-27 at 10 23 45

Operations

LoRa-based observations don't have spectrum waterfall, because LoRa transceivers return demodulated and decoded bytes, not the raw IQ file.

LoRa protocol is very sensitive and require much simple antenna. However LNA or rotator is recommended to archive best performance.

Screenshot 2022-01-26 at 14 46 01
Clone this wiki locally