-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs regarding devices_config #3
Comments
Hi, great to hear it might work for you. |
Thanks!! I will try it out tomorrow and post back how its doing. One thing I found on my implementation is that after the PC goes to sleep, the keyboard not only does not wake it but also I can't type the password as the device is not re connecting. I will try with yours and report back. |
it should mostly work, i.e. raspberry should initiate reconnection with an exception of after restarting bluetooth on raspberry, or raspberry itself. also, if raspberry or bluetooth is restarted on raspberry reconnection may happen automatically being initiated by host. most hosts will do several attempts to reconnect over few minutes. bluetooth hid spec defines two flags in the SDP record: HIDNormallyConnectable (0x020D - reconnection from host to device) and HIDReconnectInitiate (0x0205 reconnection from device to host). both these flags are set to true in the current record. this describes my understanding of how it works, reality may also be different because of some bugs I am now aware of |
Hi @ruundii, I ended up testing it today on a pi zero w and so far I have found:
Is there any extra step I am missing? |
interesting, refresh button - i will remove it, it’s not needed anymore since I implemented websockets, web ui refreshes automatically. two devices is more interesting though. this means that your keyboard is represented as two devices in the OS. the way it works is that device HID descriptor may combine different functions and OS may create different devices for those different functions. have you tried capturing each one of those two devices? could you post your hid descriptor for me to investigate further? it’s a long long hex string |
cool, thanks. for the comparison, this is what my a1314 looks like 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) // 225 bytes basically what i see in your case is that there are indeed two OS devices for different usages. to compare, the current hid descriptor in the sdp_record.xml is a bit different from yours: 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) // 183 bytes here you have three possible output reports - one long one for keyboard - modifiers, constant and 6 keys (not 5+1 vendor-specific); another one for similar (not exactly same, as no eject button) consumer control keys as in your first “device”. and a third report is for mouse. the biggest problem is that reports in my record have ids - 1, 2 and 3, while in yours there are no ids. in my case the report id is a first byte in the hid report (actually second in a message as message also contains bluetooth message id as a first byte - 0xa1 for input reports and 0xa2 for output reports. to try things out, you can set Default filter for your device in the web ui, then hid_report_filter.py will be used, which adds report id 1 to the message. in theory it should make most of you keys work (except the fancy consumer control keys and the vendor specific key, whatever it is). you can check my comments on previous 2 issues on general options to consider and some details. i would mainly be thinking around two options:
this issue has led me to thinking that a bit later i will try to develop an ability to capture reports not only from hidraw, i.e. before OS processes them, but also after. in this way OS will deal with all the complexity of parsing and handling different hid descriptors and will just give me consistent key events with consistent codes, which i will send to hosts as per hid descriptor in the sdp record. this approach is slightly less flexible, as i may not receive all the vendor-specific events or exotic hid events after those being processed by os/vendor driver, but should work out of box for a much wider range of devices without a need for a device-specific filter |
Hi there, I have now implemented a keyboard compatibility mode (configurable via web interface on hid devices screen). this functionality captures events via evdev, after those are processed by OS. so all the specifics of various descriptors and reports formats of various keyboards in this way are handled by OS/vendor drivers, I get resulting key codes and send those via bluetooth as hid reports. Feel free to try it out Thanks |
Hi @ruundii thanks for the update! I think there is a missing dependency python3-pyudev. After installing, the service now starts. I added the device in compat mode but its still not sending the key strokes Is there any log where I can see that the key events are being received? Also maybe a log for the BT side? |
updated (first i overlooked your devices tab screenshot). there is some logging, but not at a key press level. you can just stop remapper.service and run remapper.py in commands line. maybe add few tracing print lines to e.g. hid filter |
No, the intent is to set the BT device as output. How do you change that?
…On Fri, Aug 28, 2020, 6:59 PM ruundii ***@***.***> wrote:
hm
there is some logging, but not at a key press level. you can just stop
remapper.service and run remapper.py in commands line. maybe add few
tracing print lines to e.g. hid filter
also, on your screenshot here, i see you’ve got remote host paired and a
desktop as a bluetooth input device, is it right? are you sure this desktop
input device actually works as a keyboard and sends hid reports?
could you also screenshot the devices tab, so i see that you are capturing
input for the virtual hid device created for you compatibility mode keyboard
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ4KQ53V6SDA3WTQNGF7463SDBOIDANCNFSM4QBHF4GQ>
.
|
what is likely to have happened here is that your DESKTOP-DEJ machine was identified as a bluetooth device when pairing happened. bluetooth hid communications are happening via the same bluetooth ports for both device and host. to distinguish between host and device role I check if the device has HID profile declared via SDP. if it does - then it is a HID device. if it does not - then it is a host. it is possible that your DESKTOP-DEJ still has HID profile declaration in its SDP from your KB_Mux project. i think if you remove the device (from raspberry side), ensure the sdp record of host does not have HID profile (1124-.... uuid) and then pair again - all should work well. if it does not work you may end up clearing bluetooth storage folders (under /var/lib/bluetooth on both machines). you can use sdptool to browse what bluetooth profiles are declared on your host and also remove them after you stopped the service which declared this profile |
BTW, having had another look at your hid devices screen - you may need to actually turn on compatibility mode (and then capturing for 2 virtual devices) for both Apple Keyboard devices created by OS for your keyboard |
on the screenshot here - you certainly shouldn’t capture from the virtual hid raw keyboard and apple keyboard at the same time. would be interesting too see if there are any issues in console (sudo systemctl status remapper.service) or just run it in the console and see what is happing when it gives 500 to resolve 500 - maybe restart, or set device_config content to an empty dictionary ‘{}’ if just restart does not help. |
I suspect this would be resolved with #23 |
Hi @ruundii, first of all this project is exactly what I was looking for. I created https://github.com/rdelcorro/keyboardMux today in order to achieve a similar but simpler goal of converting my USB keyboard to BT. Since your project supports mouse and also BT versions of them, I would like to switch. Is there any docs to setup a simple USB keyboard first? What should I put on devices_config and hid_devices? Since my keyboard is fully programable, I do not need to do any filtering / replacing keys, etc, but rather simply send what it was received to the corresponding target. For the mouse, I have a logitec that has an optional USB dongle that I may be able to use or rather I could link it via BT to the same project.
The text was updated successfully, but these errors were encountered: