4

I already have a LoRa gateway that I made using a NodeMcu with ESP8266 and now I want to send data from a Raspberry Pi 3 through that gateway to the TTN.

The first thing that I did was to connect a RFM95W to the Raspberry Pi, (with success, since I tested it as a gateway with the single channel packet forwarder).

But how am I going to make the Raspberry Pi connect to the NodeMcu gateway to upload the data to TTN?

The only examples I can find concerning TTN nodes are all implementations with Arduino instead of Raspberry Pi.

2 Answers 2

3

You need to connect your RFM95W to RPI3 via SPI (as it seems to be done) and then, you will need a driver to allow the Linux kernel to communicate with the device over SPI. After that, you will need to adapt your software to communicate with the driver to send data from user space.

It seems no one developed a driver for Linux. The closest (not tested by me) is for RFM69CW here : https://github.com/gkaindl/rfm12b-linux

An easier solution is maybe to choose a LoRaWAN modem with UART interface and then you will only need to send AT command to it via standardize TTY interfaces. Here are a few example of references : RN2483, RAK811, mDot.

Or if you wan to use the RFM95W, you can use it with a small Arduino over SPI as the library already exist and then connect the Arduino to your RPI3 via UART and develop your own protocol between them.

1
  • Welcome aboard :-) A good answer (+1). I can see that you are very knowledgeable and will give us some good help :-) Jan 7, 2019 at 11:04
2

The next step is to implement LoRaWAN on the Pi. The RFM95W handles LoRa but does not include a LoRaWAN stack. TTN requires LoRaWAN (and not much else).

Yes, most of the LoRaWAN implementations are either on an accompanying MCU, or a connected Arduino. LoRaWAN on Pi implementations are less common, but there are a couple.

Start by checking out the efforts to including LoRa in the kernel. This email will provide good context, particularly this section:

Ready-made LoRa hardware modules come in three flavors,

a) with SPI access to the underlying Semtech chip sets, needing a software implementation of e.g. LoRaWAN protocol stack (i.e., a soft MAC),

b) with a custom, often UART based interface and a pre-certified LoRaWAN protocol stack already integrated (i.e., hard/full MAC), and

c) with a microcontroller that serves not only for the protocol stack but also as application processor, not offering a ready-made interface.

Then check out the lmic_pi project. LMIC is a popular LoRaWAN stack for Arduino and Ernst de Vreede has kindly published their efforts to port it to Pi. It happens to have been tested with the radio you have in mind.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.