My First LoRaWan Gateway

(Balisteri) #1

Hello, my name is Marcelo Balisteri and this is my first Gateway Lora. Today it is installed on top of the campus where I work. PUC Rio that is in the neighborhood of Gávea here in Rio de Janeiro. The idea is to provide an open infrastructure for a smart campus. In the not too distant future, all students and laboratories that wish to create IoT solutions over LoRa technology will be able to use this network to develop their experiments and prototypes.

At this gateway, a Wireless Solution IC880A card is used in conjunction with the Raspberry Pi3 enclosed in an 868Mhz Andrew 8Dbi Omni Directional Antenna and Airtight enclosure.

Some coverage tests have already been carried out and until now I have achieved coverage of around 4 km in an urban environment.

I hope in the future to be sharing more results with the group.

Thank you very much and in particular to The Things Network that made this possible.20180516_151038IMG-20180521-WA0024IMG-20180518-WA003820180518_09273420180517_120357Mapa%20Cobertura%20Teste%20Lagoa

(D4rksoft) #5

Greetings I’m from Colombia I’m starting with this from Lorawan I have a project which I would like you to help me if possible thank you very much

(John Hunt) #6


Could you please provide the parts list? It is an outdoor gateway?

(Balisteri) #7

Hello, how are you?
Look at what is possible I can help without problem. Tell me what you need and see if I can help.

(Balisteri) #8


The part list is

1x iC880A - LoRaWAN® Concentrator 868MHz
1x Raspberry Pi V3
1x Antena OmniDirectional Andrew 8dBi
1x hermetic case ip67
1x Step-down Lm2596 DC/DC
1x Power Supply PoE Injector 24V
1x Pig Tail N to MMX Conector

In this list you have all the devices that I used.

The linux version installed on the raspeberry is the debian Jessy

The Packet Forwarder version is owned by The Things Network

As a management server for the IoT network I used the TTN.

For production and private control I use Brocaar Lora Server

As a database server I use influxdb

Grafana is used to display the graphs.

And to create the connectors between InfluxDb and Grafana, NodeRed is used. NodeRed is the one that connects to the gateway to pick up the link and packet information and feeds the influxdb so that the grafana displays from the database fed by the Node red.

as reference:

II hope I’ve helped.

(Marce Adrian) #11

Greetings from Nicaragua. Caould you please comment how it is going? Have you made a signal plot or new drive testing? Are you using some specific SW? Thanks for share.

(Balisteri) #13

Thank you and Greetings from Brazil !!
The network is running full steam!
Yes I did a new test drive with the mapping of all the points that can be covered on the PUC campus and throughout the Gávea neighborhood, Jardim Botanico and Lagoa Rodrigo de Freitas.
For mapping I use the own TTNMAPPER
To display the Graphics I use the Ubidots Platform.

Mapa%20maior%20distancia medidas%20lora

(Marce Adrian) #14

Obrigado Marcelo! Also could you please comment about your mobile equipment? Have you also made it? Are you using MQTT protocol?
Saudações, Marcelo

(Lboccalatte) #15

Hi Marcelo! Greetings from Sicily! Thank you for sharing your work. I’m also interested in your mobile equipment you’re using to map the coverage of your gateway.

(Balisteri) #16

So I use a module of the seeeduino and a cell phone with GPS galaxy S9 together to carry out the measurements.

While the seeeduino sends a payload with temperature and humidity I use the cellular in conjunction with the TTN MAPPER to confirm the sending of the payload to the network of the TTN and thus to record and to plot the GPS information.

(Timothy Goddard) #17

Hi Marcelo

That’s brilliant. I’m really impressed with the self-built gateway and the data visualisation you have used. I’m just starting with LoRaWAN and took the easy way out of buying an off-the-shelf gateway. It’s only indoors but I needed a quick way to provide coverage for some project students.

Best wishes and greetings from the UK


(Lboccalatte) #18

Thank you so much Marcelo. I’m at the very begin with this kind of prototypigng, so sorry if I ask you something more about your gateway… (please tell my if I’m asking too much).
In checking your device list, and matching it with the picture you’ve posted, I can’t identify the device placed on the botto-left corner of the enclosure.

Please: what it is used for?

In any case (hope this can be useful for others beginners) I’ve tried to list all the main options available to power the gateway (mainly the Raspberry board), assuming PoE (and then, assuming a PoE switch port or a PoE injector is placed downstream):

  1. using a PoE splitter with micro-usb connector (then powering RB through his micro-usb port);
  2. using a PoE splitter with a DC output (like yours I suppose) and a Lm 2596 Step-down DC/DC voltage regulator (Q: is it mandatory / recommended also when the PoE splitter ensures you a compliant DC output?)
  3. using a Raspberry Official PeO HAT that allows you to avoid any external splitter, given that with this HAT you can put the RJ-45 PoE cable directly into the Rasberry port

Please Marcelo, assuming the target is to do exactly the same experiment you did:
based on your experience / opinion, and putting apart any cost issues, what is in your opinion the best choice among the three?

And, as the last request (sorry): please can you give some suggestions or post some link that explain how to build the mobile equipment (based on seeeduino, also available online in a version with lorawan protocoll and gps embedded

Thank you so much, and have great days…

(Carbon6) #19

Greetings from New Zealand. You have a very impressive setup, it looks great and well thought out.
We have recently started up in Christchurch and will be keeping an eye on your setup and any future projects you work on.

(Ud Lo Ra) #20

With TTN Mapper (sorry, I edited the mistake)you can use any node sending anything, accompanied by a mobile phone with the TTN Mapper app, and integration with TTN in the console. When you want to map, you start the app, and at any time the node is received by some gateway, the phone is notified and records the location. So no need for GPS chip on the node.
By the way, congratulations to Marcelo :slight_smile: . Bike is also a sensible choice, because in car over 40km/h SF12 is not always functioning.

(Ud Lo Ra) #21

In the above post I just corrected a mistake (thought TTNMapper, written TTN). Apologies :slightly_smiling_face:

(Balisteri) #22

Thank you!

You can ask at will !! I’m just sorry if I’m slow to respond.

The device is an old GPS module that I had saved. I just do not remember the model, but I already say that it is Motorola.
I use a PoE source to power my device. In the case of the plug poe I use it inverted.

The PoE cable goes into the LAN and the data goes out into the PoE and feeds a voltage regulator. With the voltage regulator I go from 24V to 5V and feed the concentrator IMST and Raspberry. Note that the poe connector has a font connector on it. This is where the power goes out to power the voltage regulator. Like I said, I use it the inverted PoE connector.

In my opinion the best is the HAT PoE for raspberry. But in the IMST documentation he asks to feed separately.

I advise you to see this link here because I describe the project I am developing. He is also here from the TTN forum. If you do not respond to your response please let me know that I will try to be as clear as possible. 15974

This code is what I used to program the seeeduino to measure temperature and humidity and send the data to the TTN network.

#include <TheThingsNetwork.h>
#include <LoRaWan.h>
#include “DHT.h”

#define DHTPIN 7
#define DHTTYPE DHT22


unsigned char data[4];

char buffer[256];

void setup(void)


memset(buffer, 0, 256);

lora.getVersion(buffer, 256, 1);


memset(buffer, 0, 256);

lora.getId(buffer, 256, 1);





lora.setDataRate(DR5, EU868);


lora.setChannel(0, 868.1);

lora.setChannel(1, 868.3);

lora.setChannel(2, 868.5);

lora.setChannel(3, 867.1);

lora.setChannel(4, 867.3);

lora.setChannel(5, 867.5);

lora.setChannel(6, 867.7);

lora.setReceiceWindowFirst(1, 868.3);

lora.setReceiceWindowSecond(869.525, DR0);




void loop(void)

bool result = false;


SerialUSB.println("-- LOOP");

// Aqui esta lendo o dado do sensor e multiplicando por 100 para tornar o envio eficiente com 2 decimais

// Lendo a umidade do sensor

uint32_t humidity = dht.readHumidity(false) * 100;

// Lendo a temperatura do sensor / Valor falso (false) para Celsius e Verdadeiro (true) para Farenheit

uint32_t temperature = dht.readTemperature(false) * 100;

// Dividindo em 2 palavras (32 bits) para dois bytes de 16

byte payload[4];

payload[0] = highByte(temperature);

payload[1] = lowByte(temperature);

payload[2] = highByte(humidity);

payload[3] = lowByte(humidity);

// Exibir no terminal serial a Temperatura e Umidade lida do sensor

SerialUSB.print("Temperatura: ");
SerialUSB.print("Umidade: ");

// Nesta parte abaixo a função transfer packet pega o dado do payload o prepara para enviar via rede LoRa
result = lora.transferPacket(payload, 4, 10);



short length;

short rssi;

memset(buffer, 0, 256);

length = lora.receivePacket(buffer, 256, &rssi);



    SerialUSB.print("Length is: ");


    SerialUSB.print("RSSI is: ");


    SerialUSB.print("Data is: ");

    for(unsigned char i = 0; i < length; i ++)



        SerialUSB.print(buffer[i], HEX);

        SerialUSB.print(" ");







Decoder on TTN

// Decodificação do payload no tttn

function Decoder(bytes, port) {

var humidity = (bytes[0]<< 8) | bytes[1];

var temperature = (bytes[2] <<8) | bytes[3];

return {

humidity: Umidade,

temperature: Temperatura



Mapa de minha rede

TTN APP Android

(Lboccalatte) #23

Thank you very much Marcelo and UdLoRa!!!

I’m going on with my study finalized to write the corret buy list of all the devices and accesories for my first LoRaWAN Gateway and a single Test Node.
Please, here some other question based in yours latest answer (you are so patient, thank you, and don’t worry about your time-to-answer :wink: ):

  1. Motorola GPS device. Ok, thank you. But, sorry, I never hear about necessity to install a GPS module inside the gateway… is it mandatory? what is used for? (I imagine, since the position of the gateway is fixed, that you can specify the GPS coordinates via the gateway software once at the first installation and then modify them if the position of the gateway change over time).

  2. PoE HAT. So, IMST require a separate feed for the concentrator, I understand. And indeed I’ve found this scheme from iC880A-SPI QuickStart Guide:
    and the textual raccomandation: “The power pins (21, 22) have to be connected to a proper power supply that is able to provide more then 700mA. Therefore is recommended to choose a proper power supply the iC880A-SPI and the host system at the same time”.
    So, since I would like to use the PoE HAT, I’ll go in deep with IMST / Raspberry Support channels to understand if the RB PoE HAT can provide, indirectly, such a power “on cascade”. I’ll report on that.

  3. Node. I’ve checked your picture of the mobile node. I’ve understand that (differently than if I had use a normal Ardunio, using a Seeeduino LoRaWAN let me avoid to buy a separte communication module, since it embedd a RHF76-052AM module). But, please, let me clarify the question about the Seeeduino LoRaWAN W/GPS version (that cost only 10$ more then the normal version). If I have a GPS module inside the node, I suppose that I can set the node, not (or not only) to send to the network data like temperature, but to send also the GPS Coordinates themselves. So my question is: can I do a coverage mapping in “unattended mode”: as an example: I ask to a friend of mine to go with his bike and a Seeeduino LoRaWAN W/GPS node aroung the neighborhood of my gateway, without a phone (possibly I set the node to send a payload every 5/10 minute or so). In the meantime I use a PC with the “web version” of the TTN Mapper in which I “translate” the data coming from the node (the GPS coordinates and other network data) into the map. Is it possible?

Other question on SF12 and the speed of the veicle hosting a node, next time…

Have a good Life
A thanks again…


(Ud Lo Ra) #24

TTN Mapper allows also to send coordinates directly from the node, following a specific format. Check on the FAQ (Section “How can I contribute”) for specifications:

(Lboccalatte) #25

Thank you so much! Have a nice day…