A free and open LoRaWAN data network for IoT applications in West Yorkshire
One of the biggest challenges with connected devices is in providing connectivity itself. This is not so much a problem when they are located in the home or office — given the availability of power, always on broadband connections and WiFi — but it's a very different story when they are situated outdoors and in many cases, far from the nearest supply of mains power and wired connectivity.
GSM and 3G modems can be used to provide remote network access, but these are relatively power hungry and mean that in the absence of mains power, much larger batteries and/or renewable sources such as solar PV may be needed. Not to mention that each device will also require a SIM card and data contract. Which may be fine if the application can bear the associated costs.
Perhaps the greatest breakthrough for the IoT in recent years is the development of wireless systems that can achieve ranges of at least a few kilometres, and much longer in a line of sign situation, while operating on an impressively modest power budget and using unlicensed spectrum. One such system is LoRaWAN, a Low Power Wide Area Network designed for battery operated things.
The Things Network
A great feature of LoRaWAN is that anyone can set up a gateway and there are solutions available from numerous different manufacturers. So you don't have to wait for the network to come to you — you can build the network yourself. Something that the originators of The Things Network in Amsterdam used to their advantage, crowdsourcing a complete city-wide network in only 6 weeks and achieving this with just 10 gateways. On the back of this success they have now taken their campaign worldwide, supporting the growth of grassroots LoRaWAN networks across the globe.
More than simply a crowdsourced data network, The Things Network is a free and open data network. Meaning that you do not have to pay for a subscription or data charges in order to connect to and use the network. Of course, there are constraints and devices and applications can only send small amounts of data, a certain number of times a day. Which is perfectly sufficient for a great many IoT applications and means that individual gateways can support thousands of nodes.
But what does The Things Network actually comprise of?
The current network architecture is considered a prototype. With this gateways bridge the wired and wireless networks, forwarding packets over UDP to an instance of the “Croft” software, that then enqueues messages on a RabbitMQ server (a “message broker”). These messages are then in turn consumed by an instance of the “Jolie” software, which stores message data using InfluxDB (a time-series database). This data can then be exposed via different mechanisms and APIs etc.
A new architecture is also under active development and at the time of writing comprises of:
IoT devices. The end nodes, typically situated remotely and running on battery power.
Gateways. Bridging wireless and wired networks, and connecting to “routers”.
Routers. Relaying messages to/from “handlers” and verifying transport layer integrity.
Handlers. Performing any final decryption and interfacing with application servers.
Application servers. Like IoT devices, the function depends on your application!
An important aspect of this is that it can operate in a decentralised manner, and while you could use services hosted by The Things Network, you don't have to and can host your own.
Out-of-the-box support is also provide for using certain gateway hardware, while others may require some development or configuration. E.g. to run gateway and packet forwarding software.
Foundations for a flood network
The severe flooding that Calderdale — an area in West Yorkshire, in the North of England — suffered on 26th December 2015 and also back in 2012, provided the motivation for setting up a Things Network community to build a LoRaWAN network for the area. Since this would allow us to deploy many more Flood Network sensors than we could using a simpler wireless technology with a far shorter range, or sensors that made use of commercial cellular networks for backhaul.
To find out more about Flood Network and our initial experiences deploying the first sensor, which actually uses an older/simpler wireless system, see my colleague, Stuart's, blog post on this.
Just today we received a prototype kit for the new LoRaWAN version of the Flood Network sensor and look forward to putting this through its paces very soon!
Although there are numerous turnkey LoRaWAN gateways available, we decided to build our own based on a concentrator PCB assembly from IMST, plus a Raspberry Pi 2 Model B. This would mean that we had a familiar host platform for running Linux, gateway and packet forwarding etc. software, with plenty of spare processor, storage and GPIO resources available for future uses.
LoRaWAN can use radio links on a number of sub-1 GHz bands, with those available for use and corresponding EIRP limits etc. depending upon where you a located in the world. Here in the UK we have 868MHz spectrum available for license exempt use and the IMST IC880 module operates in this band, supporting up to 8 concurrent channels and in theory up to circa 20,000 nodes!
The radio module interfaces with the Raspberry Pi via SPI and antennas are connected via U.FL.
Perf board was used to make up a quick and simple solution for mounting the module, providing power and hooking up it up to the Raspberry Pi.
The gateway should in total consume somewhere in the region of 5-7 watts, which is staggering considering just how many nodes it can support and over a distance of up to 15km line of sight!
The decision was made to mount the gateway indoors, so as to provide easier access for maintenance and upgrades. Since we want to keep feeder losses to a minimum, we decided to use RG213 coax instead of RG58. Of course, we could have gone for something fancier and even a hardline, such as Andrew Heliax, but that would have increased the overall costs somewhat.
Short U.FL plug to N type socket pigtails will be used to connect the module to the antennas.
An 868MHz collinear with 5dBi gain (white fibreglass clad rod) is being used with the gateway and since we had an aerial rigger out to fit this to the roof (some 30+ feet in height), we decided to put up a broadband antenna (spiky appearance) for spectrum monitoring at the same time. This is a discone design and while it does not have much gain, covers from 25-3,000MHz.
A copper clad earth spike was also sunk into the ground at the foot of the antennas, with 10mm2 copper cable run up into the building alongside the feeders, to be attached to inline surge arrestors.
A single run of RG58 was also installed at the same for use with a GPS antenna.
The next task will be to fit the gateway, along with a power supply, in a wall mounted steel enclosure, before terminating the feeders and completing the cabling. Then on to testing.
Top image: “Calder Valley from Oldroyd”, copyright 2014 Tim Green, CC BY 2.0.
Related Articles –