ble_monitor: Bug - struct.error: unpack requires a buffer of 4 bytes

Environment

Passive BLE monitor integration (Xiaomi Mijia BLE MiBeacon monitor) Installed version: 0.9.4

Version 2021.1.0
Installation Type Home Assistant Supervised
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.7
Operating System Family Linux
Operating System Version 5.4.72-v7+
CPU Architecture armv7l

Logger: homeassistant Source: custom_components/ble_monitor/init.py:366 First occurred: 10. januára 2021, 16:57:47 (1 occurrences) Last logged: 10. januára 2021, 16:57:47 Error doing job: Fatal error: protocol.data_received() call failed.

Traceback (most recent call last): File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 862, in _read_ready__data_received self._protocol.data_received(data) File "/config/custom_components/ble_monitor/aioblescan_ext.py", line 1497, in data_received self.process(packet) File "/config/custom_components/ble_monitor/__init__.py", line 483, in process_hci_events msg, binary, measuring = self.parse_raw_message(data) File "/config/custom_components/ble_monitor/__init__.py", line 736, in parse_raw_message result.update(resfunc(xvalue)) File "/config/custom_components/ble_monitor/__init__.py", line 366, in obj0d10 (temp, humi) = TH_STRUCT.unpack(xobj) struct.error: unpack requires a buffer of 4 bytes

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 25

Most upvoted comments

I added the same fix (skip if the message doesn’t have the correct length) for most messages. Is added in 1.2.0-beta.

Please update to 1.1.4. This is solved in 1.1.4.

Hi @Ernst79

  • BLE updated to 1.1.1
  • init.py - changed
  • HA restarted

I am waiting for error, when error will display I will add it here