Stat packet not publish to MQTT


#1

We use LoRa Gateway Brigde v2.6.0 in our product environment, for very long time, there are not any problem. But suddenly the gateway brigde is not longer push any stat packet to MQTT topic:

  1. logs show that gateway bridge has receive the stat udp packet from gateway
  2. but when receive stat, not further logs show that gateway bridge publish it to MQTT
  3. and other event like rx_packet and tx_packet is well publishing to MQTT without any problem in that situation, the communication between server and device is not affected, only that server can’t not update gateway status.
  4. reboot gateway bridge process, everything back to normal, every stat receive follow an stat topic publish, and the server can update gateway status

I have search the implement of Runv2(which seem to be what we use), between receiving stat udp packet and publishing it to MQTT, I can’t see any like a possible error (gatewayStat chan? the getOutBoundIp()? the Prometheus?).
Can any one help us, thank you very mush.


#2

LoRa Gateway Bridge forwards what it receives from the Packet Forwarder. Have you confirmed that the Packet Forwarder sends stats to the LoRa Gateway Bridge?


#3

Yes, I’am sure that Packet Forwarder in gateway has sent it , I have check the logs inside gateway, and Gateway Bridge’s log shows for example:


#4

I have download the log, and find out some thing:
https://drive.google.com/file/d/1QqHOmZ1heDCVAZ9-s-3PdqL9g2lTD7dh/view?usp=sharing
(log is too large… 50mb :joy: )
And I found that at line 130384 it becomes weird, Gateway Bridge receive and publish packet in series.
Then come to line 130991, it occurs errors about the MQTT, and then Gateway Bridge won’t show any publish MQTT logs.
I restart it at line 229035.
Our MQTT service did has some issue today (due to the server problem, server seem to be hanging up for a while ), but I think It should reconnect, and will be good then, but it is not.


#5

Well if LoRa Gateway Bridge does publish the event but you don’t receive it, then it could be an ACL issue. Have you setup Mosquitto ACLs?


#6

No,Gateway Bridge does not publish to MQTT. And our MQTT service is implemented by using Nodejs mosca, and Gateway Bridge has root permission to pub and sub。


#7

I’ve discovered the same thing. I’m no longer getting any “gateway/” topics published to my mqtt server, just “application/”. This seems to have started happening when I upgraded to version 3.0.0.

I have a simple script running which logs everything published to mqtt in to a text file for debugging purposes and there are no “gateway/” entries after the upgrade.

I have only just discovered this and wanted to point out that it could be some change with newer LoraServer versions? I will do some more investigation now.

Edit: I’ve done some more investigation and by connecting directly to mqtt usign mosquitto_sub I can see that the “gateway/” topics are still being published but the contents of them seem to be encrypted or encoded in some way. So this explains why my logger isn’t saving them anymore as it wont be able to read them. The “application/” topics are still just plain text.


#8

It is not encrypted, it is encoded :slight_smile: Please see the LoRa Gateway Bridge configuration marshaler option (https://www.loraserver.io/lora-gateway-bridge/install/config/).


#9

sorry to reply to my own message but I have solved this.

The reason is that LoraServer v3 gateway-bridge uses protobuf encoding by default. I had to change the setting “marshaler” to “json” in the TOML file. Additionally, I had to reinstall the package to over-write my old config file as it has changed significantly between versions 2 and 3 and the old format didn’t work any more (so the default marshaler was always used).

I’ll leave the marshaler set to json for now as I can’t get my head around decoding protobuf data at the moment. :slight_smile:


#10

thanks brocaar. :slight_smile: Looks like I figured this out at the same time.