What LoRaWAN is
LoRa is a way of modulating a radio signal. LoRaWAN is the protocol on top of it: the rules by which thousands of devices share the same air without interfering, and by which their data reaches the application protected. The two are often confused — the first is the radio, the second is the network.
The whole point is a trade: speed is given up to buy distance and battery life. A few bytes an hour instead of megabits a second — but from kilometres away, on a battery that lasts years. For a sensor whose job is to say “the level is 1.25 metres”, that is exactly the right deal.
LoRaWAN does not replace Wi-Fi or mobile internet. It carries no video and no voice. It carries measurements and commands — where a cable cannot reach and a SIM card per device would be money thrown away.
The path of one reading
- The end device measures and transmits. The rest of the time its radio sleeps — that is where the long battery life comes from.
- The gateway hears everything within range and passes it on. It decides nothing; it only listens and forwards.
- The network server discards duplicates when several gateways heard the same packet, checks integrity and puts things in order.
- The application receives finished values and decides what to do — display, store, raise an alarm, start a pump.
One device can be heard by several gateways at once. That is not a problem but an advantage: the server keeps the best copy and throws away the rest. Coverage therefore improves by adding gateways, without touching a single device in the field.
Range and data rate
The device chooses how “slowly” to speak. The slower it speaks, the further it is heard and the more air time it occupies. The figures below are for the European 868 MHz band.
| Spreading | Rate | Typical range | Suited to |
|---|---|---|---|
| SF7 | 5470 bps | up to 2 km | dense urban coverage |
| SF9 | 1760 bps | 2 – 5 km | suburbs, industrial sites |
| SF10 | 980 bps | 5 – 8 km | open country |
| SF12 | 250 bps | 10 – 15 km | line of sight, edge points |
These are guidance, not a promise. Real range depends on terrain, antenna height and what stands between the two points. One hill between gateway and sensor takes away more than any setting can add.
Device classes
Class A
The device speaks when it decides to and listens only briefly afterwards. The most economical mode — and the most used. A command waits for its next transmission.
Class B
It also opens an ear on a schedule synchronised by the gateway. A command reaches it within a predictable time, at a small cost in battery.
Class C
It listens continuously — a command arrives at once. The radio never sleeps, so this is for mains-powered devices: controllers and actuators.
Security
Every packet is encrypted with AES-128, on two levels, with two different keys. One protects the link between device and network, the other the payload up to the application. The split has an exact purpose: the network operator carries the data without being able to read it.
Joining uses a key written into the device at manufacture (OTAA). New session keys are agreed at every join, so a recorded old exchange is useless to an eavesdropper. Frame counters reject a replayed record.
Mobile app
The system is not watched from a computer only. There are apps for Android and iPhone — the same data, the same commands, in your pocket.
- A live diagram of the site — levels, pumps, valves, status.
- An alarm notification at once, not at the next opening.
- Switching between automatic and manual mode, with confirmation.
- History by day and week, to see whether a problem repeats.
- Several sites in one account, with separate rights for each.
Network server
The network server for our installations is at my.lorawan-bg.net. Devices are registered there, packets are watched live, alarm rules are set, and you can see which gateways hear which device and how strongly.