Bluetooth-Devices / dbus-fast

A faster version of dbus-next
MIT License
35 stars 8 forks source link

dbus-fast binary incompatibility on RaspberryPi with Bleak #270

Closed svhoy closed 9 months ago

svhoy commented 9 months ago

Description

Hello,

After I am upgraded Bleak (0.21.1) and dbus-fast (2.0.0 and 2.14.0) on my Raspberry Pi there are a issue when I like to start scanning for BLE Devices with BleakScanner. It seems something going wrong when I am initialize the BleakScanner.

What I Did

In my code I am just calling BleakScanner() and after that the only thing that happends is the error in Logs.

async def scan(self, timeout: float = 10.0) -> list[BLEDevice]:
        _scanner = BleakScanner()
        return await _scanner.discover(timeout=timeout)

Logs

2023-11-15 18:39:59,959 - pi_socket - ERROR: Can not create Dataclass: dbus_fast.signature.Variant size changed, may indicate binary incompatibility. Expected 24 from C header, got 20 from PyObject

Sorry that I can't provide more Logging Informations, when I am runnging my program with dbus-fast 1.84.2 I can see the whole Scanning progress in my log but with dbus-fast >=2.0.0 there is only thats what is comming. Also for not providing more Informations. I am just using Bleak and they told me this might be a problem with dbus-fast so I should reporded here.

If there is more information I can providing you feel free to contact me.

Thanks for your help in advance.

bdraco commented 9 months ago

This happens when the c extension installed doesn't match the python code. So you have a version mismatch

Completely remove all copies of dbus-fast from your system and clean up your build directory and reinstall dbus-fast

Also you can probably avoid building the binary and install from piwheels If you are using armv7 https://www.piwheels.org/project/dbus-fast/

github-actions[bot] commented 9 months ago

Assuming the original issue was solved, it will be automatically closed now.