1 2 3 Previous Next 38 Replies Latest reply on Jan 23, 2016 8:10 PM by mepler

    Bluetooth Pairing

    jblackston

      Ok, I have two questions on this... First is I'm having issues trying to pair my device to my PC and my Android tablet. Every time I try and pair it I get an error on those devices that says "Unable to pair with 'device'. Incorrect PIN or password. How do I reset this, or remove the need for this?

       

      Secondly how do you setup the Bluetooth to run with out access to a command prompt. I can write a script to setup the initial settings used from the root command, but how do I handle all of the commands that are inside of bluetoothctl? There has to be away to really automate this entire process with a program you can write, because you can't expect to have access to the Linux shell when it's in the field and someone just wants to pair a BT device with the Edison.

       

      Also is Bluetooth and WiFi mutually exclusive? I notice that when I do enable Bluetooth the WiFi entry in ifconfig goes away.

        • 1. Re: Bluetooth Pairing
          CMata_Intel

          Hi jblackston

           

          Which image version are you using on your Edison? Are you following the steps in the Bluetooth Guide?

          You could create a script in C for bluetooth, for example: Bluetooth programming in C with BlueZ  Check the bluetooth libraries in /usr/include/bluetooth.

           

          I just ran in the Edison with the release 2, one session in Putty to activate bluetooth with:

          root@edison:~# rfkill unblock bluetooth
          root@edison:~# bluetoothctl
          
          

          And then I opened a new session using ssh and in that one I did a ping to google and worked fine so you should not have problems with both protocols.

          root@edison:~# ping www.google.com -c3

          Is WiFi working fine when you are not using Bluetooth?

           

          Regards;

          CMata

          • 2. Re: Bluetooth Pairing
            jblackston

            I have version 120 on my Edison. I was initially able to pair the device with my PC, after it checked with my passcode, and then I unpaired it and tried to pair it with PAN. After that I keep getting that error about the passcode. So I tried it on my android tablet and got that error as well, never successfully connected again. So for sng I grabbed another module and walked thru the steps from that document again and got the exact same results. So now I have two Edison modules that fail to pair to any device I have because the passcode is incorrect. I have no idea how to reset it, clear it, or even turn off the passcode requirement.

            • 3. Re: Bluetooth Pairing
              egorf

              Hello! I'll pitch in and ask a question.

              Is it possible to use bluetooth tethering to connect Edison to the Internet via an Android phone, or maybe a Linux computer?
              Thank you!

              • 4. Re: Bluetooth Pairing
                jblackston

                Does anybody have a resolution to this issue?

                • 5. Re: Bluetooth Pairing
                  CMata_Intel

                  Hi jblackston ;

                   

                  After doing this:

                  root@edison:/# rfkill unblock bluetooth
                  root@edison:/# bluetoothctl
                  

                  Are you able to see the other devices or the outcome is:

                  [NEW] Controller XX:XX:XX:XX:XX:XX edison [default]
                  

                  If you see the devices in this list, try with

                  [bluetooth]# remove XX:XX:XX:XX:XX:XX
                  

                  and also remove the Edison in the other devices.

                  In here you can type help and you will see different commands that may help you like trust, power, discoverable, info...

                  [bluetooth]# help
                  

                  Let us know if removing the devices from each other lists work.

                   

                   

                  Regards;

                  CMata

                  • 6. Re: Bluetooth Pairing
                    jblackston

                    I've done that before and I retried it and it doesn't resolve the problem.. This shows up all the time. I can take my Edison module and try and connect to a device that I've never connected too and I still get this error. So it's not like the connection to a previous device some how got corrupted. The issue is something on the Edison's bluetooth system is just bad. How do I remove the need for a passcode, how do I reset the pass code. Even if I perform a re-flash 'reboot ota' it doesn't go away.

                    • 7. Re: Bluetooth Pairing
                      jblackston

                      Anything new?

                      • 8. Re: Bluetooth Pairing
                        CMata_Intel

                        Hi jblackston

                         

                        I'm sorry for the delay in my response. Let's try a couple of things.

                        1. Re-flash the board using the flashall file. Windows, Linux.This will erase all the configurations you have and you will have a fresh new install.

                        2. We could check if it is a problem with the BlueZ version. Could you downgrade the image with edison-image-rel1-maint-rel1-ww42-14.zip version  you are using in order to check if Bluetooth works? If it works we will have to check the differences between the packages to make it work. This is assuming that all the bluetooth devices  you are using are working.

                         

                        Regards;

                        CMata

                        • 9. Re: Bluetooth Pairing
                          jblackston

                          Ok, I tried running flashall on the latest version of the firmware and rel1 version of the firmware. I get the same error... The commands I used after bootup to get the bluetooth up were:

                           

                              systemctl start bluetooth

                           

                              systemctl start connman

                              connmanctl enable bluetooth

                              connmanctl enable wifi   

                              rfkill unblock wifi

                              rfkill unblock bluetooth

                              bluetoothctl

                           

                              default-agent

                              discoverable on

                              scan on

                           

                          The error I get on my PC is the passcode isn't right. I've tried on two different PC one is Windows 8.1 and the other is running Windows 7. I was able to pair a head phone set to both computers with no issues. The Windows 7 computer never was paired with the module before. Mind you it doesn't ask for a passcode.

                           

                          It asked for the passcode once when I first ran the bluetooth and got it to pair successfully as I stated early on in my posts. After that it never asks for a passcode and always failed, and this occurs on devices I never connected to it. And now it seems like even a flashall doesn't recover the module.

                          • 10. Re: Bluetooth Pairing
                            jblackston

                            Ok, I finally was about to get it to connect to my BT device on my PC after a flashall command. I used these commands:

                             

                            systemctl start bluetooth

                            systemctl start connman

                            connmanctl enable bluetooth

                            connmanctl enable wifi

                            rfkill unblock wifi

                            rfkill unblock bluetooth

                            bluetoothctl

                            agent DisplayYesNo

                            default-agent

                            discoverable on

                            scan on

                             

                            However, like before once I got it to connect and reset the device, the device will never connect to it again, giving me an error saying that the passkey has failed.... So I do not know what it wrong with the BT on the Edison. I'm able to do this over and over again, every time a flashall I can successful connect only once then I need to perform a flashall again... Please help...

                            • 11. Re: Bluetooth Pairing
                              CMata_Intel

                              Hi jblackston

                               

                              I'm working with an Edison (120 version) and a PC with Windows7, and following these steps for Bluetooth:

                              root@edison:~# rfkill unblock bluetooth
                              root@edison:~# bluetoothctl
                              [bluetooth]# agent KeyboardDisplay
                              [bluetooth]# default-agent
                              [bluetooth]# scan on
                              [bluetooth]# scan off
                              [bluetooth]# pair <device>
                              -> Click yes in the pop-up Window in the PC, then writing yes in the Edison
                              [bluetooth]# connect <device>
                              
                              

                              I'm able to connect the device with the board even after rebooting both devices.

                               

                              Are you able to see your board and devices when you type bluetoothctl? Or only the board?

                              root@edison:~# rfkill unblock bluetooth
                              root@edison:~# bluetoothctl
                              [NEW] Controller XX:XX:XX:XX:XX:XX edison [default]
                              [NEW] Device XX:XX:XX:XX:XX:XX DeviceName
                              
                              

                               

                              Regards;

                              CMata

                              • 12. Re: Bluetooth Pairing
                                jblackston

                                Ok.... Using the agent KeyboardDisplay seems to allow me to keep connecting to the BT device. So right now I have a few questions:

                                 

                                1. What are the different type of agents?
                                2. Is there a way to auto pair or auto connect, so when a device wishes to connect the bt just accepts it?
                                  1. I will not have access to command line in the product, and in the source code seen for the bluez you need to know the connecting MAC address to connect which won't be known at the time of programming.
                                  2. I also find I have a ton of errors when trying to compile the code for the bluez library. I can give you those errors at a later time.
                                3. Is there a way to remove the need to enter a passcode
                                4. I've verified the Profile1 is in the config file but I do not see a com port available, this is per the setup instructions by the BT document.

                                 

                                The issue I have is this needs to be run in a production style in which a user doesn't have access to the command line, and it needs to be easily able to pair with a device, Android or Windows. Looking at the examples for the bluez code it seems like that might not be the case, I'm not sure how anybody would be able to use this in a non-interactive product like I mentioned above.

                                • 13. Re: Bluetooth Pairing
                                  Intel_Jesus

                                  Hi jblackston,

                                   

                                  These are the options available for the agent.

                                  DisplayOnly      KeyboardDisplay  NoInputNoOutput  on

                                  DisplayYesNo     KeyboardOnly     off

                                   

                                  Have you tried using Secure Simple Pairing Mode using hciconfig?  SSP does not require a pin code, i am still looking into your other questions.

                                   

                                  Regards,

                                  Jesus

                                  • 14. Re: Bluetooth Pairing
                                    jblackston

                                    How do you setup for SSP connection that doesn't require that. In the Intel Bluetooth guide it doesn't talk about hciconfig for SSP.

                                     

                                    Also here are some of the errors I get when I compile with the bluez library:

                                     

                                    Description    Resource    Path    Location    Type

                                    '__v' does not name a type    Giotto_Appliance        line 232, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                    'struct bt_get_be16(const void*)::<anonymous>' has no member named '__v'    Giotto_Appliance        line 202, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                    'struct bt_get_be32(const void*)::<anonymous>' has no member named '__v'    Giotto_Appliance        line 192, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                    'struct bt_get_be64(const void*)::<anonymous>' has no member named '__v'    Giotto_Appliance        line 182, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                    'struct bt_get_le16(const void*)::<anonymous>' has no member named '__v'    Giotto_Appliance        line 197, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                    'struct bt_get_le32(const void*)::<anonymous>' has no member named '__v'    Giotto_Appliance        line 187, external location: C:\Intel\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\include\bluetooth\bluetooth.h    C/C++ Problem

                                     

                                    This is just some of the errors I get when trying to compile the bluez header files included.

                                    1 2 3 Previous Next