LoRaWAN for exploring the Internet of Things – Benedict Gaster (cuberoo_)

IoT means a different thing to different people, but it’s about connecting devices. Benedict is a bit doubtful about the current IoT devices, e.g. the Amazon device where you press a button to restock your washing powder. IoT really should change our lives. For example, devices that you parachute into a collapsed building to find where it is safe. Or keeping track of pollution in a city. But for those devices, it has to be easy to get online – connecting to Wifi isn’t easy enough. It really should be: turn it on and it is connected. For that, you need a long-range network.

Citizen Sensing Project is a little frog that measures humidity in houses, to put pressure on landlords to improve living conditions. First it had an SD card, but then people had to take it out and deliver it. Then Wifi but those houses don’t have Wifi.

Basic IoT connectivity is that the individual devices connect to gateways, and the gateway collect the data and send it to cloud services in the internet, where applications can access the data. The Things Network provides a decentralized cloud architecture for the backhaul. Gateways allow you to extend the network by installing more gateways. To connect the devices to the gateway you need a low-power WAN.

The devices have to live on battery for 5-10 years, so the communication really needs to be very low power. It also has to be long range (a few km), otherwise too many gateways have to be installed. It is very low bitrate. Many different technologies exist, with different trade-offs (Sigfox, LoRa, Ingenu).

Cell networks are very organised, you need to very carefully place the cell towers and do careful hand-off between them. This is driven by audio calls. So it is not something that ordinary people can set up. IoT networks, on the other hand, can be messy, because they only carry messages, not calls (or streams). Therefore they don’t need to be very intelligent about handoffs, they just have to forward packets. Therefore, the people can build IoT networks, there is no need for telcos to build infrastructure. The Things Network works like that.

LoRa is a commercial product developed by a French company. The radio stack is not open source, but it has been reverse-engineered and an SDR implementation exists. LoRaWAN is a MAC layer to extend the physical layer. It is an open spec controlled by the LoRa alliance. It has end-to-end encryption. It has adaptive data rate optimisation to reduce power consumption. It has QoS classes.

The LoRa mesh is a star-of-stars topology where the end user devices don’t contribute in the mesh. Communication is spread over different 125kHz channels and data rates. It uses pseudo-random channel switching to robustify against interference and to scale to many devices. It uses the 400MHz and 800-900MHz ISM bands. It has a maximum transmit duty cycle (1% for end devices, 10% for gateways) according to the EU fair use policy.

The radio chip on the device and gateway are the same. Radio chip costs about 8 euro including the software stack. Microchip RN2483 contains a LoRa chip + CortexM that runs the stack (not clear if it can be used for application code, but anyway not much memory left on the device). Connect it to a microcontroller over serial, run a stack from The Things Network on the device to read sensor data and send it to your applications. It’s really easy to build your own devices this way.

The gateway has a LoRa stack on one side and an IP stack on the other side. The Things Network has slightly tweaked the reference code from LoRa and sends everything to their cloud. Again, it’s very easy to build a gateway with off-the-shelf hardware (RPi) and software. The gateways are plotted on ttnmapper.org

The cloud backend is pretty complicated, with routers, brokers, data handlers and monitors/controllers. But you can look at that as a black box.

Benedict is building up LoRaWAN Bristol, an installation of gateways that can be used by any IoT device. The gateways have full-wavelength antenna’s so the end devices can use quarter-λ antennas and still get decent range.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s