LoRaWAN devices can actually communicate with each other directly, without needing to go through a gateway or the network server at all.

Let’s see this in action. Imagine two LoRaWAN end devices, EndDeviceA and EndDeviceB, both configured to use the same LoRaWAN frequency plan and network. We’ll set them up to use LoRa’s built-in Class C communication, which means they’re always listening for incoming messages.

First, we need to provision them with their unique keys and device addresses, just like any other LoRaWAN device. For EndDeviceA to send a message to EndDeviceB, it doesn’t need to know EndDeviceB’s network server registration or its specific uplink path. Instead, EndDeviceA can be configured to transmit a LoRa packet on a specific channel and spreading factor. EndDeviceB, if it’s also listening on that same channel and spreading factor, will receive the packet. The crucial part is that both devices must be configured with the same LoRa parameters for this direct communication:

  • Frequency: Both devices must be set to the same carrier frequency (e.g., 915 MHz in US915 band).
  • Spreading Factor (SF): This determines how long a bit is transmitted. Higher SF means longer range but lower data rate. For direct communication, both devices need to agree on an SF (e.g., SF7, SF10).
  • Bandwidth (BW): LoRaWAN typically uses 125 kHz bandwidth. Both devices should use this.
  • Coding Rate (CR): This adds redundancy for error correction. A common CR is 4/5. Both devices should use the same CR.

Here’s a simplified conceptual example of how EndDeviceA might send a "ping" to EndDeviceB using LoRa’s physical layer, bypassing the typical LoRaWAN stack for this specific hop:

On EndDeviceA (using a hypothetical LoRa radio library):

from lorapy import LoRaRadio

radio = LoRaRadio()
radio.set_frequency(915e6) # 915 MHz
radio.set_spreading_factor(10)
radio.set_bandwidth(125e3) # 125 kHz
radio.set_coding_rate(4/5)

payload = b"PING_DIRECT"
radio.send(payload)

On EndDeviceB (also using a hypothetical LoRa radio library):

from lorapy import LoRaRadio

radio = LoRaRadio()
radio.set_frequency(915e6) # 915 MHz
radio.set_spreading_factor(10)
radio.set_bandwidth(125e3) # 125 kHz
radio.set_coding_rate(4/5)

# Enter receive mode
radio.receive()

while True:
    if radio.packet_received():
        data = radio.read_packet()
        print(f"Received direct message: {data.decode()}")
        # Optionally send a reply back using the same direct method
        break

This direct communication is not part of the LoRaWAN network protocol’s defined message flow for application data, but it leverages the underlying LoRa modulation and the device’s radio capabilities. It’s often used for device-to-device discovery, simple sensor readings between nearby devices, or even basic mesh networking setups before data is sent up to the network server. The key is that the devices are configured to use the same physical layer parameters, acting like two amateur radio operators tuning to the same frequency and using the same modulation settings. The LoRaWAN stack on each device is still present and manages its connection to the network server for standard uplink/downlink traffic, but the radio hardware itself can be used for these ad-hoc, peer-to-peer LoRa transmissions.

What most people miss is that LoRaWAN end devices, by default, are configured to use specific channels and spreading factors for communicating with gateways. To enable direct device-to-device communication, you must explicitly configure the radio on both devices to use identical, often non-standard LoRaWAN channels (or a shared channel outside the typical LoRaWAN channel plan) and matching physical layer parameters (SF, BW, CR) that might differ from their standard network communication settings. This direct transmission does not use LoRaWAN frame formats or security mechanisms; it’s a raw LoRa packet.

The next hurdle you’ll face is implementing a protocol on top of these direct LoRa transmissions to ensure reliable delivery, handle acknowledgments, and manage potential collisions if multiple devices try to talk at once.

Want structured learning?

Take the full Computer Networking course →