I have been working on a project which involves creating a LoraWan network using:

  • Dragino lg01 as a Gateway.
  • An Arduino Uno and a Dragino Lora shield with a simple LM35 Temperature sensor
  • As for the Server, I have been looking for something open source and compatible with LoraWan, I have found the Wso2 IoT server and I have had some starting it, I think I need to install Apache ActiveMQ JMS Provider with it and I didn't know how.

To send the data from the gateway to the server I am going to use MQTT.

As for visualising the data I am going to create an application using AngularJS.

So the problem I have had is that I was confused about connecting the node to the Server since I have found two methods (Over-the-Air Activation and Activation by Personalization) and does it affect how the Gateway and the server should be programmed?

Also am I going to program the Gateway to send data to the server with MQTT or does all the programming happen in the Node?

3 Answers 3


Imagine your network as a Venn diagram where one set is LoraWan and the other is MQTT.

enter image description here

Elements in the sets should know only about their set(s).

  • So nodes using LoraWan (are in the LoraWan set) do not have to bother with MQTT or with the server. They just send/receive data to/from the Gateway. The Gateway is the end of their world.
  • The Gateway is in the intersection of the two sets, LoraWan and MQTT. The MQTT related part should be hosted here as this element is part of both sets. Its task is to forward the collected data from the LoraWan nodes to the Server by publishing the appropriate node data to a specific MQTT topic. The logic that distributes data between the correct MQTT topics should implemented here.

  • The Server could host the MQTT broker as is is in the MQTT set and and has nothing to do with LoraWan.

If you are looking for a LoraWan compatible server and you have LoraWan enabled nodes, then I do not understand where do you need your Gateway. The Gateway is supposed to provide interoperability between two different networks. In your case between a LoraWan network and a TCP/IP network or the Internet.

  • Thank you for the advice I can see more clearly how the network is going to be connected, and to be honest i didnt understand exactly what kind of server i am going to use so i figured i should use one that is compatible with lorawan, but after a little research i found out that wso2 iot can work with mqtt and so can be programmed to recieve data from the gateway, And thanks infintely again for clarifying this whole business for me !! Commented Feb 28, 2017 at 12:47

One approach taken by many people is simply registering the node(s) and the gateway(s) with the free, community-based TTN (The Things Network). TTN does all the stuff necessary to provision your node with the LoRaWAN keys and either ABP or OTAA, apart from actually programming the node's firmware (you probably use the Arduino IDE or VSCode+PlatformIO for this).

You will then be able to (1) view your node's messages on their Console (as well as the gateway traffic) which is very helpful in debugging, and you can also (2) subscribe to the messages at their MQTT broker.

The next step could be a DIY installation of Node-RED, Telegraf, and Grafana which will get you a powerful testbed for processing and also visualising your data.

BTW, the gateway does not speak MQTT with the server IIRC. It's a kind of JSON over UDP.

All this is very well-documented in the web.


The standard approach is to connect your gateway to a LORAWAN Network server as well described above.

If you want to connect the gateway directly to your broker you may use the MQTT forwarding function of your gateway: MQTT Forward Instruction.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.