Closed hunterzju closed 4 years ago
if you have connected to the phone, open any app that need input character on your phone, then press any key from keyboard connected to RPI.
I used it on my ubuntu laptop with a key board, it seems that does not work?I press the keyboard but the phone receive nothing. How you read the input from the keyboard in the project?
You mean that you install this script on an ubuntu laptop? I have not tested on Ubuntu yet, just finished tested on Raspbery. May I know your Bluetooth Adapter?
I used a CSR4.0 USB Dongle, I try to run the keyboard/kb_client.py with sudo and returns the error:
Traceback (most recent call last):
File "keyboard/kb_client.py", line 128, in <module>
kb.event_loop()
File "keyboard/kb_client.py", line 104, in event_loop
self.send_input()
File "keyboard/kb_client.py", line 117, in send_input
self.iface.send_keys(int(bin_str,2),self.state[4:10] )
File "/usr/local/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/local/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/local/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.bluetooth.btcommon.BluetoothError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
retval = candidate_method(self, *args, **keywords)
File "btk_server.py", line 216, in send_keys
self.device.send_string(cmd_str);
File "btk_server.py", line 177, in send_string
self.cinterrupt.send(message)
File "<string>", line 5, in send
BluetoothError: (107, '\xe4\xbc\xa0\xe8\xbe\x93\xe7\xab\xaf\xe7\x82\xb9\xe5\xb0\x9a\xe6\x9c\xaa\xe8\xbf\x9e\xe6\x8e\xa5')
I will try to test this device on my ubuntu laptap.
Thanks a lot!
fantastic work! The project can run successful and I can see a keyboard from my phone and the connection is ok. But I can not use it to input on the phone? I wonder if there is a description on how to use it?