After several hours experimenting it works perfectly when you start bluetoothd with the compatibility (--compat) flag
sudo /usr/sbin/bluetoothd --compat --nodetach --debug -p time
When started without --compat this error appears:
pi@raspberrypi:~/BL_keyboard_RPI/server $ sudo python btk_server.py
PuTTY X11 proxy: Unsupported authorisation protocol
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
Setting up service
Setting up BT device
Configuring for name ThanhLe_Keyboard
Configuring Bluez Profile
Reading service record
Profile registered
Waiting for connections
Traceback (most recent call last):
File "btk_server.py", line 214, in <module>
myservice = BTKbService();
File "btk_server.py", line 188, in __init__
self.device.listen();
File "btk_server.py", line 149, in listen
self.scontrol.bind((self.MY_ADDRESS,self.P_CTRL))
File "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", line 140, in bind
return self._sock.bind (addrport)
_bluetooth.error: (98, 'Address already in use')
After several hours experimenting it works perfectly when you start bluetoothd with the compatibility (--compat) flag
sudo /usr/sbin/bluetoothd --compat --nodetach --debug -p time
When started without --compat this error appears: