Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Bluetooth Heartrate-server example error
QtWS25 Last Chance

Qt Bluetooth Heartrate-server example error

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 2 Posters 994 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndreaFurlani
    wrote on last edited by AndreaFurlani
    #1

    Hello, I'm trying to use the example code "heartrate server".
    When I try to lunch it, I get this error:

    qt.bluetooth.bluez: received advertising error
    

    I already checked both on google and here on the forum but I didn't find a solution.
    I'm using Qt Creator 4.14.0 with Qt 5.15.2 on a virtual machine with Ubuntu 20.04.2 LTS. I already used the bluetooth with other codes and examples without any problem.
    Thanks for all the help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      Did you follow this note from the documentation:

      Note: On Linux, advertising requires privileged access, so
      you need to run the example as root, for instance via sudo.
      

      ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AndreaFurlani
        wrote on last edited by
        #3

        Thank you @SGaist.
        I'm trying to do it now but after following this guide, I simply get the error in an external terminal window

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What are you doing exactly ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AndreaFurlani
            wrote on last edited by
            #5

            Under Options>Tools>Environment>System>Terminal I have as default value "/usr/bin/x-terminal-emulator -e".
            I changed it into "/usr/bin/x-terminal-emulator -e sudo". Then in my project window I checked the option "run in terminal".
            On my laptop it didn't work as I mentioned above, on my other pc (desktop with same OS and Qt creator/Qt version) it worked.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you check the differences between the two like Bluetooth hardware, drivers version, library version etc ?

              Are you also able to sudo on both machines ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AndreaFurlani
                wrote on last edited by
                #7

                They have the same libraries version but different hardware (on the PC I'm using a dongle, on laptop I'm using the internal chip).

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Did you check whether it's working with the dongle on your laptop ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    AndreaFurlani
                    wrote on last edited by
                    #9

                    Yes I checked and I have the same issue. The strange thing is that once I run the program in an external terminal, it doesn't ask me for the password on the laptop, while on my PC it asks for it

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      What do you mean by it does not ask you for password ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        AndreaFurlani
                        wrote on last edited by
                        #11

                        On the Pc, when I run the program a new terminal opens asking me for my admin password and then the program starts.
                        On the laptop, the new terminal opens without asking me for the admin password and starts directly the program which returns me the advertising error

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Then you should yourself test it from a terminal that you have the control on.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            AndreaFurlani
                            wrote on last edited by AndreaFurlani
                            #13

                            I have changed the permissions for BLE advertising and I'm able to both use bluetoothctl and hcitools without root permissions. But still with qt creator I get the error "advertising error" if I don't use an external terminal, but using it I'm not able to perform debugging (it starts and immediatly say "debugging has finished")

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved