dasdigidings / The_Things_Stack_v3-payload_functions

various payload decodeUplink functions
GNU Affero General Public License v3.0
3 stars 1 forks source link

Tabs decoder gives wrong "decoded_payload" when payload.bytes is empty [ ] #2

Closed jensileinchen closed 2 years ago

jensileinchen commented 2 years ago

If "payload.uplink_message.decoded_payload.bytes" is [ ] the "payload.uplink_message.decoded_payload" gives out strange / wrong values .... we found this problem in the Grafana-Visualisation of our TABS TBDW100 (Door & Window) -- from time to time there are messages from the devices with empty bytes-array of the recieved payload. This causes 2.50 V, some temperature deep minus degrees (for indoor rooms). I think the decoder should check the content of the payload array to avoid these values. Thanks for checking this !

photo_2022-03-17_12-20-16

Drasek commented 2 years ago

There is a new commit (https://github.com/dasdigidings/The_Things_Stack_v3-payload_functions/commit/a3f1aff6141b072e6f216ffe73a59e72b67d447a) with added error handling in case of a missing payload or the payload beeing the wrong length/size. Please test it and report back wether i nailed all the cases or not!

jensileinchen commented 2 years ago

Wow - this was quick-response - many thanks for that and your immediate help ! i will check the values in the next days and give feedback on this issue.

jensileinchen commented 2 years ago

tbdw100 decoder seems to be fine now -- all of my 12 devices are sending regular as before - but none of it sends -32°C or 2.5Volts (as done before with empty payload-array) --- i will close this issue here - thanks @Drasek for investigation !