Raspberry Pi & The Things Newtork

This might be a really silly question, but I just realised I dont know the answer…

I have previously been connecting my devices to TTN via LoPy4’s and a LORAWAN gateway. I went this way primarily because of the distance between my sensors and internet connection… and it works great. Beyond TTN, my NodeRed server is also functioning very reliably.

Is it possible to get (say) a Pi ZeroW that has a Wifi connection (ie no LoRa gateway) to send data to TTN, or does TTN only accept LoRa / LORAWAN packets? In which case I suspect the PiZero would need replacing for a WiPy.


1 Like

Hi @Jon13024.

Try this link on building your own TTN gateway.

It should give you some insights, even if it doesn’t answer the question.:grinning:

Hi Jon,

The Things Network is primarily used to get the information back to your application from a shared network. If you use node-red as your application, and I’m assuming you have the TTN add-in, it uses MQTT to pull the massages back to a database connected to node-red. If you want to want to use a WiFi device you can use MQTT on the device to send data to the same database via a mosquito MQTT server on the Raspberry Pi or present a web app or other interface over WiFi.

If you have a diagram of how you’ve configured node-red I may be able to help you set it up.

I run the TTN gateway near Narrellan McDonalds and I’m a core member of the Sydney TTN team.

Thanks Shaun,
I didnt know we had “official” TTN people around here! Good to know.

I dont have a problem to solve as such, I was just thinking about expansion / connectivity for future uses of the architecture I currently have in place…

I currently have a gateway at my farm and a few sensors around the place. I have dabbled a little with MQTT on the pi but never rolled it out into a ‘live’ environment.

I suppose my question was perhaps more aimed at how a LORAWAN gateway provide its connectivity. From an IP networking perspective the nodes and gateway communicates over non-IP protocols (Radio @ 915-925Mhz). The Gateways utilise IP networking through the OSI model to move packets backwards and forwards on the WAN side. I had initially assumed that the LORAWAN gateways were simple IP packet creators and forwarders, but I now think there is much more to it than that in so much as the gateway needs to securely authenticate and communicate directly with TTN - In which case, a standard Pi could never communicate with TTN (without the need for a hat/shield).


Firstly being a core team member just means I was there early in the development helping to get the network going.

You initial assumption that the gateway is a simple packet forwarder is correct. There’s some detail here on The Things Network - TTN Packet Forwarder. The hat is just the radio and the software communicates with the radio and forwards packets to the network.

You can send messages across the network yourself but you’ll need to emulate a node and the encryption of the message payload. There are some device emulators available that do this but I’ve never used them. There’s a TTN thread on that topic here: https://www.thethingsnetwork.org/forum/t/lorawan-simulators/6179

I personally use the TTN to forward non-LoRa packets at the moment because you’re currently limited to the TTN constraints which is a small packet (51 bytes) every 5 minutes. You’re better off connecting to your application directly. The limitations are likely to change in the future because there are plans to support multiple Bluetooth Broadcast/Mesh networks and other networks as well.

Interesting thread. I’m about to build My own Lorawan gateway with a Pi and a Lorawan hat. I had planned to use TTN. I am wondering about your sensor nodes @Jon13024 ?
Are they Pi based and how are you transmitting the sensor data via LORaWan to the gateway ? Is it a LoraWAN board connected to the Pi ? if so - which one did you use ?

At the moment all my sensor nodes are LoPy4’s. My Gateway is the Laird unit that Core sell. Non of the kit has ever missed a beat.

I am looking at the Pi hats and wondering if I should play with them.