custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.93k stars 248 forks source link

[Bug]: Error doing job: Fatal error #1388

Closed sezlony closed 2 weeks ago

sezlony commented 2 months ago

What happened?

found this entry in log, no apparent misbehavior

Sensor type

No response

Relevant log output

Logger: homeassistant
Source: custom_components/ble_monitor/ble_parser/__init__.py:134
Integration: Passive BLE monitor (documentation, issues)
First occurred: July 13, 2024 at 10:04:27 AM (10 occurrences)
Last logged: September 17, 2024 at 12:49:58 PM

Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1013, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.12/site-packages/aioblescan/aioblescan.py", line 1855, in data_received
    self.process(packet)
  File "/config/custom_components/ble_monitor/__init__.py", line 662, in process_hci_events
    sensor_msg, tracker_msg = self.ble_parser.parse_raw_data(data)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ble_monitor/ble_parser/__init__.py", line 134, in parse_raw_data
    shortened_local_name = adstruct[2:].decode("utf-8")
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 1: invalid start byte
Ernst79 commented 2 weeks ago

This was fixed already a long time in 12.6.3, see https://github.com/custom-components/ble_monitor/releases/tag/12.6.3

Make sure your BLE monitor version is up to date.

sezlony commented 1 week ago

I'm using v12.15.0, so I assume it was not fixed successfully in 12.6.3

anyways, got another kind of this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1017, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.12/site-packages/aioblescan/aioblescan.py", line 1855, in data_received
    self.process(packet)
  File "/config/custom_components/ble_monitor/__init__.py", line 583, in process_hci_events
    sensor_msg, tracker_msg = self.ble_parser.parse_raw_data(data)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ble_monitor/ble_parser/__init__.py", line 133, in parse_raw_data
    service_class_uuid16 = (adstruct[2] << 8) | adstruct[3]
                            ~~~~~~~~^^^
IndexError: index out of range