3 ms·
> Linux Bluetooth is incredibly painful to handle in a headless way. Binding to DBus requires cross-compiler magic and not even Cross was getting me out of it.
by lesuorac 3y ago
> Linux Bluetooth is incredibly painful to handle in a headless way. Binding to DBus requires cross-compiler magic and not even Cross was getting me out of it.
That was my experience as well. I was doing something different so ultimately I just decided I'd put both the devices on the same WiFi network and then scan for "pi.local".
Do wish I knew how all those other crates work though where it crashes at runtime if you don't have a library instead of refusing to build.
- wutwutwat 3y agoHome assistant does headless bt presence detection in ~200 lines of python I think the author had a painful experience because they wanted to do embedded and had to interface at a much lower level, where it's a long ago solved problem in higher level languages. Considering the tracker ended up in their door next to their computer, they could have stuck with the rpi that ran python and been fine https://github.com/home-assistant/core/blob/dev/homeassistant/components/bluetooth_tracker/device_tracker.py https://github.com/home-assistant/core/blob/dev/homeassistan... https://www.home-assistant.io/integrations/bluetooth_tracker/ https://www.home-assistant.io/integrations/bluetooth_tracker...
- lesuorac 3y agoI don't know the author's code but mine was at the same level as home assistant's. I believe I was using Bluer (BlueZ) [1] and afaik the problem is that the dependency needs an armv7 version of DBUS when it compiles which my non-armv7 laptop did not provide. If I do the home assistant route and just copy my source code over to the raspi and build the binary there it all compiles+runs fine. Except for the part where I can't compile it locally and so I don't know of a build issue until its been transferred + built. [1]: https://github.com/bluez/bluer https://github.com/bluez/bluer