title: BlueZ on i.MX25 : Can't connect RFCOMM socket: Operation now in progress
body: <p>I'm trying to connect to a bluetooth device on embedded linux.  </p>
  
  <ul>
  <li>BlueZ version is 4.101.  </li>
  <li>Local bluetooth adapter is an USB Bluetooth dongle Trendnet TBW-107UB, for all tests.  </li>
  <li>I can't provide details about the target device, as it is a product of the company I work for, sorry.  </li>
  </ul>
  
  <p>Using the method described at
      <a href="http://www.heatxsink.com/entry/how-to-pair-a-bluetooth-device-from-command-line-on-linux" rel="noreferrer">this page</a> works fine on Desktop Linux Mint 17 x64, and on RiotBoard (i.MX6) Linaro Ubuntu.  </p>
  
  <p>However, I can't get an i.MX25 board (embedded custom Linux) to connect to the target device. <strong>Only scan works</strong>. </p>
  
  <p><strong>rfcomm.conf</strong>  </p>
  
  <pre><code>rfcomm0 {
      # Automatically bind the device at startup
      bind yes;
  
      # Bluetooth address of the device
      device 00:07:80:5A:48:93;
  
      # RFCOMM channel for the connection
      channel 1;
  
      # Description of the connection
      comment "Example Bluetooth device";
  }
  </code></pre>
  
  <p><strong>hciconfig -a output</strong>  </p>
  
  <pre><code>hci0:   Type: BR/EDR  Bus: USB  
      BD Address: 00:15:83:44:39:E2  ACL MTU: 384:8  SCO MTU: 64:8  
      UP RUNNING PSCAN  
      RX bytes:28633 acl:0 sco:0 events:204 errors:0  
      TX bytes:899 acl:0 sco:0 commands:60 errors:0  
      Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x83  
      Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  
      Link policy: RSWITCH HOLD SNIFF PARK  
      Link mode: SLAVE ACCEPT  
      Name: 'Bluetooth2.1+EDR CLASS1'  
      Class: 0x000000  
      Service Classes: Unspecified  
      Device Class: Miscellaneous,  
      HCI Version: 2.1 (0x4)  Revision: 0x149c  
      LMP Version: 2.1 (0x4)  Subversion: 0x149c  
      Manufacturer: Cambridge Silicon Radio (10)  
  </code></pre>
  
  <p><strong>rfcomm connect output</strong></p>
  
  <pre><code># rfcomm connect 0  
  Can't connect RFCOMM socket: Operation now in progress  
  </code></pre>
  
  <p><strong>hcitool cc output</strong></p>
  
  <pre><code># hcitool cc 00:07:80:5A:48:93  
  Can't create connection: Connection timed out
  </code></pre>
  
  <p><strong>l2ping output</strong></p>
  
  <pre><code># l2ping 00:07:80:5A:48:93  
  Can't connect: Invalid exchange
  </code></pre>
  
  <p>While google searching, the only relevant <a href="https://bbs.archlinux.org/viewtopic.php?id=60158" rel="noreferrer">thread</a> I could find suggests that the rfcomm connect output could be due to a kernel 2.6.27 regression, but mine is 3.10.28 (used uname -r).<br>
  I tried with two other target bluetooth devices (of different type), the problem remains the same.  </p>
  
  <p>Any help is appreciated, thank you!</p>
  
  <p><strong>Edit</strong><br>
  Rfkill block / unblock didn't seem to change anything.</p>