Using TTN Mapper to show LoRa coverage


I’ve been playing with TTN Mapper. It’s great. There’s an app you can get for your phone (Android or IoS). You configure it with the details of your Things Network application and then you can wander round with a portable LoRa device and help to build a map of coverage.

You don’t have to actually connect your LoRa device to your phone, you just have to enable the mapper program on your phone to connect to your application and then it will detect LoRa packets from the device in that application and use the gateway metadata to help build the coverage map.

I’ve configured one of my Pax counter devices so that I can use it for mapping. Note that you need to be careful to put the sensor name in exactly as it is configured in the application. My iphone keyboard “helpfully” converted one of the characters in the device name to upper case and broke the mapping.

Some of the strings you have to enter are quite long. I opened up the Things Network site on my phone and then copied them out of the browser into the setup page of the application.

You can use a wildcard for the device name but this might get confusing if the mapper starts thinking that messages from distant sensors are actually with you and your iphone. But this would be a good way to work if you make a network with a single LoRa device that you are going to use just for mapping.

I’m going to try and get into the habit of taking the phone and a LoRa device with me whenever I go for a walk.

A Lora Gateway of my own


I’ve been playing with LoRa for a while, and I’ve even got a tiny single channel gateway at my house that mostly works.

But last week Adam loaned me a proper The Things Network LoRa gateway to play with.

It’s awesome.

For a start it has a proper 8 channel receiver. This means that it can receive all the messages. For another thing, it has a proper antenna. The result has been that over the air authentication (which used to be hit or miss) works first time. And I can reliably send messages back to the LoRa device when it checks in.

Suddenly all my sensors are reporting results with rock solid quality of service.

I really hope Adam doesn’t ask for it back in a hurry…

Reviving a Dragino LoRa Gateway


I’m a sucker for “upgrades”. Maybe it’s because I like watching progress bars. I find them rather relaxing, and a great way to avoid doing work.

But upgrades are not always your friend. Take my little LoRa gateway for example. It’s not a “proper” gateway, in that it only has a single channel, but it is fine for testing devices (as long as you are happy for only one in eight packets to get through).

Anyhoo, a while back it broke. So today I tried to fix it. It turns out that I’d actually broken it by upgrading it. The first time it failed I’d done what I thought was a sensible thing and upgraded the firmware, thinking that this might fix it.

Actually, it broke it even more.

Turns out that if you upgrade the gateway to version 1.4 this breaks all the stored settings. There’s a useful description of the problem and how to solve it here.


Now I’m back on the map, which is rather nice.

LoRa Seminar Recording

Since I had the slide deck lying around I thought I’d record a screencast of the content for anyone who missed the seminar yesterday. I’ve not made any screencasts for a while. I learned a few things doing this one:

  • All the foam has dropped off the earpieces on my microphone headset and turned into a rather horrible powder….

  • The microphone on the headset seems to be past it’s prime too.

  • It’s very annoying when the phone rings and you’re in the middle of a recording (if you listen you’ll hear the smooth and professional way that I deal with this)

I’ve ordered a better headset with a proper microphone. At the emf camp earlier this year a chap was talking about podcasting and saying everyone should do it. Once the new headphones arrive I’ll have one less excuse for not having a go. So expect to hear more of my dulcet tones in the future.

Talking LoRa at Hull University

As you can see, there was a lot of publicity for the seminar….

As you can see, there was a lot of publicity for the seminar….

Today I did my LoRa talk at the university. It was great fun, and the audience were lovely. I was in a lecture theatre I know very well from many hours of teaching there in the past. Good to see a few familiar faces and a few new ones. I hope you found the material useful/interesting.

Talking LoRa and Air Quality Sensors at Hull University on 28th November

Air Quality sensors inside and outside the box

Air Quality sensors inside and outside the box

I’m presenting a session at Hull University about low powered radio networks and air quality sensors in a couple of weeks. I’ve just written the description:

"LoRa is a low powered, long range radio networking technology with the potential to open up new embedded applications. It makes it easy and cheap to create connected devices. Rob Miles will explain how LoRa works, what makes it particularly interesting and why you should start working with it. He will show how the Connected Humber group are using LoRa to move Air Quality data from sensor to server, and how you can create your own LoRa devices very easily."

It sounds rather interesting. I’m definitely going to go along.

Talking MQTT


Ha! Today has been a good day. I’ve got my Air Quality sensor talking MQTT to the Connected Humber server and sending messages. This has been a bit of an adventure, mainly because I had to mess around with the libraries for the Heltec device that I’m using.

Anyhoo, I’m now sending messages over both LoRa and MQTT at the same time. Go me. Now I just need to add some configuration options and I think we might actually have a product here.

Incidentally, I’m using a Windows app called MQTTBox to view the messages on the server and post test messages to my sensor. Works rather nicely. And free.

Build another LoRa Node in a Day

Everyone looking happy at the start

Everyone looking happy at the start

In July we held a “Build a LoRa node” workshop at c4di. It was great fun for us, and those who took part. Today we did it again. I turned up, fresh from my media appearance and helped Robin set things up. As before, the aim was to get attendees to build a working LoRa node and finish up with a device sending environmental data to the cloud.

Everybody succeeded. It was great to watch them all convert a “bag of bits” into a working sensor node and then watch as they saw their readings appearing in their browsers.

We run the events when we get eight or nine people together who want to have a go. They are hosted in the lovely environment of the c4di and we only charge you for the parts that you take away. If you want to come along to our next one, just send me an email or a direct message on twitter and I’ll add you to the list.

Connecting a ZPH01 Dust Sensor to Python


I've just noticed that one of the wires came of the connector while I was taking the photograph. Oh well.

Anyhoo, some time back I got a dust particle sensor to play with. Air quality is a big thing, but one that we don't have much information about at the moment. An air quality measurement device is also a perfect application for LoRa. Sensors can gather data and then send summaries over the network. As part of ConnectedHumber initiative (of which much more later) we're designing an air quality sensor with the intention of deploying some city wide.

As a start I've connected the sensor to my PC and written a little Python script that gets the readings from it. You can find the script on GitHub here, in the unlikely event that you've got a sensor just like mine.

To connect the sensor to my PC I just used a standard USB to serial adaptor, the kind of thing you use to program Arduino Pro-Mini devices. I connected all the signal pins, and also took the mode pin to ground, so that the sensor will output serial data rather than pulses. 

The sensor works fine, although I've no real idea what any of the numbers mean at the moment. The next step is to get one into a case with a Wemos or LoRa device connected to it. 

LoRa Build a Node Workshop at c4di


We've just had a bunch of folks around to build some LoRa nodes. Robin had put together some kits and we came up with a set of instructions. By the end of the day we expected our attendees to have their LoRa nodes sampling temperature, air pressure and humidity and maybe even be viewing the values on The Things Network website. 

Well, we got that and more. One person had the information going into Microsoft Power BI and was using Machine Learning to predict future room temperatures. Another used If This Then That to tweet temperature readings to his phone. Others left with plans to install LoRa gateways and sprinkle LoRa powered sensors all over their properties.

Very successful, in spite of the fact that we were soldering surface mount components and some folks hadn't soldered since they were 14, or even at all. Thanks for coming folks and being so determined. At some points during workshop you could have heard a pin (or other tiny component) drop. 


We're doing another one in September, ping me an email if you want to get your name on the list. You can find our notes and sample programs here.

If you want to play with LoRa (and anything else that takes your fancy) take a look at the Humber Health Care Challenge. We'll make sure we've got some LoRa kits available there for people to have a go with this technology. 

Mightier Than sword or pen?

Mightier Than sword or pen?

LoRa at Humber Street Gallery


Today finds us at Humber Street Gallery. We're looking for locations for a LoRa gateway for the area. They've got a lovely rooftop bar which looks perfect, and has some amazing views. Of course, I happened to have my camera with me. 


We were telling the folks at the gallery about LoRa and we're going to go back and find out a bit more about the possibility of LoRa enabled artworks. Could lead to some interesting discussions. 

Tell LoRa I love her.


Gotta love the post title. But I do quite like LoRa. We're doing some exciting things with LoRa nodes over the next few weeks and so I thought I'd build a node of my own. I used a kit that Robin put together and had a node on the air within a couple of hours. The node just sends temperature, atmospheric pressure and humidity up to a Things Network server, but it does do that. And I can get the data into a Python program (other programming languages are available) amongst other places. And it was genuinely fun and easy to do. 

To celebrate I've designed and printed a box to hold the node. It's far too big at the moment. I used to have a thing where I'd make the boxes exactly the same size as the components and then find I had no way to actually get the components in, and put them together. This box won't win any prizes for compactness, but it will let me carry the node around and see just how many places pick up the signal. When I've got a bit more experience with the technology I'll post some How-Tos and other stuff. This really is great fun. 


Kickstarting Hull's Smart City

Paul Foster taking networks. 

Paul Foster taking networks. 

Well, that was fun. And exhausting. We did two Smart City events in one day. The morning event was all about getting people together to build a network, and the afternoon was all about the tech of LoRa. 

Both events had awesome attendance, lots of sensible discussion, and we even managed to fit in a bit of planning. As far as I'm concerned, the outcomes are:

  • We are going to get Lora gateways to cover the area as a first step towards building the Smart City infrastructure. There are already some commercial/proprietary LoRa gateways opening up in the region which would be a fantastic platform for industry strength applications, but from a community perspective an open one based on The Things Network would make a very good start. If you're not sure what LoRa is, read the attached slide deck....
  • We are going to start up a community effort building LoRa network devices. Lots of people seem quite keen on this. Once we've got the bits together we'll set up a happy afternoon where we'll build some network endpoints and get them going. Then we can start looking at using the devices to solve problems. 
  • We are going to set up a "Smart City Steering Group" to get all the interested parties together, share what we are all doing and try to put together a strategy that will start with LoRa and move on to consider other technologies including how to make some of the data gathered into open data. 

If you want to see my slides, which tell you all about LoRa, you can find them here.

I'm really excited about this. I think it could be the start of something not small. If you didn't make the events, but you want to get involved, feel free to contact me directly (put a comment on this post or message me via Twitter or email me or stand on a corner and shout loudly). 

Kickstart Hull's Smart City - free event Wed. 21st Feb

On 21st of February we'll be Kickstarting Hull's Smart City at the c4di. You're invited. You're especially invited if you're a developer wanting to get into city wide networking, a student looking for a new field to get your teeth into or someone who wants to do some good with technology. 

We'll be describing our plans for building a community to work with the latest low powered networking technology and use it to build solutions for local people. It's going to be great fun. 

The event is free, we'll have lots of expertise and maybe even biscuits. You can sign up here

Lora at the c4di Hardware Group


We had a great hardware meetup tonight. I showed off a bit of the latest Hull Pixelbot scripting stuff (once I'd got it to work - note to self - don't turn up with a machine and think you can install the software and it will just work. Doesn't happen). 

Then we talked a bit about Lora (or low powered radio to you). I've blogged a bit about this in the past but now we want to take things a bit further, and get going making Lora stuff. We've got all kinds of plans, none of them involving world domination. At least that's what we're saying for now. 

Anyhoo, expect to hear more about our Lora plans in the not too distant future. It looks like a great technology to get in on the ground floor of. If you fancy getting involved you should come along to our next meetup and utter the magic phrase "I fancy getting involved". You can sign up for the next meetup here

Single Channel Lora


I'm learning more about the Lora network. Lora links tiny, low powered, devices to an application. The devices talk to a Lora "gateway". The idea is that any device can talk to any gateway. Lora networks use different radio channels to pass data, and the node can select any data channel to send any particular message. Nodes usually cycle through the available channels.

A "proper" Lora gateway will listen on 8 channels at the same time. However, my tiny (and cheap) |Lora gateway from Dragino only listens on one channel.  This means that under normal circumstances I only receive one message in 8 on my gateway. Which is a bit of a limitation. 

Fortunately for me there is a way you can restrict a node to only using one channel. I found a forum post here which tells you how to do it. This is not something I'd advise anyone to do, because it is not in the spirit of the way that Lora works by spreading messages round different channels. However, I've made a script (called naughty) which does this, and it works fine. 

The really good news for us is that Hull centre is now served by a proper Lora gateway so if I use my Lora nodes in Hull they just work. 

Things Network Frame Counter

Frame Counter Checks.PNG

I'm getting the hang of Lora networks. And by that I mean "Spending quite a lot of time figuring out why things don't work when they really should".

Today I found out about Frame Counter Checks. Each Lora packet contains a frame counter value. This is set by the node when the packet is sent into the network. The Things Network likes it if the frame counters in packets always get bigger. This makes it slightly more difficult for someone to spoof messages into the network. 

Trouble is, if you're using a very simple node you'll find that the frame counter is reset to zero by the software each time you start the device. Which means that The Things Network will reject packets from the device until it seems a frame counter bigger than the one it's seen so far. 

Unless you know this, you'll spend ages trying to figure out why something that worked yesterday has suddenly failed. 

There's an option for the device settings for your application in the Things Network which turns off Frame Counter checks, which you can see above.

In a proper application you'd either save the frame counter in eeprom each time you've used it, or do something clever with the date and time to generate a frame counter value which is always bigger than the last one. 

Lora Node Live


Well, I've sent and received my first Lora packet sent from a node into a gateway. It turned out to be quite easy to set up. First you create an application, then you create a device, then you take the key data of the device web page and paste it into your node program. Then it works. 

Now I need to work out how to take the data off the server at the things network and do something with it. 

Great fun.