chirpstack/chirpstack-packet-multiplexer

Packets are not getting forwarded

Closed this issue · 13 comments

Hi,

I deployed the chirpstack-packet-multiplexer with docker compose, added one server for testing and configured my lorawan gateway to forward to the chirpstack-packet-multiplexer. unfortunately the multiplexer only receives the packets but didn't forward them

My Docker-Compose.yml:

  chirpstack-packet-multiplexer:
    image: simeononsecurity/chirpstack-packet-multiplexer
    ports:
      - 1700:1700/udp
    volumes:
      - ./:/chirpstack-packet-multiplexer
      - ./config/chirpstack-packet-multiplexer.toml:/etc/chirpstack-packet-multiplexer/chirpstack-packet-multiplexer.toml:ro

my chirpstack-packet-multiplexer.toml:

# Log level
#
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=5


[packet_multiplexer]
# Bind
#
# The interface:port on which the packet-multiplexer will bind for receiving
# data from the packet-forwarder (UDP data).
bind="0.0.0.0:1700"

[[packet_multiplexer.backend]]
host="10.12.100.10:1700"
uplink_only=True
gateway_ids = [
  "1234567890 ",
]
gateway_id_prefixes = []

[monitoring]

Log of the docker image:

[+] Running 1/0
 ✔ Container chirpstack-packet-multiplexer-chirpstack-packet-multiplexer-1  Created                                                                                                                                                                                                   0.0s
Attaching to chirpstack-packet-multiplexer-1
chirpstack-packet-multiplexer-1  | 2024-11-13T10:45:46.883651Z  INFO chirpstack_packet_multiplexer: Starting ChirpStack Packet Multiplexer (version: 4.0.0-test.2, docs: https://github.com/chirpstack/chirpstack-package-multiplexer/)
chirpstack-packet-multiplexer-1  | 2024-11-13T10:45:46.883672Z  INFO chirpstack_packet_multiplexer::listener: Setting up listener host="0.0.0.0:1700"
chirpstack-packet-multiplexer-1  | 2024-11-13T10:45:46.883789Z  INFO chirpstack_packet_multiplexer::forwarder: Setting up forwarder
chirpstack-packet-multiplexer-1  | 2024-11-13T10:45:46.883801Z  INFO chirpstack_packet_multiplexer::monitoring: Monitoring endpoint is not configured
chirpstack-packet-multiplexer-1  | 2024-11-13T10:47:52.697277Z  INFO {addr=10.12.20.113:41071}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PullData gateway_id=1234567890 token=26566
chirpstack-packet-multiplexer-1  | 2024-11-13T10:47:52.697316Z  INFO {addr=10.12.20.113:41071}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PullAck
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:00.528364Z  INFO {addr=10.12.20.113:45932}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=1234567890 token=26995
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:00.528398Z  INFO {addr=10.12.20.113:45932}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:02.781436Z  INFO {addr=10.12.20.113:41071}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PullData gateway_id=1234567890 token=20991
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:02.781463Z  INFO {addr=10.12.20.113:41071}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PullAck
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:04.402855Z  INFO {addr=10.12.20.113:45932}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=1234567890 token=19180
chirpstack-packet-multiplexer-1  | 2024-11-13T10:48:04.402885Z  INFO {addr=10.12.20.113:45932}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck

Your configuration is incorrect. Since v4 it has changed. Please see: https://github.com/chirpstack/chirpstack-packet-multiplexer?tab=readme-ov-file#example-configuration.

I already tried this config

[logging]

  # Log level.
  #
  # Valid options are:
  #   * TRACE
  #   * DEBUG
  #   * INFO
  #   * WARN
  #   * ERROR
  level = "info"


# Multiplexer configuration.
[multiplexer]

  # Interface:port of UDP bind.
  #
  # This this is the interface:port on which the Multiplexer will receive
  # data from the gateways.
  bind = "0.0.0.0:1700"

  # Servers to forward gateway data to.
  #
  # Example configuration:
[[multiplexer.server]]

  #   # Hostname:port of the server.
server="10.12.100.10:1700"

  #   # Only allow uplink.
  #   #
  #   # If set to true, any downlink will be discarded.
  #   uplink_only=false

  #   # Gateway ID prefix filters.
  #   #
  #   # If not set, data of all gateways will be forwarded. If set, only data
  #   # from gateways with a matching Gateway ID will be forwarded.
  #   #
  #   # Examplex:
  #   # * "0102030405060708/32": Exact match (all 32 bits of the filter must match)
  #   # * "0102030400000000/16": All gateway IDs starting with "01020304" (filter on 16 most significant bits)
  #   gateway_id_prefixes=[]


# Monitoring configuration.
[monitoring]

  # Interface:port.
  #
  # If set, this will enable the monitoring endpoints. If not set, the endpoint
  # will be disabled. Endpoints:
  #
  # * /metrics: Exposes Prometheus metrics.
  bind = ""

Could you please share your logs with the above config?

same logs as in the first post

Both these logs correspond to incorrect configuration. As I already mentioned, the latest version has a new configuration format.

but whats the error? I took the config from the READMe and change the server ip

You say in your issue that this is your config:

# Log level
#
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=5


[packet_multiplexer]
# Bind
#
# The interface:port on which the packet-multiplexer will bind for receiving
# data from the packet-forwarder (UDP data).
bind="0.0.0.0:1700"

[[packet_multiplexer.backend]]
host="10.12.100.10:1700"
uplink_only=True
gateway_ids = [
  "1234567890 ",
]
gateway_id_prefixes = []

[monitoring]

In the latest version [[packet_multiplexer.backend]] does not exist.

It has changed to:

[[multiplexer.server]]

  #   # Hostname:port of the server.
server="10.12.100.10:1700"

(also other options have been changed.

no, i changed the config to this

[logging]

  # Log level.
  #
  # Valid options are:
  #   * TRACE
  #   * DEBUG
  #   * INFO
  #   * WARN
  #   * ERROR
  level = "info"


# Multiplexer configuration.
[multiplexer]

  # Interface:port of UDP bind.
  #
  # This this is the interface:port on which the Multiplexer will receive
  # data from the gateways.
  bind = "0.0.0.0:1700"

  # Servers to forward gateway data to.
  #
  # Example configuration:
[[multiplexer.server]]

  #   # Hostname:port of the server.
server="10.12.100.10:1700"

  #   # Only allow uplink.
  #   #
  #   # If set to true, any downlink will be discarded.
  #   uplink_only=false

  #   # Gateway ID prefix filters.
  #   #
  #   # If not set, data of all gateways will be forwarded. If set, only data
  #   # from gateways with a matching Gateway ID will be forwarded.
  #   #
  #   # Examplex:
  #   # * "0102030405060708/32": Exact match (all 32 bits of the filter must match)
  #   # * "0102030400000000/16": All gateway IDs starting with "01020304" (filter on 16 most significant bits)
  #   gateway_id_prefixes=[]


# Monitoring configuration.
[monitoring]

  # Interface:port.
  #
  # If set, this will enable the monitoring endpoints. If not set, the endpoint
  # will be disabled. Endpoints:
  #
  # * /metrics: Exposes Prometheus metrics.
  bind = ""

Then please also post the new logs when using that config.

As mentioned same as before

``[+] Running 1/0
✔ Container chirpstack-packet-multiplexer-chirpstack-packet-multiplexer-1 Created 0.0s
Attaching to chirpstack-packet-multiplexer-1
chirpstack-packet-multiplexer-1 | 2024-11-15T09:12:46.066809Z INFO chirpstack_packet_multiplexer: Starting ChirpStack Packet Multiplexer (version: 4.0.0-test.2, docs: https://github.com/chirpstack/chirpstack-package-multiplexer/)
chirpstack-packet-multiplexer-1 | 2024-11-15T09:12:46.066845Z INFO chirpstack_packet_multiplexer::listener: Setting up listener host="0.0.0.0:1700"
chirpstack-packet-multiplexer-1 | 2024-11-15T09:12:46.067398Z INFO chirpstack_packet_multiplexer::forwarder: Setting up forwarder
chirpstack-packet-multiplexer-1 | 2024-11-15T09:12:46.067418Z INFO chirpstack_packet_multiplexer::monitoring: Monitoring endpoint is not configured
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:03.415553Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PullData gateway_id=1234567890 token=26566
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:03.415602Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PullAck
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:09.898490Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=1234567890 token=20991
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:09.898526Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:12.829631Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=1234567890 token=19180
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:12.829660Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:13.490784Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PullData gateway_id=1234567890 token=10701
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:13.490823Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PullAck
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:22.967190Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=1234567890 token=47787
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:22.967232Z INFO {addr=10.12.20.113:52932}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:23.574452Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PullData gateway_id=1234567890 token=62203
chirpstack-packet-multiplexer-1 | 2024-11-15T09:14:23.574484Z INFO {addr=10.12.20.113:49367}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PullAck

In your custom docker image, are you setting the -c flag. If not, then you need to set it in the docker-compose.yml:

Example:

services:
  chirpstack-packet-multiplexer:
    image: chirpstack/chirpstack-packet-multiplexer:4.0.0-test.2
    command: -c /etc/chirpstack-packet-multiplexer/chirpstack-packet-multiplexer.toml
    ports:
      - 1700:1700/udp
    volumes:
      - ./config:/etc/chirpstack-packet-multiplexer

With the above correct config, that works for me:

chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:29.890723Z  INFO chirpstack_packet_multiplexer: Starting ChirpStack Packet Multiplexer (version: 4.0.0-test.2, docs: https://github.com/chirpstack/chirpstack-package-multiplexer/)
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:29.890734Z  INFO chirpstack_packet_multiplexer::listener: Setting up listener host="0.0.0.0:1700"
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:29.890815Z  INFO chirpstack_packet_multiplexer::forwarder: Setting up forwarder
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:29.890818Z  INFO chirpstack_packet_multiplexer::forwarder: Adding server host="10.12.100.10:1700" uplink_only=false gateway_id_prefixes=[]
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:29.890825Z  INFO chirpstack_packet_multiplexer::monitoring: Monitoring endpoint is not configured
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:34.024077Z  INFO {addr=192.168.0.28:47907}: chirpstack_packet_multiplexer::listener: UDP packet received packet_type=PushData gateway_id=0016c001ff1a0a5f token=64474
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:34.024186Z  INFO {addr=192.168.0.28:47907}: chirpstack_packet_multiplexer::listener: Sending UDP packet packet_type=PushAck
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:34.024300Z DEBUG {addr=192.168.0.28:47907}: chirpstack_packet_multiplexer::listener: Sending received data to uplink channel
chirpstack-packet-multiplexer-1  | 2024-11-15T09:55:34.024388Z  INFO chirpstack_packet_multiplexer::forwarder: Initializing forwarder to server gateway_id=0016c001ff1a0a5f server=10.12.100.10:1700

this was the error, now it's working. thanks for you help

can you pin that container default latest version to 4 to match the readme compose example, i was scratching my head yesterday when it was failing to pull from docker hub 🤣

image: chirpstack/chirpstack-packet-multiplexer:4.0.0-test.2 to be image: chirpstack/chirpstack-packet-multiplexer:4