Issue with mqtt2to3

I am having trouble with the sub command mqtt2to3. The gateway bridge is not connecting to mqtt2to3. I have followed the instructions in the changelog page. Right now I am running 2 instances of loraserver: one with the subcommand and one without it. What am I doing wrong? The log of the mqtt2to3 stops at the following line:

level=info msg=“mqtt2to3: connected to mqtt broker”

Nothing happens after that.

I am using gateway bridge version 2.7.1 and loraserver version 2.8.2

There is no such connection between the LoRa Gateway Bridge and mqtt2to3. What the mqtt2to3 sub-command does for you is:

LoRa Gateway Bridge to LoRa Server direction

Transform “old” topics to “new” topics. The idea is that LoRa Server (v2) is configured to use the v3 MQTT topics. Data received from LoRa Gateway Bridge v2 gateways will thus be re-published to v3 MQTT topics (meaning there is a duplication of data).

LoRa Server to LoRa Gateway Bridge direction

Transform “new” to “old” topics. This to make sure that LoRa Gateway Bridge v2 gateways are able to receive data that is published on “new” topics (again this means data is duplicated).

As long as you are not using LoRa Gateway Bridge v3 or have re-configured LoRa Server to use the v3 topics, it is expected behavior that the mqtt2to3 does nothing, as there is nothing to translate.

See also: https://forum.loraserver.io/t/upgrading-from-lora-server-v2-to-lora-server-v3/4627.

Thanks for the prompt reply. What you mentioned in the first paragraph is what I am doing.

I have configured loraserver (v2) with v3 topics, so that I can upgrade my gateways one by one to v3 without any issues. I have also started the mtt2to3 sub command separately.

Here is where the problem arises. My gateway running v2 gateway bridge is publishing to v2 topics, which in theory should be subscribed by mqtt2to3 sub command and forwarded to loraserver. This is not happening.

Can you confirm that the gateway data is published to the old topics. E.g. when you have setup Mosquitto ACLs, then they might not match the new topics and published data is silently dropped and thus the mqtt2to3 does not see any data published.

That’s what I initially suspected as well. So I switched off acl and tried it. It still did not work.

Below is my gateway log:
time=“2019-05-29T10:26:45Z” level=info msg=“mqtt: subscribing to topic” qos=1 topic=in/gateway/7276ff00390304a8/tx
time=“2019-05-29T10:26:45Z” level=info msg=“mqtt: subscribing to topic” qos=1 topic=in/gateway/7276ff00390304a8/config
time=“2019-05-29T10:31:13Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/stats
time=“2019-05-29T10:34:38Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:34:45Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:34:52Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:35:06Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:35:13Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:35:20Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx
time=“2019-05-29T10:35:38Z” level=info msg=“mqtt: publishing message” qos=1 topic=in/gateway/7276ff00390304a8/rx

My acl settings:
user loraserver_gw_in
topic write in/gateway/+/stats
topic write in/gateway/+/rx
topic read in/gateway/+/tx
topic write in/gateway/+/ack
topic read in/gateway/+/config

user loraserver_ns_in
topic read gateway/+/event/+
topic write gateway/+/command/+

user loraserver_ns_in_mqtt2to3
topic read in/gateway/+/stats
topic read in/gateway/+/rx
topic write in/gateway/+/tx
topic write in/gateway/+/config
topic read in/gateway/+/ack
topic write gateway/+/event/+
topic read gateway/+/command/+

I checked your mqtt2to3 code and it is handling region prefix for topics as well. So that’s not the issue either.

@brocaar It was indeed acl configuration. It’s working now. Thank you for the help.

1 Like