You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to happen often when the battery is below 30% (solid amber battery indicator).
Added a log to decode_message at line 662 to print packets.
Added a log to SummaryDataMessageV3.__init at line 508 to print the parsed value set to status_info.
Any pointers on how to approach this?
2023-06-01 12:21:38,271 INFO: incoming summary data packet [111, 231, 7, 6, 1, 73, 14, 166, 2, 3, 66, 0, 110, 0, 70, 0, 1, 0, 7, 0, 10, 236, 53, 40, 25, 220, 0, 100, 128, 0, 97, 68, 0, 0, 254, 0, 12, 114, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 50, 0, 64, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 22, 0]
2023-06-01 12:21:38,271 INFO: status_info (nan)
2023-06-01 12:21:38,271 ERROR: Message with id 43 was corrupted: unsupported operand type(s) for &: 'float' and 'int'
Traceback (most recent call last):
File "C:\Users\suppo\install\App-Zephyr\core\protocol.py", line 725, in decode_bytestream
msg = decode_message(msgid, payload, fin)
File "C:\Users\suppo\install\App-Zephyr\core\protocol.py", line 651, in decode_message
return SummaryDataMessageV3(msgid, payload, fin)
File "C:\Users\suppo\install\App-Zephyr\core\protocol.py", line 495, in __init__
self._decode_status_info(status_info)
File "C:\Users\suppo\install\App-Zephyr\core\protocol.py", line 396, in _decode_status_info
self.device_worn_confidence = 1 - (status_info & 3)/3
TypeError: unsupported operand type(s) for &: 'float' and 'int'
The text was updated successfully, but these errors were encountered:
Hey, this should be fairly straightforward to fix - the issue is that status_info is being set to nan (to signify an invalid value), which is a float. However, float's don't support integer ops like &.
So the fix there should be to condition this on whether status_info is nan. As in device_worn_confidence = 0 if math.isnan(status_info) else 1 - (status_info & 3)/3 -- however, I think there are several more places where this can occur when status_info is invalid, and I don't have a Zephyr at hand at this time to clean these issues out and re-test the result. If you can catch some of those and can confirm that the app survives status_info becoming nan, a small pull request would be appreciated! ;)
status_info is NaN, throwing errors to log.
It seems to happen often when the battery is below 30% (solid amber battery indicator).
Added a log to decode_message at line 662 to print packets.
Added a log to SummaryDataMessageV3.__init at line 508 to print the parsed value set to status_info.
Any pointers on how to approach this?
The text was updated successfully, but these errors were encountered: