What is the difference between LoRa and LoRaWAN?
LoRa is the radio technique: a modulation that spreads a narrow signal so widely that it is still detected even below the noise. That gains range and costs data rate. LoRaWAN is the network protocol on top. It governs how devices join, how the data is encrypted and how it gets from the gateway to the network server. More in the article LoRa or LoRaWAN?.
How is a LoRaWAN network structured?
- End device: the meter or sensor. It sends its data by radio without being assigned to a particular gateway.
- Gateway: receives all LoRa packets within range and forwards them over Ethernet or mobile network to the network server.
- Network server: checks the packets, removes those received twice and manages devices and keys. Examples are The Things Network and ChirpStack.
- Application server: decrypts the payload and passes it on to your system via MQTT, HTTP or an API.
The payload is encrypted twice with AES-128: once for the network and once end to end for the application. The gateway does not see the content.
How does a device join: OTAA or ABP?
With OTAA (over-the-air activation), the device sends a join request with DevEUI and JoinEUI. The network server checks it with the AppKey and assigns new session keys. With ABP (activation by personalization), the session keys are stored permanently in the device. OTAA is more secure and the usual route.
What do classes A, B and C mean?
| Class | Reception | Power consumption | Typical use |
|---|---|---|---|
| A | two short receive windows after each transmission | very low | battery-powered sensors, water meters |
| B | additional receive windows on a schedule | low | devices that receive commands at fixed times |
| C | reception open almost continuously | higher | mains-powered devices such as power meters |
What range does LoRaWAN have?
Outdoors several kilometres are usual, in the countryside with a clear line of sight considerably more. Inside buildings the range is shorter: concrete ceilings, metal doors and meter cabinets attenuate the signal strongly, and basements are often the most difficult. A gateway in the building or an external antenna on the meter usually solves this.
How far a packet gets also depends on the spreading factor, SF7 to SF12. A higher spreading factor reaches further but takes longer to transmit and so uses more of the limited airtime. With ADR (adaptive data rate), the network server chooses for each device the lowest spreading factor that still arrives reliably.
Why does LoRaWAN not deliver values every second?
In the EU868 band a device may transmit at most 1 % of the time in most sub-bands. At a high spreading factor a single packet can take over a second, and the pause afterwards is correspondingly long. For meters this is no drawback: one value every 15 minutes is enough for billing and load profiles.
A LoRaWAN packet is also only a few dozen bytes in size and binary-coded. To turn the bytes into meter readings, the network or application server needs a decoder for the device in question. How this works is shown in the article Decoding the LoRa payload.
LoRaWAN with EMU devices
The EMU Professional II power meter with LoRa works to LoRaWAN 1.0.3 in class C, joins via OTAA by default and sends import and export per tariff every 15 minutes. It is available with an internal antenna or additionally with an SMA connector for an external antenna.
For The Things Network there is a device template, and we provide the decoder on GitHub. The guide is at EMU Professional II LoRa in The Things Network. If you do not want to run a network server of your own, you can receive the values directly in Joulio-Web with its integrated network server.