Multiple USB Keyboards, devd, kbmux, /dev/ukbd0 /dev/ukbd1

cypher386

New Member


Messages: 2

Simple enough, current FreeBSD 12.0
From rc.conf:
Code:
# a mouse
moused_enable="YES"
devfs_system_ruleset="localrules"
# devd
devd_enable="YES"       # Run devd, to trigger programs on device tree changes.
#devd_flags="-d"           # Additional flags for devd(8).
# hid support does what?
uhidd_enable="no"
#uhidd_flags="-kmohs"
kld_list="cuse nmdm vmm iicbus iic iicbb smbus coretemp aesni tpm pmc fuse"
Nothing significant in /boot/loader.conf
/etc/devd.conf:
Code:
# When a USB keyboard arrives, attach it as the console keyboard.
attach 100 {
        device-name "ukbd0";
        action "service syscons setkeyboard /dev/ukbd0";
};
detach 100 {
        device-name "ukbd0";
        action "service syscons setkeyboard /dev/kbd0";
};
For what its worth the computer is an old Latitude E6220.
I've got a logitech nano receiver for my mouse (Logitech trackman, old discontinued model)
It shows up like:
Code:
[jessica@amadala ~]$ usbconfig -d 2.3 show_ifdrv
ugen2.3: <Logitech USB Receiver> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA)
ugen2.3.0: ukbd0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 3>
ugen2.3.1: ums0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 3>
ugen2.3.2: uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 3>
The keyboard is a KeyboardIO Model 01 ( or is it 101?), it presents as a mouse, serial port, hid device and keyboard,
but keystrokes don't ever show up under the console or under X.
So Given that the default /etc/devd.conf doesn't seem to activate a second usb keyboard, (I've tried adding /dev/ukbd1 just like /dev/ukbd0, no luck). This keyboard runs a modify ardunio (ATMega32U) firmware, so it could be something. Keyboard works under windows. I tried enabling HIDD (devd or devfs seems to autostart it), nothing better.

Suggestions? I can post the usbconfig dump of the keyboard in a few hours when I get home. Lovely $300 keyboard, but doesn't like FreeBSD.
 

moridin

Member

Reaction score: 24
Messages: 34

When you plug in the keyboard, are there any messages printed to console (or /var/log/messages)?
 
OP
OP
cypher386

cypher386

New Member


Messages: 2

In fact it does:
Code:
ugen0.8: <Keyboardio Model 01> at usbus0
ukbd1 on uhub6
ukbd1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8> on usbus0
kbd3 at ukbd1
uhid1 on uhub6
uhid1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8> on usbus0
ums1 on uhub6
ums1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8> on usbus0
ums1: 8 buttons and [XYZT] coordinates ID=1
umodem0 on uhub6
umodem0: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8> on usbus0
umodem0: data interface 1, has no CM over data, has break
And it launches moused for the mouse function:
Code:
[jessica@amadala ~]$ ps ax | grep moused
2171  -  Is      0:00.02 /usr/sbin/moused -d -p /dev/psm0 -t auto
3760  -  Is      0:02.17 /usr/sbin/moused -d -p /dev/ums0 -t auto -I /var/run/m
6530  -  Is      0:00.00 /usr/sbin/moused -d -p /dev/ums1 -t auto -I /var/run/m
6609  0  S+      0:00.00 grep moused
And here is the usbconfig :eek:utput:
Code:
usbconfig -d 0.8 show_ifdrv
ugen0.8: <Keyboardio Model 01> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
ugen0.8.0: umodem0: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8>
ugen0.8.2: ukbd1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8>
ugen0.8.3: uhid1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8>
ugen0.8.4: ums1: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 8>
So it shows up as a ukbd1
I seem to have broken devd logging right now, so I don't know if its attaching:
But:
Code:
[jessica@amadala /var/log]$ sudo service syscons setkeyboard /dev/ukbd1
Configuring vt: keymap.
Still no keypresses. Nothing I've googled has helped me monitor it. They are mostly all older posts, etc.

Nothing on the keyboardIO forums, etc. very frustrating.
It could be something in the firmware on the keyboard, but I just don't know and its hard to setup the keyboard firmware build environment on Freebsd.
 

tingo

Daemon

Reaction score: 429
Messages: 2,105

It is simple enough to test if the problem is with the keyboard: grab another usb keyboard and plug it in a free usb port. Now - does it work or not?
In general, multiple keyboards work well on FreeBSD, and has for some time now.
 

dch

Active Member

Reaction score: 45
Messages: 114

Slightly late, but I plugged in my butterfly model01 keyboard today after spilling coffee like a moron on my WASD 105. You'll notice that the butterfly works at loader time, but not after that.

TLDR, flash the firmware following this excellent guide, https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-FreeBSD , once with the default firmware to ensure you have that process working, and then again after applying this diff:

Diff:
diff --git src/BootKeyboard/BootKeyboard.h src/BootKeyboard/BootKeyboard.h
index 3cfe7b1..85d077a 100644
--- src/BootKeyboard/BootKeyboard.h
+++ src/BootKeyboard/BootKeyboard.h
@@ -65,7 +65,7 @@ class BootKeyboard_ : public PluggableUSBModule {
     uint8_t getProtocol(void);
     void setProtocol(uint8_t protocol);
 
-    uint8_t default_protocol = HID_REPORT_PROTOCOL;
+    uint8_t default_protocol = HID_BOOT_PROTOCOL;
 
   protected:
     HID_BootKeyboardReport_Data_t _keyReport, _lastKeyReport;
This forces the keyboard to use a different, simpler, mode on startup, and then it Just Works.

Feel free to ping me (IRC or email) if you have more questions, I don't get forum updates.
 
Top