Monday, November 16, 2015

Bluetooth (BLE) Support with Qt on Raspberry Pi

There are many ways to access Bluetooth capabilities on Raspberry Pi. Qt has its own API to use Bluetooth and to implement a BLE central device. The last build I provided a few days ago didn't support Bluetooth: this package should support it. I tested the low energy scanner example and it worked properly.
Have fun! Bye ;-)

Download POT 5.1.0 with Qt 5.5.1 for Pi2 Raspbian Jessie here (extraction code: 96aa).

22 comments:

  1. Thank's a lot Luca for your build !!! Is it possible to have this build for wheezy ?

    ReplyDelete
    Replies
    1. I'm sorry, I don't plan to support wheezy anymore. I don't have enough time/tools.

      Delete
    2. Ok no problem ! It's time for me to use Jessie !
      Thank you another time for your amazing work !

      Delete
    3. Just a little post to say you that i downloaded your image and it's working perfectly with bluetooth LE !
      Thank's a lot !!!

      Delete
  2. Understandable, so it's time to move on to jessie ;-)
    Do you skip support for Pi1 as well? Please don't! My Pi is built into another case, and i cannot change it very easily.

    ReplyDelete
    Replies
    1. My tools are limited. I won't drop Pi1, but at the moment I do not have the tools I need to publish builds for it. You can however build from sources. Compatibility remains.

      Delete

  3. Good day Luca, let me thank all the work you've done.
    This contribution is really good and very useful no doubt.

    Today I pass by here to ask a question, there is a possibility that at some time
    you can make a guide for those who want, they can create their own cross-compiling?

    From already,
    thank you very much.

    ReplyDelete
    Replies
    1. cross-compiling to build QT5 in (example) Ubuntu, to prepare a version that meets the needs that everyone has.
      I know there are a lot of information on your website on this issue but so that I failed to find the order to get it.

      Thank you.

      Delete
    2. Yes, there are a couple of articles explaining how to build Qt for Pi. Also there are a few articles written by Qt guys. I'm not sure what can be added to that amount of information.

      Delete
    3. I just thought it would be good to teach the order (for those who are not familiar) in which to take the articles to complete the task in a good way. Anyway you're right, a lot of information and everyone should invest some time to understand it. It may not be all that easy in life.

      Thanks for your great work.

      Delete
    4. Unfortunately for as much info I could provide it will always be somehow involved to build everything because it also depends on many many variables. Also it is difficult to find the time to always describe precisely everything and keep it up to date.

      Delete
  4. Hi lucas. I'm trying to use Qt ftp on my raspberry. For that i have dowloaded the source here https://github.com/qtproject/qtftp. Why i would use this ? because QnetworkaccessManager don't give the way to list (or create folder) the tree of a ftp server. After a build of this module on desktop pc (works very well) i would like to do it for the rasp.
    To do this, i put the source at /opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/qtftp-master/ (on my host machine).
    make a /opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/bin/syncqt.pl -version 5.5.1
    make a /opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/bin/qmake ./qtftp.pro
    and
    $ make ARCH=arm CROSS_COMPILE=/opt/rpi/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/
    and after i have this error :

    /opt/rpi/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libm.so

    Do you have an idea what is wrong ?

    ReplyDelete
    Replies
    1. Try to:
      /opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/bin/qmake ./qtftp.pro
      export PATH=/opt/rpi/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
      make

      Delete
    2. Thanks but same error !

      Delete
    3. Seems to build here. Maybe something wrong with your sysroot.

      Delete
    4. Lucas, i have put a message on qt forum https://forum.qt.io/topic/61208/qt-ftp-on-raspberry. A guy ask me if the version of libm.so is cross compil, could you give an answer ?Otherwise i tested to mount directly my raspberry sd card on opt/rpi/sysroot but same problem !
      If i put this on a shell ls -l | grep libm.so i can see the symbolic link
      lrwxrwxrwx 1 root root 34 sept. 6 03:59 libm.so -> /lib/arm-linux-gnueabihf/libm.so.6

      I don't understand what's happen ! In you side, if i understand, you build it with success ?

      Delete
    5. If you need that I can include in the build. But I'll only provide builds for Jessie Pi2 at the moment.

      Delete
    6. Yes it would be very interesting, even if i would like to do it myself ...
      The build for pi2 with jessie is perfect !

      Delete
  5. HI lucas, yes it would be very interesting, even if i would like to do it myself ... Otherwise the jessie version for pi2 is perfect !

    ReplyDelete
  6. Hi,
    I try to run the example of scanner, but it doesnt function. In console the bluetooth I can see other devices, but in qt I cannot. Any idea?

    ReplyDelete
    Replies
    1. I quickly tested and the sample app included in Qt seemed to discover devices. No idea why it does not work for you, sorry.

      Delete