Scanning BLE beacons
-
It's been a long time since I've done it, sorry I don't remember the details. Check the example docs above, it explains how to connect to various services and characteristics, then you can start receiving the data.
-
@sierdzio said in Scanning BLE beacons:
Or you want to read the data that the device is sending? To do that, you need to connect to it first. https://doc.qt.io/qt-5/qtbluetooth-lowenergyscanner-example.html#connecting-to-services
not with beacon, beacons are not connectable. And the Qt Api gives no way to identify that.
what the op is looking for should be in
https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1@J-Hilk said in Scanning BLE beacons:
@sierdzio said in Scanning BLE beacons:
Or you want to read the data that the device is sending? To do that, you need to connect to it first. https://doc.qt.io/qt-5/qtbluetooth-lowenergyscanner-example.html#connecting-to-services
not with beacon, beacons are not connectable. And the Qt Api gives no way to identify that.
what the op is looking for should be in
https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1No. It has to get a payload. Every beacon has a payload (20 bytes) of my own data. App. I wrote on my phone (Android) gets all beacons and I see my payload too.
Wat's the point to get a beacon? To see it's name, rssi, and other fields ? I need the data it sends. -
@J-Hilk said in Scanning BLE beacons:
@sierdzio said in Scanning BLE beacons:
Or you want to read the data that the device is sending? To do that, you need to connect to it first. https://doc.qt.io/qt-5/qtbluetooth-lowenergyscanner-example.html#connecting-to-services
not with beacon, beacons are not connectable. And the Qt Api gives no way to identify that.
what the op is looking for should be in
https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1No. It has to get a payload. Every beacon has a payload (20 bytes) of my own data. App. I wrote on my phone (Android) gets all beacons and I see my payload too.
Wat's the point to get a beacon? To see it's name, rssi, and other fields ? I need the data it sends.@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
-
@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
@J-Hilk said in Scanning BLE beacons:
@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
I see. But info has no such field.
void BT_DEVICE::AddDevice(const QBluetoothDeviceInfo &info) { info. //no manufacturerData }
-
This function was introduced in Qt 5.12.
Maybe you are using older Qt version?
-
@J-Hilk said in Scanning BLE beacons:
@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
I see. But info has no such field.
void BT_DEVICE::AddDevice(const QBluetoothDeviceInfo &info) { info. //no manufacturerData }
@jenya7 said in Scanning BLE beacons:
@J-Hilk said in Scanning BLE beacons:
@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
I see. But info has no such field.
no, it does not, and here you come in and either
- expand DeviceInfo class that comes with the BTLE example and you're usingor
- create your own interface class that wraps around QBlueToothDeviceInfowritten before the edit of
void BT_DEVICE::AddDevice(const QBluetoothDeviceInfo &info)
{
info. //no manufacturerData
}@sierdzio is probably right, what version are you using?
-
@jenya7 said in Scanning BLE beacons:
@J-Hilk said in Scanning BLE beacons:
@jenya7 I'm not sure to what you're replying ?
I said, your payload can be accessed via https://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#manufacturerData-1
I do it too.
I see. But info has no such field.
no, it does not, and here you come in and either
- expand DeviceInfo class that comes with the BTLE example and you're usingor
- create your own interface class that wraps around QBlueToothDeviceInfowritten before the edit of
void BT_DEVICE::AddDevice(const QBluetoothDeviceInfo &info)
{
info. //no manufacturerData
}@sierdzio is probably right, what version are you using?
-
@J-Hilk said in Scanning BLE beacons:
@sierdzio is probably right, what version are you using?
It is 5.11.3
-
@jenya7 If you follow the link from @J-Hilk you will see that you need Qt >= 5.12 for that method.
-
@jsulm said in Scanning BLE beacons:
@jenya7 If you follow the link from @J-Hilk you will see that you need Qt >= 5.12 for that method.
Wow. On Linux the latest available from repository is 5.11.3.
@jenya7 said in Scanning BLE beacons:
On Linux the latest available from repository is 5.11.3
You can install newer versions using Qt Online Installer...
-
@jenya7 said in Scanning BLE beacons:
On Linux the latest available from repository is 5.11.3
You can install newer versions using Qt Online Installer...
@jsulm said in Scanning BLE beacons:
@jenya7 said in Scanning BLE beacons:
On Linux the latest available from repository is 5.11.3
You can install newer versions using Qt Online Installer...
I see no options for Linux there.
-
@jsulm said in Scanning BLE beacons:
@jenya7 said in Scanning BLE beacons:
On Linux the latest available from repository is 5.11.3
You can install newer versions using Qt Online Installer...
I see no options for Linux there.
@jenya7 And what is this: https://www.qt.io/download-thank-you?os=linux ?
-
@jenya7 And what is this: https://www.qt.io/download-thank-you?os=linux ?
@jsulm said in Scanning BLE beacons:
@jenya7 And what is this: https://www.qt.io/download-thank-you?os=linux ?
sorry, may be stupid question - how do I run it?
tied this waysudo /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: nC@�!@8: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: ELF: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 2: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: @#: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 3: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: Syntax error: "(" unexpected
-
chmod +x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
Do not install as
root
. -
@jsulm said in Scanning BLE beacons:
@jenya7 And what is this: https://www.qt.io/download-thank-you?os=linux ?
sorry, may be stupid question - how do I run it?
tied this waysudo /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: nC@�!@8: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: ELF: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 2: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: @#: not found /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 3: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: Syntax error: "(" unexpected
-
@jenya7 No need for sudo.
# First make it executable chmod u+x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run # Run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
@jsulm said in Scanning BLE beacons:
@jenya7 No need for sudo.
# First make it executable chmod u+x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run # Run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
chmod u+x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
sudo /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: nC@�!@8: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: ELF: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 2: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: @#: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 3: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: Syntax error: "(" unexpectedI tried also Properties-> Execute : Anyone
Then Double click -> Execute in terminalIt's linux-x64. I'm not sure Raspbian is 64 it's 32 as far as I know.
-
Raspbian is ARM, so it won't work anyway.
-
@jsulm said in Scanning BLE beacons:
@jenya7 No need for sudo.
# First make it executable chmod u+x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run # Run /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
chmod u+x /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
sudo /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: nC@�!@8: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 1: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: ELF: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 2: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: @#: not found
/home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: 3: /home/pi/Downloads/qt-unified-linux-x64-4.2.0-online.run: Syntax error: "(" unexpectedI tried also Properties-> Execute : Anyone
Then Double click -> Execute in terminalIt's linux-x64. I'm not sure Raspbian is 64 it's 32 as far as I know.
-
@jsulm said in Scanning BLE beacons:
@jenya7 @sierdzio Ah, it's on ARM. In this case you will need to build Qt by yourself if you require a newer version.
Actually it's Debian fitted for Raspberry. I think 32-bit version will run but I see only 64-bit version available.
-
@jsulm said in Scanning BLE beacons:
@jenya7 @sierdzio Ah, it's on ARM. In this case you will need to build Qt by yourself if you require a newer version.
Actually it's Debian fitted for Raspberry. I think 32-bit version will run but I see only 64-bit version available.
@jenya7 said in Scanning BLE beacons:
I think 32-bit version will run
No it will not. RaspberryPi is ARM, not x86...