-
-
Notifications
You must be signed in to change notification settings - Fork 31
LoRa
r2cloud supports LoRa-based communication using lora-at. It can work in several modes
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.
Edit user-specific configuration at ~/.r2cloud and add the following lines:
loraatwifi.devices=0
loraatwifi.device.0.host=lora-at.local
loraatwifi.device.0.port=80
loraatwifi.device.0.username=
loraatwifi.device.0.password=
loraatwifi.device.0.rotctrld.hostname=
loraatwifi.device.0.rotctrld.port=
loraatwifi.device.0.rotctrld.timeout=
loraatwifi.device.0.rotator.tolerance=
loraatwifi.device.0.rotator.cycleMillis=
loraatwifi.devices should contain comma-separated list of indexes to lora configurations. r2cloud can support any number of boards simultaneously. It will discover supported frequencies on each device and will schedule satellites that match the band. For example, it is possible to configure 2 LoRa boards for 433Mhz and 868Mhz frequency band and support all possible LoRa satellites. If 2 devices have the same frequency bands, then satellites will be scheduled in a round-robin fashion.
loraatwifi.device.0.host - is a host assigned to the board (default lora-at.local)
loraatwifi.device.0.port - is a port assigned to the board (default 80)
loraatwifi.device.0.username and loraatwifi.device.0.password - mandatory username and password to access.
It is possible to configure rotator for each LoRa device using Manual configuration.
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.
Edit user-specific configuration at ~/.r2cloud and add the following lines:
loraat.devices=0
loraat.device.0.port=/dev/ttyUSB0
loraat.device.0.gain=
loraat.device.0.rotctrld.hostname=
loraat.device.0.rotctrld.port=
loraat.device.0.rotctrld.timeout=
loraat.device.0.rotator.tolerance=
loraat.device.0.rotator.cycleMillis=
lora-at configuration is similar to r2lora above. The only difference is loraat.device.0.port - should be ESP device.
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.
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
Edit user-specific configuration at ~/.r2cloud and add the following lines:
loraatble.devices=0
loraatble.device.0.btaddress=78:dd:08:a3:a7:52
loraatble.device.0.gain=0
loraatble.device.0.rotctrld.hostname=
loraatble.device.0.rotctrld.port=
loraatble.device.0.rotctrld.timeout=
loraatble.device.0.rotator.tolerance=
loraatble.device.0.rotator.cycleMillis=
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
hciconfigcommand. - 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:
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.