Closed mmrein closed 1 year ago
Could possibly be improved in following way because in Chirpstack v3 there was error logged in the Events tab when decoder failed to decode data in case the data: null
was received (which was quite expected).
In Chirpstack v4 the Events tab seems "frozen" upon receiving such message and no more data is logged in the Events tab after that (while LoRaWAN frames continues to log the up/down packets correctly) and ERROR chirpstack::api::internal: Reading event-log returned error: Cannot serialize NaN as google.protobuf.Value.number_value
is being continuously logged in the journal (once per second it seems).
// v3 to v4 compatibility wrapper
function decodeUplink(input) {
// Check if bytes array is not empty:
if ( input.bytes.length > 0 ) {
return {
data: Decode(input.fPort, input.bytes, input.variables)
};
}
}
Thanks!
With regards the error:
ERROR chirpstack::api::internal: Reading event-log returned error: Cannot serialize NaN as google.protobuf.Value.number_value
I think that is better fixed in the ChirpStack code itself. I'll look into this.
@mmrein the above commit to ChirpStack fixes this issue properly.
Thanks for letting me know. Will test eventually when I regain access to server (network restructure).
I guess https://github.com/chirpstack/chirpstack/issues/39 also applies for migration tool.