rssis is optional and only available when the gateway supports it.
When not available, do not serialize it (as JSON "null") otherwise it
makes Erlang code to crash.
with trace:
[error] <0.4614.7>@miner_lora_light:handle_packets:482 gen_server miner_lora_light terminated with reason: bad argument in call to erlang:trunc(null) in miner_lora_light:handle_packets/4 line 482
[error] <0.4614.7>@miner_lora_light:handle_packets:482 CRASH REPORT Process miner_lora_light with 0 neighbours crashed with reason: bad argument in call to erlang:trunc(null) in miner_lora_light:handle_packets/4 line 482
rssis
is optional and only available when the gateway supports it. When not available, do not serialize it (as JSON "null") otherwise it makes Erlang code to crash.Code crash has been observed here, when
gwmp-mux
forwards a packet containing{"rssis": null}
: https://github.com/helium/miner/blob/andymck/poc-grpc/src/miner_lora_light.erl#L482with trace: [error] <0.4614.7>@miner_lora_light:handle_packets:482 gen_server miner_lora_light terminated with reason: bad argument in call to erlang:trunc(null) in miner_lora_light:handle_packets/4 line 482 [error] <0.4614.7>@miner_lora_light:handle_packets:482 CRASH REPORT Process miner_lora_light with 0 neighbours crashed with reason: bad argument in call to erlang:trunc(null) in miner_lora_light:handle_packets/4 line 482
This fixes the crash.