Protobuf Decoding in Nodejs



I upgraded LoRa Gateway Bridge and Loraserver to V3 and MQTT messages now use protobuf. I had an MQTT listner previously subscribed to /gateway/+/events/stats and used this to monitor my gateways from node-red.

With protobuf I have not been able to decode the messages correctly. I have set Proto Message Type as “GatewayStats” but I get “Error: no such Type or Enum ‘google.protobuf.Timestamp’ in Type .gw.GatewayStats”.

When I subscribe to /gateway/+/events/ack , I can get thge values but gateway ID is garbled.
E.G shows this gatewayId: "Tp9V//4dmOM=" instead of gatewayId: "4e9f55fffe1d98e3".

What could be the issue? Has anyone done this with Node-Red?


Please note that you can configure the marshaler in your lora-gateway-bridge.toml file to both protobuf and json. In v2 there was a v2_json option.

As the json marshaler still uses the Protobuf library for encoding values, there is a difference in how the v2_json and json is encoded. See also:

This is mentioned at, I will also add this note to
In short, following the Protobuf mapping, an array of bytes must be encoded as base64 and your “garbled” gatewayID still contains the same value:


Thank you very much. I did try a base64 convertion on the string but the output looked like " Hieroglyphics" so i concluded it was garbled. Now I realise I had to serialize the converted output in HEX rather than as ASCII. I am able to recover the right values now.

The link provided brings clarity.


I notice my lora-gateway-bridge config file located in /etc/lora-gateway-bridge is still the old version and markedly different from the sample config file here . Shouldn’t this have changed with the upgrade? The current config file doesn’t have a setting for marshaler.
How do I confirm this is the actual running configs? I am unable to locate any other config in the locations stated in the documention below.

By default lora-gateway-bridge will look in the following order for a configuration at the following paths when --config / -c is not set:

  • lora-gateway-bridge.toml (current working directory)
  • $HOME/.config/lora-gateway-bridge/lora-gateway-bridge.toml
  • /etc/lora-gateway-bridge/lora-gateway-bridge.toml


No, changing people’s config files underneath them is generally bad form. The only person who knows what went into that file is the author. You can use the configfile option to print a new default configuration file for editing: