LoRa Gateway Bridge to TTN


#1

Hi all,

I’ve been working on a platform that intercepts LoRaWAN device messages on the gateway, with the net result of dropping packets that aren’t from an ‘approved’ list of devices. I’ve been using the LoRa Gateway Bridge running on a Laird Sentrius which points to a MQTT server on a Pi (for now). I can happily collect packet data as I’m very familiar with JSON and MQTT.

That being said, I’m struggling to then ‘connect’ the LoRa Gateway Bridge to TTN afterwards. I understand that this process is currently trivial with the LoRa Server, however for testing and legacy reasons (+ because our platform is currently built around TTN), I want to push the data there.

Does TTN have some kind of MQTT server that I can directly forward the packets from the LoRa Gateway Bridge to, without having to convert the data?

So, as a terribly illustrated flow, it would look like this

Gateway UDP -> LoRa Gateway Bridge -> [My custom interceptor piece] -> Push data via MQTT to TTN

Thanks


#2

I don’t believe they support the LoRa Gateway Bridge data-format, but it would be better to ask them :slight_smile:

Shortly I will open-source an other component which you can put behind the packet-forwarder which can forward packet-forwarder UDP data to different backends (LoRa Gateway Bridge, TTN, …). Example config:

[[packet_multiplexer.backend]]
host="localhost:1701"
gateway_ids = [
  "00800000a00016b6",
]

[[packet_multiplexer.backend]]
host="localhost:1702"
gateway_ids = [
  "00800000a00016b6",
]

It is a kind of poly-packet-forwarder but instead you can keep the vanilla packet-forwarder and put this inbetween :slight_smile: It will also allow you to configure per backend which gateways must be forwarded. Uplink and downlink will be supported.


#3

@brocaar I also started doing very similar.
Im happy to contribute to your implementation.

Please let me know the current status.


#4

I have completed the implementation. Only I was traveling the last days so I had not had the time to open-source this.


#5

Great, looking forward to it.


#6

Hi @brocaar,

I tested the packet_multiplexer and it works as intended. And thanks for the work!

Im wondering about the need for gateways_ids for the backend configuration.
It looks like the code iterates over it to build and maintain the backends map. But do you think it is possible to build it as the multiplexer sees data from new gateways, like how it happens in the gateway-bridge.


#7

That is not how I intended it to be. In my case I needed something where I could tell per backend which gateways would be forwarded. But it should not be hard to implement this.

If you are interested in contributing, would you be interested to make a pull-request where the ID "*" would act as a kind of catch-all?


#8

Sure. Let me take stab at it.
Will send a pull requests once it is in a decent shape.