Overview
The LoRaComV2 module provides simplified LoRa communication with support for point-to-point messaging, multi-node networks, and acknowledged transmissions. It handles packet structuring, addressing, and reliability.Basic Send/Receive
This example demonstrates bidirectional LoRa communication with callbacks.Complete Basic Example
Acknowledged Transmissions
Reliable message delivery with automatic acknowledgments and retries.Sender Node
Receiver Node
LoRa Configuration
Spreading Factor (SF)
Trade-off between range and data rate:Bandwidth
Affects sensitivity and data rate:Transmit Power
Set output power (2-20 dBm):Range Presets
Pre-configured settings for different scenarios:lora-comv2_lora-range-presets.ino for details.
Data Handling
Adding Data
Parsing Received Data
Get Complete Data String
Signal Quality Monitoring
Multi-Node Networks
Build networks with multiple LoRa nodes:lora-comv2_mesh-node-example.ino for mesh networking.
Key Methods
| Method | Description |
|---|---|
init(cs, reset, irq, freq, callback) | Initialize LoRa module |
configure(sf, bw, power) | Set radio parameters |
enableCRC() | Enable error checking |
setNodeId(id) | Set node identifier |
clearData() | Clear send buffer |
addData(value) | Add data to buffer |
sendData() | Transmit data |
sendDataCb(callback) | Send with callback |
receive(callback) | Check for incoming data |
sendMessageToNode(id, msg) | Send to specific node |
sendDataAndWaitResponse(timeout, retries) | Send with ACK |
packetRssi() | Get signal strength |
packetSnr() | Get signal quality |
getStrData(data, index) | Parse string field |
getData(data, index) | Parse numeric field |
Hardware Requirements
- LoRa module (SX1276/SX1278)
- SPI connection to microcontroller
- Antenna (matched to frequency)
Supported Modules
- SX1276/SX1278 (Semtech)
- RFM95/RFM96/RFM98 (HopeRF)
- EByte E220 (with lora-ebyte-e220 library)
Source Files
Example files located at:- Basic:
example/modules/communication/wireless/lora/EXAMPLE-lora-comv2/lora-comv2_basic-send-receive-example/ - Acknowledged:
example/modules/communication/wireless/lora/EXAMPLE-lora-comv2/lora-comv2_acknowledged-sender-example/ - Range presets:
example/modules/communication/wireless/lora/EXAMPLE-lora-comv2/lora-comv2_lora-range-presets/