title: Debian Sid cannot connect to bluetooth keyboard
body: <p>I am running Debian Sid with the following bluetooth-related packages installed:</p>
  
  <ul>
  <li><code>blueman</code> 2.0.4-1</li>
  <li><code>bluetooth</code> 5.43-1</li>
  <li><code>bluez</code> 5.43-1</li>
  <li><code>bluez-firmware</code> 1.2-3</li>
  <li><code>firmware-misc-nonfree</code> 20161130-2</li>
  <li><code>gnome-bluetooth</code> 3.20.1-1</li>
  </ul>
  
  <p>I am trying to connect <a href="https://www.microsoft.com/en-us/surface/accessories/surface-ergonomic-keyboard" rel="noreferrer">Microsoft Surface Ergonomic Keyboard</a>, without much success. Any help would be appreciated! Below, please find the details about my conundrum.</p>
  
  <h2>gnome-bluetooth</h2>
  
  <p><code>gnome-bluetooth</code> detects the keyboard but cannot connect to it. Upon clicking the discovered device, <code>gnome-bluetooth</code> quickly reverts to <strong>Not Set Up</strong>.</p>
  
  <p>Sometimes, and I have yet to figure out when, <code>gnome-bluetooth</code> does prompt a PIN key for connection. Most of the time, the connection drops before I can type the key on the keyboard.</p>
  
  <p>Rarely, <code>gnome-bluetooth</code> does manage to connect to the keyboard. Within a minute, however, it bugs out, rapidly going back and forth between <strong>Connected</strong> and <strong>Not Set Up</strong>.</p>
  
  <h2>hcitool</h2>
  
  <p><code>hcitool scan</code> does not turn up any result, and nor does <code>hcitool inq</code>.</p>
  
  <h2>bluetoothctl</h2>
  
  <p>With <code>scan on</code>, <code>bluetoothctl</code> discovers the keyboard. The following errors occur, however:</p>
  
  <ul>
  <li><p>Entering <code>pair</code> directly after discovery shows the following:</p>
  
  <pre><code>Attempting to pair with [mac address]
  [CHG] Device [mac address] Connected: yes
  Failed to pair: org.bluez.Error.AuthenticationFailed
  [CHG] Device [mac address] Connected: no
  </code></pre></li>
  <li><p>Entering <code>trust [mac address]</code> before pairing results in the same error message.</p></li>
  <li>Entering <code>pairable on</code> before pairing results in the same error message.</li>
  <li><p>Entering <code>connect [mac address]</code> shows the following:</p>
  
  <pre><code>[CHG] Device [mac address] Connected: yes
  Failed to connect: org.bluez.Error.Failed
  [CHG] Device [mac address] Connected: no
  </code></pre></li>
  <li><p>Entering <code>trust</code> or <code>pairable</code> before using <code>connect</code> results in the same error message.</p></li>
  </ul>
  
  <h3>Tracing the error in <code>syslog</code></h3>
  
  <p>This, I believe, is the relevant log:</p>
  
  <pre><code>dbus-daemon[1068]: Activating via systemd: service name='org.bluez.obex' unit='dbus-org.bluez.obex.service'
  dbus-daemon[1068]: Activating via systemd failed for unit 'dbus-org.bluez.obex.service': Unit dbus-org.bluez.obex.service not found.
  
  
  blueman.desktop[1381]: ERROR:dbus.connection:Exception in handler for D-bus signal:
  blueman.desktop[1381]: Traceback(most recent call last):
  blueman.desktop[1381]:     File "/usr/lib/python3/dist-packages/dbus/connection.py", line 230, in maybe_handle_message
  blueman.desktop[1381]:         self._handler(*args, **kwargs)
  blueman.desktop[1381]:     File "/usr/lib/python3/dist-packages/blueman/bluez/PropertiesBlueZInterface.py", line 55, in wrapper
  blueman.desktop[1381]:         handler(name, value, **kwargs)
  blueman.desktop[1381]:     File "/usr/lib/python3/dist-packages/blueman/plugins/applet/GameControllerWakelock.py", line 36, in on_device_property_changed
  blueman.desktop[1381]:         klass = Device(path).get_properties()["Class"] &amp; 0x1fff
  blueman.desktop[1381]:     KeyError: 'Class'
  </code></pre>