Bluetooth Low Energy example doesn't work
-
Hello,
I'm new in Qt, and I want to develop a program with BLE connection. I started to run "Bluetooth Low Energy Scanner" example and some other examples from the examples list. But it doesn't work correctly. The list of devices always empty.
I am using windows 10 and Qt 5.10.0
Can anyone help me please? -
@Ashi said in Bluetooth Low Energy example doesn't work:
Can anyone help me?
I found this but still confused!
Does Qt supports Bluetooth API on Windows 10?By reading the docs, no. At least not until someone provides a suitable driver.
-
Hi and welcome to devnet,
IIRC, the
wip/win
branch of the module provides preliminary support for BLE. However you have to build it yourself. -
-
nmake install
in the build folder if you are using Visual Studio andmingw32-make install
if you are using MinGW -
@SGaist After made make install I got the following:
C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity>nmake install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. cd src\ && ( if not exist Makefile C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity\src\src.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. cd bluetooth\ && ( if not exist Makefile C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity\src\bluetooth\bluetooth.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile install Project MESSAGE: perl -w C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\syncqt.pl -module QtBluetooth -version 5.10.1 -outdir C:/Qt/Qt5.10.0/Examples/Qt-5.10.0/qtconnectivity C:/Qt/Qt5.10.0/Examples/Qt-5.10.0/qtconnectivity 'perl' is not recognized as an internal or external command, operable program or batch file. Project ERROR: Failed to run: perl -w C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\syncqt.pl -module QtBluetooth -version 5.10.1 -outdir C:/Qt/Qt5.10.0/Examples/Qt-5.10.0/qtconnectivity C:/Qt/Qt5.10.0/Examples/Qt-5.10.0/qtconnectivity NMAKE : fatal error U1077: 'cd' : return code '0x3' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
And still after running the example again, the devices list is empty.
-
As the error suggests: you are missing Perl. Install it.
It’s normal noting changed, the module wasn’t even built.
-
@SGaist During installation process of QT this problem occurred:
So I clicked 'Ignore'.
Then I tried to install "C:\Qt\Qt5.10.0\Tools\Perl52213_32\strawberry-perl-5.22.1.3-32bit.msi
but nothing changed.
I tried to reinstall it and disabled Antivirus and the same error appeared.
Is there anyway to overcome this problem? -
Did it install successfully ?
If so did you try to call perl from a new command prompt ? -
@SGaist I restarted the Qt command line and the error that related to Perl disappeared and I got the following:
C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity>nmake install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. cd src\ && ( if not exist Makefile C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity\src\src.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. cd bluetooth\ && ( if not exist Makefile C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity\src\bluetooth\bluetooth.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile.Release install Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /OPT:REF /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.10 /MANIFEST:embed /OUT:..\..\lib\Qt5Bluetooth.dll @C:\Users\kacst\AppData\Local\Temp\nm98A.tmp Qt5Core.lib(Qt5Core.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x458' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. C:\Qt\Qt5.10.0\Examples\Qt-5.10.0\qtconnectivity>
Thanks for your response!
-
You should also use the correct command line prompt for building especially if you start with the one provided by Visual Studio.