Options for forwarding LoRa packets to a web socket in another container.

I am working on a LoRaWAN project with the balenaFin, RAK2245 LoRa concentrator and a Notecard from Blues Wireless which is a cellular device. I am running this project on balenaOS with multiple containers, including one running the basics station packet forwarder. The Gateway is connected to The Things Stack and publishing data from LoRa end nodes, but I would like to also capture packets and send those to the Notecard for forwarding to the Notehub.io cloud service.

The Notecard is not a raw socket modem and I don’t want to, for this project, use it to replace Wi-Fi at the balenaOS level for all network communications. The goal is to capture LoRa packets from my end nodes and forward only those to the Notecard.

My question is: What is the most straight-forward way to do this?

Options I’ve considered include:

  • Modify the basics station source to send packets to a web socket in another container. I’ve poked around in the basicstation source, but it feels needlessly complex and hacky to take this approach.
  • Implement my own (Python-based) LoRa network server and replace the Things Stack completely. I tried just forwarding everything to my simple websocket, but that didn’t work and I expect I would need to fully implement the LNS protocol on the web socket server in order to do this. Is that correct, and if so, does anyone have any pointers to guides or even open-source LNS implementations I could look at?
  • Use Chirp Stack as the Network and Application server and capture packets using gprc or MQTT. I’ve started going down this path, and am creating a set of containers for the various pieces, but I am not sure if I’m not overdoing it, and I didn’t want to take The Things Stack completely out of the mix.

Thanks for reading, any help is appreciated!

Hey @bsatrom, I know you didn’t like the idea of hacking around in the basicstation source, but it looks like there’s an example snippet there already that may be of use to you?

Have you tried this method as an option?

1 Like

Hey @klutchell thanks for the reply, I appreciate it! I was just about to post a follow-up.

That commented-out snippet is mine, and I was toying with trying to get that to work. The only thing stopping me is that its not super-clear from the basicstation source how to create the websocket object that the tc->ws pointer is referring to. There’s a similar snippet that basicstation uses to send packets to the main LNS server (The Things Stack in my case) but I couldn’t figure out how to replicate that for my purposes. There’s a lot of indirection and I am not a pro C dev. :smiley:

If you have any thoughts or ideas, let me know and I can try them out!

Hi Brandon, just to clarify one item, is this a case of the packets not being sent because of a container issue, as in the container is not communicating with the outside world? Packets are not being sent / received due to the container networking not setup correctly?

Or, is this more related to the actual connectivity up to The Things Network? By that I mean, the container is able to interface with the outside world properly, you just need to ensure your data is flowing properly to TTN. Just trying to determine where we should be focusing efforts, the container, or, the application. Thanks.