gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
963 stars 330 forks source link

Using {port} in the Publish Uplinks field of MQTT Connector #781

Open edulbastos opened 3 years ago

edulbastos commented 3 years ago

Hi,

When using {port} in the Publish Uplinks field of MQTT Connector, the {port} is not translated to the specific port (the port parameter is in the uplink field) and I don´t receive any message in the MQTT server. I want to separate different ports to differents topics in the MQTT servers. Any hints?

Regards,

Eduardo Bastos

altishchenko commented 3 years ago

Hello, can you show me how are you using this parameter? Passing port field by default (in the Fields parameter) works fine.

beavis88 commented 2 years ago

I have the same issue. I'm not receiving any MQTT topics when publish uplinks parameter includes {port}. All works fine when {port} is removed. My handlers "Parse Uplink" is default (empty).

altishchenko commented 2 years ago

Hello, can you share your handler and connector configuration, so I may have a look on what is going wrong?

edulbastos commented 2 years ago

Hi @altishchenko,

Sorry about the delay. I´m using {port} after the published topic. Ex: (in the Publish Uplinks field):

TTGO/{port}

But I´m not receiving any MQTT topic with port attached at the end. The attribute port is in the Uplink Fields.

Regards,

Eduardo Bastos

edulbastos commented 2 years ago

Hi @altishchenko,

The screenshots of my Handler and Connector configuration are as follow:

Handler Connector

Regards,

Eduardo Bastos

beavis88 commented 2 years ago

My settings for handler: downlink_expires = "never"; event_fields = ("app", "event", "appid", "devaddr", "appargs", "datetime", "deveui", "port"); payload = "custom"; uplink_fields = new JArray("port", "app", "data", "datetime", "deveui", "desc", "freq", "codr", "datr", "fcnt");

Connector: auth = "normal"; enabled = true; format = "raw"; publish_qos = 0; publish_uplinks = @"{app}/{port}"; publish_events = @"{app}/events"; received = @"{deveui}/tx"; subscribe = "+/tx"; subscribe_qos = 0; uri = "mqtt://127.0.0.1:1883";

All other fields are empty (default).