chirpstack / chirpstack-concentratord

Concentrator HAL daemon for LoRa gateways.
https://www.chirpstack.io/
MIT License
71 stars 50 forks source link

Uplink stops being processed correctly by chirpstack if concentratord is used along with mqtt-forwarder with json=true #124

Closed nicolas-juteau closed 7 months ago

nicolas-juteau commented 7 months ago

What happened?

As the title states, uplink stops being processed correctly by chirpstack if concentratord is used along with mqtt-forwarder with json=true.

At this point, the following error occurs for each received uplink (NOTE: gateway eui obfuscated):

ERROR chirpstack::gateway::backend::mqtt: Processing gateway event error: unknown field gwTime, expected one of gateway_id, gatewayId, uplink_id, uplinkId, time, time_since_gps_epoch, timeSinceGpsEpoch, fine_time_since_gps_epoch, fineTimeSinceGpsEpoch, rssi, snr, channel, rf_chain, rfChain, board, antenna, location, context, metadata, crc_status, crcStatus at line 1 column 237 topic="us915_0/gateway/00800000a000XXXX/event/up" qos=0

This issue does not occur in the following scenarios:

What did you expect?

I'd expect no error on up event.

Steps to reproduce this issue

Steps:

  1. Configure mqtt-forwarder so it uses concentratord backend and set mqtt config block property json to TRUE
  2. Launch concentratord/mqtt_forwarder on gateway
  3. Wait until up event are received by chirpstack
  4. Notice the chirpstack::gateway::backend::mqtt error in the logs

Could you share your log output?

ERROR chirpstack::gateway::backend::mqtt: Processing gateway event error: unknown field gwTime, expected one of gateway_id, gatewayId, uplink_id, uplinkId, time, time_since_gps_epoch, timeSinceGpsEpoch, fine_time_since_gps_epoch, fineTimeSinceGpsEpoch, rssi, snr, channel, rf_chain, rfChain, board, antenna, location, context, metadata, crc_status, crcStatus at line 1 column 237 topic="us915_0/gateway/00800000a000XXXX/event/up" qos=0

Your Environment

Environment all uses latest version (v4) of chirpstack, chirpstack-concentratord and chirpstack-mqtt-forwarder. Gateway used is Multitech Conduit (MTCDT-0.1).

brocaar commented 7 months ago

Processing gateway event error: unknown field gwTime

The json=true option should only be used for debugging. In case there are name related changes (https://github.com/chirpstack/chirpstack/commit/b4845b56133bd7097dd8e1f05504a196dd13122a), it will break in case of JSON. There was a recent change (part of v4.6.0) to drop unknown JSON fields: https://github.com/chirpstack/chirpstack/commit/c82bfa5a72f1a285899c38a514db53f928d74d39

Again, I recommend you to use Protobuf. As you already found out, the issue will not occur using json=false.

nicolas-juteau commented 7 months ago

Yes, I am aware of that. That's exactly why I use it in the first place.

Thank you.