Mapping The Things Network with a LoPy (1) Introduction

Welcome to my pages. If you landed here there must be at least some interest in either The Things Network, mapping its coverage or the LoPy, Pycom’s LoRa enabled controller. If neither is the case you’re still invited to read on and have yourself carried away into the world of Internet of Things…

As a proud owner of a WiPy, Pycom’s first WiFi enabled MicroPython programmable micro controller and of which i briefly blogged a while ago, i could not resist to buy its ESP32 based successor: The LoPy. The LoPy even ads the LoRa protocol and Bluetooth. The device collected quite some dust until i got to know The Things Network: An open Internet of Things wide area network using LoRa technology.

Soon i owned a gateway  (based on a RAK831 and RPi Zero) and was curious what its range would be. This is where TTN Mapper comes in. The idea is simple: Driving around with a LoRa transmitter which sends out a message say, each 15 seconds, your signal might be picked up by one or more gateways. An Android App registered to The Things Network waits for messages being reported. Knowing your location (GPS enabled on the SmartPhone) the App can now report the distance(s) and RSSI value(s) for this particular location and the particular gateway(s).  The principle is shown by it’s developer JP Meijers in a video.

Another possibility is to have the mobile node send it’s GPS location on regular intervals enabling TTN Mapper to process the data without the need of a SmartPhone. This however does not provide the driver with the feedback (and joy!) that his 25mW 868Mhz signal has been picked up by a sometimes 10 km remote gateway. Using this together with the App is no problem. TTN Mapper will be happy if a packet is accompanied by two locations (one from the packet itself and one from the App). Still it would be great if there was some other way of getting feedback.

So… why not use LoRa for this?

Sparked by this discussion (many thanks to  user piair for starting it) i decided to give this idea a try. The result should be that the number of gateways, distance, largest distance and received packets is displayed on the tracker device without the need of a SmartPhone. It will look like this:


The end result should look like this

In short: The LoPy receives it’s locations (LON1, LAT1) from a GPS module over a serial connection. This location is encoded and transmitted over LoRa. When a gateway receives this packet it is forwarded to TTN Mapper. It will also be decoded and send to my Node-Red application at home. As this data also contains the metadata (with the locations of all gateways which received the packet) the largest distance can now be derived. The number of received packets is incremented, the number of unique gateways counted and replied back to the node over LoRaWAN (encoded in a 5 byte string). This data will be scheduled and fed back to the LoPy following the next received uplink packet. The LoPy on its turn can now display these statistics and as a bonus keep track of the current speed and largest LoRa distance as well.

In the next post i will further dive into the specifics of the code and configurations involved and the hurdles taken to get things running.

This entry was posted in LoRa and tagged , , , . Bookmark the permalink.

4 Responses to Mapping The Things Network with a LoPy (1) Introduction

  1. Pingback: A LoRa 868MHz Collinear antenna | Projects by Keptenkurk

  2. Dominik says:

    Hey, thanks for this excellent write-up of the LoPy-based mapper node. I was about to do the same thing myself and I’ll definitely base my work on yours. Keep up the great work!


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s