TheThingsNetwork / lorawan-devices

Device Repository for LoRaWAN devices
Apache License 2.0
196 stars 382 forks source link

Division by zero in Mclimate Vicki uplink formatter #836

Open Lukasz-Bialy opened 1 month ago

Lukasz-Bialy commented 1 month ago

Summary

Mclimate Vicki uplink formatter has a bug in a calculation of the motorOpenness, in case where motorRange parameter(in device) is set to 0, formatter is trying to divide motorPosition by 0, because of that the whole uplink message from device in TTS is empty and there's a message about NaN value in motorOpenness. Mclimate on their website for the Vicki device, have new uplink formatter, and case when motorRange=0 is secured. ...

What do you see now?

I see on the TTS website, empty uplink message from the Mclimate Vicki device, json which should normally be visible is empty, even when the message itself is fine

...

What do you want to see instead?

I want to see formatted uplink message from the device, with properly calculated motorOpenness

...

How do you propose to implement this?

Copy formatter from Mclimate Vicki official website and update file lorawan-devices/vendor/mclimate/vicki.js from your repository Link to Mclimate documentation: https://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-vicki-lorawan/vicki-uplink-decoder

...

Can you do this yourself and submit a Pull Request?

If you allow me to submit Pull Request to your repository ...

KrishnaIyer commented 4 weeks ago

@Lukasz-Bialy: You can indeed create a PR and we'll review it. Thanks a lot!