1 2 Previous Next 19 Replies Latest reply on Nov 13, 2014 5:31 PM by allene

    How to make my phone see Edison in slave mode

    allene

      I am just getting started with Bluetooth so this is probably a stupid question but I have read much Google search and Stack Overflow answers and can't get where I want to get.

       

      What I can do is run a scan in Edison and see my phone. But what I want to do is set up Edison so I can see Edison when I run a scan on my phone. I can see that paring is enabled and that Edison is set to Slave Accept.  But it won't work.  Just to repeat, I want to pair my phone with Edison from the phone.  This is a first step in setting up a data transfer from Edison as a slave to the phone as the master.

       

      I have tried a variety of linux commands and nothing has worked.  Can someone please write the linux commands to allow this?  Below is some output showing some of the Bluetooth state

       

      Allen

       

      root@Papoose:~# hciconfig

      hci0:   Type: BR/EDR  Bus: UART

              BD Address: 98:4F:EE:03:1F:2E  ACL MTU: 1021:8  SCO MTU: 64:1

              UP RUNNING PSCAN

              RX bytes:1820 acl:0 sco:0 events:74 errors:0

              TX bytes:1687 acl:0 sco:0 commands:74 errors:0

      root@Papoose:~# hciconfig hci0 sspmode

      hci0:   Type: BR/EDR  Bus: UART

              BD Address: 98:4F:EE:03:1F:2E  ACL MTU: 1021:8  SCO MTU: 64:1

              Simple Pairing mode: Enabled

      root@Papoose:~# rfkill unblock bluetooth

      root@Papoose:~# hciconfig hicX lm

      hci0:   Type: BR/EDR  Bus: UART

              BD Address: 98:4F:EE:03:1F:2E  ACL MTU: 1021:8  SCO MTU: 64:1

              Link mode: SLAVE ACCEPT

        • 1. Re: How to make my phone see Edison in slave mode
          allene

          I have made some progress but still cannot pair.  But my phone can see the bluetooth on Edison so this is progress.  I have tried hours and hours of things I have found online or guessed at and nothing works.  I get a message that says that pairing failed because of an invalid key but I was never asked for a key.  Anyway, that is where I am.

           

          Allen

           

          Turn on Bluetooth

          hciconfig hci0 up

           

          Enable discoverability

          hciconfig hci0 piscan

           

          Set up simple paring

          hciconfig hci0 sspmode 1

           

           

          and edited this file

          /etc/bluetooth/main.conf

          # How long to stay in discoverable mode before going back to non-discoverable

          # The value is in seconds. Default is 180, i.e. 3 minutes.

          # 0 = disable timer, i.e. stay discoverable forever

          DiscoverableTimeout = 0

           

          The utility, bluetoothctl is helpful:

          root@Papoose:~# bluetoothctl

          [NEW] Controller 98:4F:EE:03:1F:2E BlueZ 5.18 [default]

          [bluetooth]# show

          Controller 98:4F:EE:03:1F:2E

                  Name: BlueZ 5.18

                  Alias: BlueZ 5.18

                  Class: 0x000110

                  Powered: yes

                  Discoverable: yes

                  Pairable: yes

                  UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)

                  UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)

                  UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)

                  UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)

                  UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)

                  Modalias: usb:v1D6Bp0246d0512

                  Discovering: no

          [bluetooth]#

          • 2. Re: How to make my phone see Edison in slave mode
            mhahn

            have you tried "bluetoothctl" (see some mention in my blog Bluetooth on Intel® Galileo - Bluetooth tethering | Intel® Developer Zone - it's about Galileo but might work on Edison likewise).

            Note: there are several pairing modes you can give (see in my blog).

            You may try to set to "NoInputNoOutput" as indicated there

            • 3. Re: How to make my phone see Edison in slave mode
              allene

              Yes, I have tried bluetoothctl and found it useful.  I have also found direct command line ways of doing most things.  But I still cannot connect.  I tried a couple of things in your blog but had error messages.  I will post the screen below.  First you will see that "connmanctl tether bluetooth on" issued an error message that I did not understand.  I went ahead and tried pairing with the Nexus-4 but did not see the opportunity to accept the connection that I saw in your blog.

               

              root@Papoose:~# connmanctl tether bluetooth on

              Error enabling bluetooth tethering: The name net.connman was not provided by any .service files

              root@Papoose:~# bluetoothctl

              [NEW] Controller 98:4F:EE:03:1F:2E BlueZ 5.18 [default]

              [bluetooth]# show

              Controller 98:4F:EE:03:1F:2E

                      Name: BlueZ 5.18

                      Alias: BlueZ 5.18

                      Class: 0x000110

                      Powered: yes

                      Discoverable: yes

                      Pairable: yes

                      UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)

                      UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)

                      UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)

                      UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)

                      UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)

                      Modalias: usb:v1D6Bp0246d0512

                      Discovering: no

              [NEW] Device F8:0C:F3:F2:95:FF Nexus 4

              [CHG] Device F8:0C:F3:F2:95:FF Connected: no

              [DEL] Device F8:0C:F3:F2:95:FF Nexus 4

              [bluetooth]#

              • 4. Re: How to make my phone see Edison in slave mode
                MPayne

                Use bluetoothctl:

                 

                rfkill unblock bluetooth

                bluetoothctl

                [bluetooth]# scan on

                [bluetooth]# pair <MAC address>

                [bluetooth]# connect <MAC address>

                [bluetooth]# discoverable on

                [bluetooth]# exit

                 

                Now try pairing from your devce

                • 5. Re: How to make my phone see Edison in slave mode
                  allene

                  I was able to pair the devices using bluetoothctl as you describe. It paired successfully.  It connected and then disconnected.  I attempted to repeat the process again by disconnecting on the phone and now nothing works.  The phone says not connected and Edison still says connected.  Below is the initial sequence.

                   

                  [CHG] Device F8:0C:F3:F2:95:FF Connected: no

                  [bluetooth]# pair F8:0C:F3:F2:95:FF

                  Attempting to pair with F8:0C:F3:F2:95:FF

                  [CHG] Device F8:0C:F3:F2:95:FF Connected: yes

                  [bluetooth]# connect F8:0C:F3:F2:95:FF

                  Attempting to connect to F8:0C:F3:F2:95:FF

                  [CHG] Device F8:0C:F3:F2:95:FF Paired: yes

                  Pairing successful

                  [CHG] Device F8:0C:F3:F2:95:FF Modalias: bluetooth:v000Fp1200d1436

                  [CHG] Device F8:0C:F3:F2:95:FF UUIDs:

                          00001105-0000-1000-8000-00805f9b34fb

                          0000110a-0000-1000-8000-00805f9b34fb

                          0000110c-0000-1000-8000-00805f9b34fb

                          0000110e-0000-1000-8000-00805f9b34fb

                          00001112-0000-1000-8000-00805f9b34fb

                          00001115-0000-1000-8000-00805f9b34fb

                          00001116-0000-1000-8000-00805f9b34fb

                          0000111f-0000-1000-8000-00805f9b34fb

                          0000112f-0000-1000-8000-00805f9b34fb

                          00001132-0000-1000-8000-00805f9b34fb

                          00001200-0000-1000-8000-00805f9b34fb

                          00001800-0000-1000-8000-00805f9b34fb

                          00001801-0000-1000-8000-00805f9b34fb

                          453994d5-d58b-96f9-6616-b37f586ba2ec

                          936da01f-9abd-4d9d-80c7-02af85c822a8

                  Failed to connect: org.bluez.Error.Failed

                  [CHG] Device F8:0C:F3:F2:95:FF Connected: no

                  [bluetooth]# connect F8:0C:F3:F2:95:FF

                  Attempting to connect to F8:0C:F3:F2:95:FF

                  Failed to connect: org.bluez.Error.Failed

                   

                  This is what I get now when I try and repeat the process

                  root@Papoose:~# rfkill list all

                  0: phy0: wlan

                          Soft blocked: no

                          Hard blocked: no

                  1: brcmfmac-wifi: wlan

                          Soft blocked: no

                          Hard blocked: no

                  2: bcm43xx Bluetooth: bluetooth

                          Soft blocked: no

                          Hard blocked: no

                  3: hci0: bluetooth

                          Soft blocked: no

                          Hard blocked: no

                  root@Papoose:~# hciconfig hci0 up

                  root@Papoose:~# bluetoothctl

                  [NEW] Controller 98:4F:EE:03:1F:2E BlueZ 5.18 [default]

                  [NEW] Device F8:0C:F3:F2:95:FF Nexus 4

                  [bluetooth]# show

                  Controller 98:4F:EE:03:1F:2E

                          Name: BlueZ 5.18

                          Alias: BlueZ 5.18

                          Class: 0x000110

                          Powered: yes

                          Discoverable: yes

                          Pairable: yes

                          UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)

                          UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)

                          UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)

                          UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)

                          UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)

                          Modalias: usb:v1D6Bp0246d0512

                          Discovering: no

                  [bluetooth]# scan on

                  Discovery started

                  [CHG] Controller 98:4F:EE:03:1F:2E Discovering: yes

                  [bluetooth]# pair  F8:0C:F3:F2:95:FF

                  Device  F8:0C:F3:F2:95:FF not available

                  [bluetooth]#

                  • 6. Re: How to make my phone see Edison in slave mode
                    allene

                    Edison shows Nexus-4 as paired.  Nexus-4 shows Edison as unpaired. When I attempt to pair them I see this on Bluetoothctl:

                    [bluetooth]# paired-devices

                    Device F8:0C:F3:F2:95:FF Nexus 4

                    [CHG] Device F8:0C:F3:F2:95:FF Connected: yes

                    [CHG] Device F8:0C:F3:F2:95:FF Connected: no

                    [bluetooth]#

                     

                    On Nexus-4 I get a message:  Couldn't pair with BlueX 5.18 because of an incorrect PIN or passkey.  OK.

                     

                    In summary, I can connect but get immediately disconnected by the phone.

                    • 7. Re: How to make my phone see Edison in slave mode
                      mhahn

                      have you switched "agent on" in bluetoothctl?

                      have you set to "NoInputNoOutput" ?

                      • 8. Re: How to make my phone see Edison in slave mode
                        allene

                        Yes I had but I just tried it again.

                         

                        I tried trusting the Nexus-4 and got the pairing confirmation message on the Nexus-4 and a confirmation on the Edison and I am now paired again, but imediately disconnected.  Here is the sequence from Bluetoothctl.

                         

                        [bluetooth]# trust F8:0C:F3:F2:95:FF

                        [CHG] Device F8:0C:F3:F2:95:FF Trusted: yes

                        Changing F8:0C:F3:F2:95:FF trust succeeded

                        [CHG] Device F8:0C:F3:F2:95:FF Connected: yes

                        Request confirmation

                        [agent] Confirm passkey 261871 (yes/no): yes

                        [CHG] Device F8:0C:F3:F2:95:FF Connected: no

                        [bluetooth]# connect  F8:0C:F3:F2:95:FF

                        Device  F8:0C:F3:F2:95:FF not available

                        [bluetooth]#

                        • 9. Re: How to make my phone see Edison in slave mode
                          mhahn

                          To analyze it might help to look at the BT communication via running "btmon" (or "hcidump")

                          • 10. Re: How to make my phone see Edison in slave mode
                            allene

                            I went through the process again.  It paired and I got a message on the phone to accept the connection which I did.  The hcidump said this

                             

                            HCI Command: Disconnect (0x01|0x0006) plen 3

                                handle 12 reason 0x13

                                Reason: Remote User Terminated Connection

                            • 11. Re: How to make my phone see Edison in slave mode
                              hk101

                              Hi

                              I'm having similar issues: help:

                               

                              here bluetoothctl can see my android phone --->

                              [CHG] Device 34:BB:26:25:55:A9 RSSI: -82

                              [CHG] Device 34:BB:26:25:55:A9 RSSI: -67

                               

                              [bluetooth]# connect 34:BB:26:25:55:A9

                              Attempting to connect to 34:BB:26:25:55:A9

                              Failed to connect: org.bluez.Error.Failed

                              [bluetooth]# trust 34:BB:26:25:55:A9

                              [CHG] Device 34:BB:26:25:55:A9 Trusted: yes

                              Changing 34:BB:26:25:55:A9 trust succeeded

                              [bluetooth]# connect 34:BB:26:25:55:A9

                              Attempting to connect to 34:BB:26:25:55:A9

                              Failed to connect: org.bluez.Error.Failed

                               

                              ----------Here I attempt to connect from my phone -> (I can seeBlueZ 5.18 from my phone )

                              [CHG] Device 34:BB:26:25:55:A9 Connected: yes

                              [CHG] Device 34:BB:26:25:55:A9 Connected: no

                              [bluetooth]#

                               

                              phone says it cannot connect "because of an incorrect PIN or passkey"

                               

                              in one of the above posts "have you set to "NoInputNoOutput" ?"

                              bluetoothctl does not seem to have this "set" command. So how do I do NoInputNoOutput?

                               

                              Also how do I set up a default pin on Edison bluetooth?

                              • 12. Re: How to make my phone see Edison in slave mode
                                allene

                                I think the answer is that it does not work and we have to wait for the next release of software. See the "official" response in this thread.

                                Re: Has anyone passed data from Edison to a phone via Bluetooth?  

                                • 13. Re: How to make my phone see Edison in slave mode
                                  MPayne

                                  There are some BT updates planned, but I expected this use case to be OK.  Right now, Edison supports HID and PAN profile.  We just integrated other profiles, and those should be available in the next major release (end of year).  That is what he is referring to.

                                   

                                  Let me get some clarification with the FW team on behavior, and make sure I'm not missing something mundane...

                                  • 14. Re: How to make my phone see Edison in slave mode
                                    allene

                                    I got a response from someone claiming to speak for Intel saying that it does not work.  I would love it if it worked.  If it does, please come back with how.  Here is the thread

                                    Re: Has anyone passed data from Edison to a phone via Bluetooth?

                                    1 2 Previous Next