On Thu, 28 Jun 2018 at 22:40, Jason H <jh...@gmx.com> wrote: > I've used bluetoothctl to pair to my mac, but when I try to get local > adapters on the Pi from Qt, there are none: > > log: > Local Adapters: > ASSERT: "!isEmpty()" in file > /usr/include/arm-linux-gnueabihf/qt5/QtCore/qlist.h, line 294 > > > code: > auto localAdapters = QBluetoothLocalDevice::allDevices(); > qDebug() << "Local Adapters:"; > for (const auto &adapter: localAdapters) { > qDebug() << adapter.address().toString() << adapter.name(); > // <<pairingStatus(adapter.address()); > } > > bool result = listen(localAdapters.first().address()); > > Any ideas on what it takes to get it working on a Pi? When I run it on my > mac, it is fine. >
BT on Raspberry Pi is very unstable. I've tried to work with it 6 months ago and actually abandoned the project because it was practically unusable. However, I've noticed they have released a lot of software and firmware updates since then. So my first suggestion: upgrade Raspbian (if you are using it) to newest version. Second: check if BT is stable in the system using some BT device (like bluetooth headphones or something). If you can pair a device in the system itself (and if the connection is stable / not dropped after reset etc.) then Qt will see it, too. Ah and lastly, be sure to install all QBluetooth dependencies. If you cross-copile Qt yourself, make sure bluetooth support is listed as enabled (by default it is not). Some packages worth installing: sudo apt install libinput-dev libts-dev bluez libbluetooth-dev > > I'm also relatively new to BT. I've copied the chat example as close as > possible. But I have _so_many_ questions. > > Ultimately, I am providing a serial interface service over BT that > operates some hardware on the Pi. the mac/android app will connect to it. > I'm currently doing this with sockets but I don't want to require IPs or IP > infrastructure. > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest