How does the ChirpStack Packet Multiplexer work?

From my understanding, 1 gateway forward packet to ChirpStack server. Then Multiplxer in ChirpStack server till forwad the payload to more than 1 network server, am I right?

1 Like

Probably it’s only good for development/debug purposes? Or could it be used for fail-over/redundancy somehow?
It only works good when the activation parameters are the same. But I guess even two ChirpStack instances will use use/give a different random number and device address on a JoinReq.
Perhaps you can synchronise those settings using the API.
Persistent activation on the nodes would be helpful in this case I think?

For completeness of the context, you will find most information here: https://github.com/brocaar/chirpstack-packet-multiplexer/.

The Semtech UDP Packet Forwarder forwards to the ChirpStack Packet Multiplexer, which then can forward to multiple LoRaWAN Network Servers (in the UDP format). Information is forwarded as is, so each configured backend will receive the same data.

One reason why the multiplexer can be useful is when you want to forward data to multiple network servers, e.g. a production environment and testing. Or when you want to forward to TTN and ChirpStack, …

1 Like

Well, the story as below. Sorry. I still newbie and learning stage.

  1. I subscribe to IoT-in-a-Box. I couldn’t send downlink payload to trigger my Netvox R602A (Siren) when Temperature sensor (R718AB) out of specification. It seem IoT-in-a-Box don’t allow me to do so. I have no access to their TTN also.
  2. Therefore, I’m thinking if I can have single gateway with multiplexer to TTN (connect to IoT-in-a-Box) and ChirpStack (to send downlink payload to Siren).

Yes. I notice this feature. I not sure where is the configuration link path to add both server address (TTN and Chirpstack) as I’m using docker.
https://www.chirpstack.io/guides/docker-compose/

Dear all,

I am discovering and testing chirpstack. Sorry if my question is a newby question.

I would like to use a multiplexer for redundancy, sending messages to several independant servers.

I implemented the chirpstack multiplexer and I have two servers receiving my messages (controled with Wireshark) and both servers can see join requests.
One of the server controls OTAA activation.
But I do not understand how the messages could be exploited on the second network server, espcially because of encryption.
Is there a way to bypass this pb ?

Thanks a lot

Best regards.

Dubs

Hello, can you help me understand how configuration file works?

I need forwarding traffic from gateways to 2x NS. One NS is on localhost:1700 (chirp). Second NS is on other public_ip:port.

I don’t understand how to build the configuration file. Should I declare multiple host = on additional rows, or declare host as array with multiple IPs? Thank you.

did you work it out? I too am stuck right here atm…

I have everything else working in the cloud, just want to add the multiplexer for the few TTN guys around town to forward there stuff on to TTN.

– Edit
Ok, after playing around it seems i have got this to work on docker, along side the docker-chirpstack i’ll have to remember and document the steps i took as it is straight forward if you know what to do… but I had a lot of trouble cobbling it all together.

@broccar hope you don’t mind, I just made a pull request on github with some updates to the readme about this.

By the way, it seems to work magnificently!

@brocaar If I understand well the multiplexer can connect multiple gateways to multiple backends.
Can you please state the syntax of the .toml configuration file to configure multiple backends?
The current example only sets one backend.

Also I am in doubt about the logic of uplink only. The following exmaple suggests that downlink is disabled:

# # Uplink only
#
# # This backend is for uplink only. It is not able to send data
# # back to the gateways.
# uplink_only=false

I presume that uplink_only=false means that up and downlink is enabled. Can you please confirm?
Thanks.

Ok, I found on the forum the hint to the solution: Per backend the [[packet_multiplexer.backend]] shall be populated with host, uplink_only, and gateway_ids like in this example.

[general]
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=4

[packet_multiplexer]
bind="0.0.0.0:1702"

[[packet_multiplexer.backend]]
# Chirpstack
host="192.168.20.1:1700"
uplink_only=false
# The Gateway IDs to forward data for.
gateway_ids = [
  "0101010101010101",
  "0202020202020202",
]

[[packet_multiplexer.backend]]
# TTN
host="router.eu.thethings.network:1700"
uplink_only=false
# The Gateway IDs to forward data for.
gateway_ids = [
  "0101010101010101",
  "0202020202020202",
]

I am very happy with this solution. Thanks!

1 Like

Yes, you add another sub block with the required back end router/network… I probably should of pushed that with the PR i also found that post helpful and gave it a :heart: as it wasn’t explained explicitly how that was done.

1 Like

Correct, when set to false, uplink and downlink works. If set to true, then the multiplexer forwards uplinks, but drops any downlink requests.

Hello @brocaar and folks, hope everything is going well.

I’ve been looking to install and use the multiplexer, with the purpose of expanding our LoRa coverage by having other Gateways (not mine) forward packages to my LoRaServer. I checked the Git and the README and this thread, and it is clear to me now how to configure the .toml for the multiplexer to work.

However, I have a question that perhaps is a bit basic/dumb, but want to be sure as I didn’t find any documentation or explanation on that… When the multiplexer is installed and running (on the server of the owner of these other Gateways), do I still have to create the nw-server and the gateway inside my LoRa Server?

I’m guessing that yes I have to, otherwise how can my server know from where are the packets coming, or even reply or send downlinks?

By creating them in my server I mean: to go inside the AppServer, create a new Network server, point to the nw server of the ones forwarding us (the.public.ip.of.those.guys:8008 ?), create a GW profile, and then create the gateway(s) using their EUI?

If yes I guess that the other party should enable/open their firewall/router to allow TCP packets to enter their 8008 port, right? For when/if I send a downlink back to a device that is hitting their GWs.

Any guidance is much appreciated :),
Thanks,

Mike

Answering my own questions, as I did some testing and eventually managed to successfully configure the Multiplexer and was able to send and receive data from/to my devices:

Yes: One has to create the Gateway inside the server that will receive the forwarded packages, as well as the corresponding GW Profile.

Yes: I was able to get Uplink packets and also send Downlink packets. I had a funny issue though… previously I had already sent Downlinks to my test device, so the Downlink FCnt had already incremented… for a moment I was unable to send Downlink from the receiving server, until I realized this, manually incremented the FCnt on the receiving server and voila, Downlinks went through and arrived to the device. I ignore if there is an option to “Ignore Frame Counter validation” as there is for Uplink Frames…

No: It was not required for me to create a NW server that “points” to the server doing the forwarding.

Hope this helps someone :slight_smile:
Cheers,
Mike

Can I bind multiple ports because we have some gateways that we can’t run on 1700 so we have to receive some gateways on different ports.

i just picked an un used port number that didn’t clash with existing ports or networks we wanted to multiplex to and pointed all our gw’s to that.

hey as we are going to install chirpstack-packet-multiplexer after the installation we didn’t get the configuration files like /etc/chirpstack-packet-multiplexer/chirpstack-packet-multiplexer.toml
and also binary is missing will you please help in this

@brocaar please help me in this maybe the package which we downloding maybe deprecated or missing some files

here is a docker version i compiled with forked version of the repo, there is an example config toml there as well.

https://hub.docker.com/repository/docker/ccall48/chirpstack-packet-multiplexer/general