Connect ps/2->usb keyboard to linux?












3















I have a lovely ancient ergonomic keyboard (no name SK - 6000) connected via a DIN->ps/2 adapter to a ps/2->usb adapter to my docking station. After Grub it stops working. It takes either suspending and waking up or replugging it while Linux is running to get it to work. No extra kernel modules get loaded for this. When it works and I restart without power off, it will work immediately.



Even when it does not work, it is visible (lsusb device number varies but output is identical whether working or not):



$ lsusb -v -s 001:006

Bus 001 Device 006: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a81 Chesen Electronics Corp.
idProduct 0x0205 PS/2 Keyboard+Mouse Adapter
bcdDevice 0.10
iManufacturer 1 CHESEN
iProduct 2 PS2 to USB Converter
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 2 PS2 to USB Converter
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 64
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)


$ ll -R /sys/bus/hid/drivers/
/sys/bus/hid/drivers/:
total 0
drwxr-xr-x 2 root root 0 Jul 8 2012 generic-usb/

/sys/bus/hid/drivers/generic-usb:
total 0
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:046D:C03D.0003 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/0003:046D:C03D.0003/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0001 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0002 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/0003:0A81:0205.0002/
--w------- 1 root root 4096 Jul 7 23:32 bind
lrwxrwxrwx 1 root root 0 Jul 7 23:33 module -> ../../../../module/usbhid/
--w------- 1 root root 4096 Jul 7 23:32 new_id
--w------- 1 root root 4096 Jul 8 2012 uevent
--w------- 1 root root 4096 Jul 7 23:32 unbind


When replugging, dmesg shows this (which except for the 1st line and different input numbers already came at boot time):



[ 1583.295385] usb 1-1.2.1: new low-speed USB device number 6 using ehci_hcd
[ 1583.446514] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/input/input17
[ 1583.446817] generic-usb 0003:0A81:0205.0001: input,hidraw0: USB HID v1.10 Keyboard [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input0
[ 1583.454764] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/input/input18
[ 1583.455534] generic-usb 0003:0A81:0205.0002: input,hidraw1: USB HID v1.10 Mouse [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input1
[ 1583.455578] usbcore: registered new interface driver usbhid
[ 1583.455584] usbhid: USB HID core driver


So I tried



$ sudo udevadm test /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
run_command: calling: test
adm_test: version 175
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/40-crda.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-fuse.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/40-usb-media-players.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-usb_modeswitch.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/69-cd-sensors.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing /lib/udev/rules.d/69-cd-sensors.rules:76
...
parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/95-upower-hid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-wup.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
udev_rules_new: rules use 271500 bytes tokens (22625 * 12 bytes), 44331 bytes buffer
udev_rules_new: temporary index used 76320 bytes (3816 * 20 bytes)
udev_device_new_from_syspath: device 0x7f78a5e4d2d0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_new_from_syspath: device 0x7f78a5e5f820 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_read_db: device 0x7f78a5e5f820 filled with db file data
udev_device_new_from_syspath: device 0x7f78a5e60270 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001'
udev_device_new_from_syspath: device 0x7f78a5e609c0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0'
udev_device_new_from_syspath: device 0x7f78a5e61160 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1'
udev_device_new_from_syspath: device 0x7f78a5e61960 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2'
udev_device_new_from_syspath: device 0x7f78a5e62150 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1'
udev_device_new_from_syspath: device 0x7f78a5e62940 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1'
udev_device_new_from_syspath: device 0x7f78a5e630f0 has devpath '/devices/pci0000:00/0000:00:1a.0'
udev_device_new_from_syspath: device 0x7f78a5e638a0 has devpath '/devices/pci0000:00'
udev_event_execute_rules: no node name set, will use kernel supplied name 'hidraw0'
udev_node_add: creating device node '/dev/hidraw0', devnum=251:0, mode=0600, uid=0, gid=0
udev_node_mknod: preserve file '/dev/hidraw0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/hidraw0, 020600, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/251:0' to '../hidraw0'
udev_device_update_db: created empty file '/run/udev/data/c251:0' for '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
MAJOR=251
MINOR=0
SUBSYSTEM=hidraw
UDEV_LOG=6
USEC_INITIALIZED=969079051


The later lines sound like it's already there. And none of these awakes the keyboard:



$ sudo udevadm trigger --verbose --sysname-match=usb*
/sys/devices/pci0000:00/0000:00:1a.0/usb1
/sys/devices/pci0000:00/0000:00:1a.0/usbmon/usbmon1
/sys/devices/pci0000:00/0000:00:1d.0/usb2
/sys/devices/pci0000:00/0000:00:1d.0/usbmon/usbmon2
/sys/devices/virtual/usbmon/usbmon0

$ sudo udevadm trigger --verbose --sysname-match=hidraw0
/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0

$ sudo udevadm trigger


I also tried this to no avail:



# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind
ksh: echo: write to 1 failed [No such device]

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/unbind

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind

# echo usb1 >/sys/bus/usb/drivers/usb/unbind

# echo usb1 >/sys/bus/usb/drivers/usb/bind


What else should I try to get the same result as replugging or suspending, by just issuing a command?










share|improve this question















migrated from stackoverflow.com Jul 8 '12 at 10:11


This question came from our site for professional and enthusiast programmers.



















  • You need to post this question at serverfault.com

    – Yottatron
    Jul 7 '12 at 22:58











  • Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

    – Stephen Niedzielski
    Jul 8 '12 at 0:51











  • just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

    – Journeyman Geek
    Jul 8 '12 at 10:24











  • 2012, the year of the desktop linux.

    – Shiki
    Jul 8 '12 at 13:21











  • Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

    – Journeyman Geek
    Jul 8 '12 at 13:40
















3















I have a lovely ancient ergonomic keyboard (no name SK - 6000) connected via a DIN->ps/2 adapter to a ps/2->usb adapter to my docking station. After Grub it stops working. It takes either suspending and waking up or replugging it while Linux is running to get it to work. No extra kernel modules get loaded for this. When it works and I restart without power off, it will work immediately.



Even when it does not work, it is visible (lsusb device number varies but output is identical whether working or not):



$ lsusb -v -s 001:006

Bus 001 Device 006: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a81 Chesen Electronics Corp.
idProduct 0x0205 PS/2 Keyboard+Mouse Adapter
bcdDevice 0.10
iManufacturer 1 CHESEN
iProduct 2 PS2 to USB Converter
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 2 PS2 to USB Converter
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 64
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)


$ ll -R /sys/bus/hid/drivers/
/sys/bus/hid/drivers/:
total 0
drwxr-xr-x 2 root root 0 Jul 8 2012 generic-usb/

/sys/bus/hid/drivers/generic-usb:
total 0
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:046D:C03D.0003 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/0003:046D:C03D.0003/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0001 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0002 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/0003:0A81:0205.0002/
--w------- 1 root root 4096 Jul 7 23:32 bind
lrwxrwxrwx 1 root root 0 Jul 7 23:33 module -> ../../../../module/usbhid/
--w------- 1 root root 4096 Jul 7 23:32 new_id
--w------- 1 root root 4096 Jul 8 2012 uevent
--w------- 1 root root 4096 Jul 7 23:32 unbind


When replugging, dmesg shows this (which except for the 1st line and different input numbers already came at boot time):



[ 1583.295385] usb 1-1.2.1: new low-speed USB device number 6 using ehci_hcd
[ 1583.446514] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/input/input17
[ 1583.446817] generic-usb 0003:0A81:0205.0001: input,hidraw0: USB HID v1.10 Keyboard [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input0
[ 1583.454764] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/input/input18
[ 1583.455534] generic-usb 0003:0A81:0205.0002: input,hidraw1: USB HID v1.10 Mouse [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input1
[ 1583.455578] usbcore: registered new interface driver usbhid
[ 1583.455584] usbhid: USB HID core driver


So I tried



$ sudo udevadm test /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
run_command: calling: test
adm_test: version 175
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/40-crda.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-fuse.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/40-usb-media-players.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-usb_modeswitch.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/69-cd-sensors.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing /lib/udev/rules.d/69-cd-sensors.rules:76
...
parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/95-upower-hid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-wup.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
udev_rules_new: rules use 271500 bytes tokens (22625 * 12 bytes), 44331 bytes buffer
udev_rules_new: temporary index used 76320 bytes (3816 * 20 bytes)
udev_device_new_from_syspath: device 0x7f78a5e4d2d0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_new_from_syspath: device 0x7f78a5e5f820 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_read_db: device 0x7f78a5e5f820 filled with db file data
udev_device_new_from_syspath: device 0x7f78a5e60270 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001'
udev_device_new_from_syspath: device 0x7f78a5e609c0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0'
udev_device_new_from_syspath: device 0x7f78a5e61160 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1'
udev_device_new_from_syspath: device 0x7f78a5e61960 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2'
udev_device_new_from_syspath: device 0x7f78a5e62150 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1'
udev_device_new_from_syspath: device 0x7f78a5e62940 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1'
udev_device_new_from_syspath: device 0x7f78a5e630f0 has devpath '/devices/pci0000:00/0000:00:1a.0'
udev_device_new_from_syspath: device 0x7f78a5e638a0 has devpath '/devices/pci0000:00'
udev_event_execute_rules: no node name set, will use kernel supplied name 'hidraw0'
udev_node_add: creating device node '/dev/hidraw0', devnum=251:0, mode=0600, uid=0, gid=0
udev_node_mknod: preserve file '/dev/hidraw0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/hidraw0, 020600, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/251:0' to '../hidraw0'
udev_device_update_db: created empty file '/run/udev/data/c251:0' for '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
MAJOR=251
MINOR=0
SUBSYSTEM=hidraw
UDEV_LOG=6
USEC_INITIALIZED=969079051


The later lines sound like it's already there. And none of these awakes the keyboard:



$ sudo udevadm trigger --verbose --sysname-match=usb*
/sys/devices/pci0000:00/0000:00:1a.0/usb1
/sys/devices/pci0000:00/0000:00:1a.0/usbmon/usbmon1
/sys/devices/pci0000:00/0000:00:1d.0/usb2
/sys/devices/pci0000:00/0000:00:1d.0/usbmon/usbmon2
/sys/devices/virtual/usbmon/usbmon0

$ sudo udevadm trigger --verbose --sysname-match=hidraw0
/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0

$ sudo udevadm trigger


I also tried this to no avail:



# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind
ksh: echo: write to 1 failed [No such device]

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/unbind

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind

# echo usb1 >/sys/bus/usb/drivers/usb/unbind

# echo usb1 >/sys/bus/usb/drivers/usb/bind


What else should I try to get the same result as replugging or suspending, by just issuing a command?










share|improve this question















migrated from stackoverflow.com Jul 8 '12 at 10:11


This question came from our site for professional and enthusiast programmers.



















  • You need to post this question at serverfault.com

    – Yottatron
    Jul 7 '12 at 22:58











  • Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

    – Stephen Niedzielski
    Jul 8 '12 at 0:51











  • just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

    – Journeyman Geek
    Jul 8 '12 at 10:24











  • 2012, the year of the desktop linux.

    – Shiki
    Jul 8 '12 at 13:21











  • Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

    – Journeyman Geek
    Jul 8 '12 at 13:40














3












3








3








I have a lovely ancient ergonomic keyboard (no name SK - 6000) connected via a DIN->ps/2 adapter to a ps/2->usb adapter to my docking station. After Grub it stops working. It takes either suspending and waking up or replugging it while Linux is running to get it to work. No extra kernel modules get loaded for this. When it works and I restart without power off, it will work immediately.



Even when it does not work, it is visible (lsusb device number varies but output is identical whether working or not):



$ lsusb -v -s 001:006

Bus 001 Device 006: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a81 Chesen Electronics Corp.
idProduct 0x0205 PS/2 Keyboard+Mouse Adapter
bcdDevice 0.10
iManufacturer 1 CHESEN
iProduct 2 PS2 to USB Converter
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 2 PS2 to USB Converter
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 64
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)


$ ll -R /sys/bus/hid/drivers/
/sys/bus/hid/drivers/:
total 0
drwxr-xr-x 2 root root 0 Jul 8 2012 generic-usb/

/sys/bus/hid/drivers/generic-usb:
total 0
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:046D:C03D.0003 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/0003:046D:C03D.0003/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0001 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0002 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/0003:0A81:0205.0002/
--w------- 1 root root 4096 Jul 7 23:32 bind
lrwxrwxrwx 1 root root 0 Jul 7 23:33 module -> ../../../../module/usbhid/
--w------- 1 root root 4096 Jul 7 23:32 new_id
--w------- 1 root root 4096 Jul 8 2012 uevent
--w------- 1 root root 4096 Jul 7 23:32 unbind


When replugging, dmesg shows this (which except for the 1st line and different input numbers already came at boot time):



[ 1583.295385] usb 1-1.2.1: new low-speed USB device number 6 using ehci_hcd
[ 1583.446514] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/input/input17
[ 1583.446817] generic-usb 0003:0A81:0205.0001: input,hidraw0: USB HID v1.10 Keyboard [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input0
[ 1583.454764] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/input/input18
[ 1583.455534] generic-usb 0003:0A81:0205.0002: input,hidraw1: USB HID v1.10 Mouse [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input1
[ 1583.455578] usbcore: registered new interface driver usbhid
[ 1583.455584] usbhid: USB HID core driver


So I tried



$ sudo udevadm test /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
run_command: calling: test
adm_test: version 175
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/40-crda.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-fuse.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/40-usb-media-players.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-usb_modeswitch.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/69-cd-sensors.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing /lib/udev/rules.d/69-cd-sensors.rules:76
...
parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/95-upower-hid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-wup.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
udev_rules_new: rules use 271500 bytes tokens (22625 * 12 bytes), 44331 bytes buffer
udev_rules_new: temporary index used 76320 bytes (3816 * 20 bytes)
udev_device_new_from_syspath: device 0x7f78a5e4d2d0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_new_from_syspath: device 0x7f78a5e5f820 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_read_db: device 0x7f78a5e5f820 filled with db file data
udev_device_new_from_syspath: device 0x7f78a5e60270 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001'
udev_device_new_from_syspath: device 0x7f78a5e609c0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0'
udev_device_new_from_syspath: device 0x7f78a5e61160 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1'
udev_device_new_from_syspath: device 0x7f78a5e61960 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2'
udev_device_new_from_syspath: device 0x7f78a5e62150 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1'
udev_device_new_from_syspath: device 0x7f78a5e62940 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1'
udev_device_new_from_syspath: device 0x7f78a5e630f0 has devpath '/devices/pci0000:00/0000:00:1a.0'
udev_device_new_from_syspath: device 0x7f78a5e638a0 has devpath '/devices/pci0000:00'
udev_event_execute_rules: no node name set, will use kernel supplied name 'hidraw0'
udev_node_add: creating device node '/dev/hidraw0', devnum=251:0, mode=0600, uid=0, gid=0
udev_node_mknod: preserve file '/dev/hidraw0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/hidraw0, 020600, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/251:0' to '../hidraw0'
udev_device_update_db: created empty file '/run/udev/data/c251:0' for '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
MAJOR=251
MINOR=0
SUBSYSTEM=hidraw
UDEV_LOG=6
USEC_INITIALIZED=969079051


The later lines sound like it's already there. And none of these awakes the keyboard:



$ sudo udevadm trigger --verbose --sysname-match=usb*
/sys/devices/pci0000:00/0000:00:1a.0/usb1
/sys/devices/pci0000:00/0000:00:1a.0/usbmon/usbmon1
/sys/devices/pci0000:00/0000:00:1d.0/usb2
/sys/devices/pci0000:00/0000:00:1d.0/usbmon/usbmon2
/sys/devices/virtual/usbmon/usbmon0

$ sudo udevadm trigger --verbose --sysname-match=hidraw0
/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0

$ sudo udevadm trigger


I also tried this to no avail:



# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind
ksh: echo: write to 1 failed [No such device]

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/unbind

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind

# echo usb1 >/sys/bus/usb/drivers/usb/unbind

# echo usb1 >/sys/bus/usb/drivers/usb/bind


What else should I try to get the same result as replugging or suspending, by just issuing a command?










share|improve this question
















I have a lovely ancient ergonomic keyboard (no name SK - 6000) connected via a DIN->ps/2 adapter to a ps/2->usb adapter to my docking station. After Grub it stops working. It takes either suspending and waking up or replugging it while Linux is running to get it to work. No extra kernel modules get loaded for this. When it works and I restart without power off, it will work immediately.



Even when it does not work, it is visible (lsusb device number varies but output is identical whether working or not):



$ lsusb -v -s 001:006

Bus 001 Device 006: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a81 Chesen Electronics Corp.
idProduct 0x0205 PS/2 Keyboard+Mouse Adapter
bcdDevice 0.10
iManufacturer 1 CHESEN
iProduct 2 PS2 to USB Converter
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 2 PS2 to USB Converter
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 64
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)


$ ll -R /sys/bus/hid/drivers/
/sys/bus/hid/drivers/:
total 0
drwxr-xr-x 2 root root 0 Jul 8 2012 generic-usb/

/sys/bus/hid/drivers/generic-usb:
total 0
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:046D:C03D.0003 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/0003:046D:C03D.0003/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0001 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/
lrwxrwxrwx 1 root root 0 Jul 7 23:33 0003:0A81:0205.0002 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/0003:0A81:0205.0002/
--w------- 1 root root 4096 Jul 7 23:32 bind
lrwxrwxrwx 1 root root 0 Jul 7 23:33 module -> ../../../../module/usbhid/
--w------- 1 root root 4096 Jul 7 23:32 new_id
--w------- 1 root root 4096 Jul 8 2012 uevent
--w------- 1 root root 4096 Jul 7 23:32 unbind


When replugging, dmesg shows this (which except for the 1st line and different input numbers already came at boot time):



[ 1583.295385] usb 1-1.2.1: new low-speed USB device number 6 using ehci_hcd
[ 1583.446514] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/input/input17
[ 1583.446817] generic-usb 0003:0A81:0205.0001: input,hidraw0: USB HID v1.10 Keyboard [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input0
[ 1583.454764] input: CHESEN PS2 to USB Converter as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.1/input/input18
[ 1583.455534] generic-usb 0003:0A81:0205.0002: input,hidraw1: USB HID v1.10 Mouse [CHESEN PS2 to USB Converter] on usb-0000:00:1a.0-1.2.1/input1
[ 1583.455578] usbcore: registered new interface driver usbhid
[ 1583.455584] usbhid: USB HID core driver


So I tried



$ sudo udevadm test /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
run_command: calling: test
adm_test: version 175
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/40-crda.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-fuse.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/40-usb-media-players.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-usb_modeswitch.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/69-cd-sensors.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing /lib/udev/rules.d/69-cd-sensors.rules:76
...
parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
...
parse_file: reading '/lib/udev/rules.d/95-upower-hid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-wup.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
udev_rules_new: rules use 271500 bytes tokens (22625 * 12 bytes), 44331 bytes buffer
udev_rules_new: temporary index used 76320 bytes (3816 * 20 bytes)
udev_device_new_from_syspath: device 0x7f78a5e4d2d0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_new_from_syspath: device 0x7f78a5e5f820 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
udev_device_read_db: device 0x7f78a5e5f820 filled with db file data
udev_device_new_from_syspath: device 0x7f78a5e60270 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001'
udev_device_new_from_syspath: device 0x7f78a5e609c0 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0'
udev_device_new_from_syspath: device 0x7f78a5e61160 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1'
udev_device_new_from_syspath: device 0x7f78a5e61960 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2'
udev_device_new_from_syspath: device 0x7f78a5e62150 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1/1-1'
udev_device_new_from_syspath: device 0x7f78a5e62940 has devpath '/devices/pci0000:00/0000:00:1a.0/usb1'
udev_device_new_from_syspath: device 0x7f78a5e630f0 has devpath '/devices/pci0000:00/0000:00:1a.0'
udev_device_new_from_syspath: device 0x7f78a5e638a0 has devpath '/devices/pci0000:00'
udev_event_execute_rules: no node name set, will use kernel supplied name 'hidraw0'
udev_node_add: creating device node '/dev/hidraw0', devnum=251:0, mode=0600, uid=0, gid=0
udev_node_mknod: preserve file '/dev/hidraw0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/hidraw0, 020600, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/251:0' to '../hidraw0'
udev_device_update_db: created empty file '/run/udev/data/c251:0' for '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0'
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0
MAJOR=251
MINOR=0
SUBSYSTEM=hidraw
UDEV_LOG=6
USEC_INITIALIZED=969079051


The later lines sound like it's already there. And none of these awakes the keyboard:



$ sudo udevadm trigger --verbose --sysname-match=usb*
/sys/devices/pci0000:00/0000:00:1a.0/usb1
/sys/devices/pci0000:00/0000:00:1a.0/usbmon/usbmon1
/sys/devices/pci0000:00/0000:00:1d.0/usb2
/sys/devices/pci0000:00/0000:00:1d.0/usbmon/usbmon2
/sys/devices/virtual/usbmon/usbmon0

$ sudo udevadm trigger --verbose --sysname-match=hidraw0
/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1:1.0/0003:0A81:0205.0001/hidraw/hidraw0

$ sudo udevadm trigger


I also tried this to no avail:



# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind
ksh: echo: write to 1 failed [No such device]

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/unbind

# echo -n 0003:0A81:0205.0001 > /sys/bus/hid/drivers/generic-usb/bind

# echo usb1 >/sys/bus/usb/drivers/usb/unbind

# echo usb1 >/sys/bus/usb/drivers/usb/bind


What else should I try to get the same result as replugging or suspending, by just issuing a command?







linux keyboard usb hid ps2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 8 '12 at 13:10







Daniel

















asked Jul 7 '12 at 22:31









DanielDaniel

11613




11613




migrated from stackoverflow.com Jul 8 '12 at 10:11


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jul 8 '12 at 10:11


This question came from our site for professional and enthusiast programmers.















  • You need to post this question at serverfault.com

    – Yottatron
    Jul 7 '12 at 22:58











  • Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

    – Stephen Niedzielski
    Jul 8 '12 at 0:51











  • just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

    – Journeyman Geek
    Jul 8 '12 at 10:24











  • 2012, the year of the desktop linux.

    – Shiki
    Jul 8 '12 at 13:21











  • Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

    – Journeyman Geek
    Jul 8 '12 at 13:40



















  • You need to post this question at serverfault.com

    – Yottatron
    Jul 7 '12 at 22:58











  • Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

    – Stephen Niedzielski
    Jul 8 '12 at 0:51











  • just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

    – Journeyman Geek
    Jul 8 '12 at 10:24











  • 2012, the year of the desktop linux.

    – Shiki
    Jul 8 '12 at 13:21











  • Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

    – Journeyman Geek
    Jul 8 '12 at 13:40

















You need to post this question at serverfault.com

– Yottatron
Jul 7 '12 at 22:58





You need to post this question at serverfault.com

– Yottatron
Jul 7 '12 at 22:58













Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

– Stephen Niedzielski
Jul 8 '12 at 0:51





Probably not it, but one thing you might check is the electrical current rating of the PS/2 adapter. You can see this by running lsusb -v and looking for "MaxPower" of the appropriate device. I think max current for PS/2 is supposed to be 275 mA. USB can be 0 - to 500 mA, depending on configuration requested by the adapter. Oh, and another thing you might try is plugging it into a self-powered hub and seeing if it reproduces.

– Stephen Niedzielski
Jul 8 '12 at 0:51













just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

– Journeyman Geek
Jul 8 '12 at 10:24





just for completeness same - fat old plug is called DIN9. I've not seen one since my old xt tho ;p

– Journeyman Geek
Jul 8 '12 at 10:24













2012, the year of the desktop linux.

– Shiki
Jul 8 '12 at 13:21





2012, the year of the desktop linux.

– Shiki
Jul 8 '12 at 13:21













Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

– Journeyman Geek
Jul 8 '12 at 13:40





Oh, its not linux's fault. Its very likely just the darned setup being so convoluted. I VAGUELY seem to think startup voltages are at fault here, but thats just unfounded gut instinct.

– Journeyman Geek
Jul 8 '12 at 13:40










3 Answers
3






active

oldest

votes


















1














here the solution: https://askubuntu.com/questions/48792/how-to-enable-an-extern-keyboard-using-ps2-to-usb-adapter-on-a-notebook



there are 2 kinds of this adapters:
the first one simply changes one plug for another,
the other one works on signals.






share|improve this answer





















  • 1





    Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Canadian Luke
    Jan 14 '13 at 17:23





















0














I was facing the same issue too.



Solution (not sure about the root cause, but this worked for me):




  1. Detach the PS2-to-USB from Laptop.

  2. Detach the keyboard & mouse.

  3. Just attach the PS2-to-USB back to laptop, then plug the keyboard and mouse in. Starts working. Root cause is not known.






share|improve this answer

































    -1














    With very unstable behaviours from both PS/2 keyboard (wild repeating keys, mixed with, vertical cursor movements both up and down) utter chaos when trying to edit a config file! Also unstable PS/2 mouse configuration and action of mouse keys altering at each re-connection making the GUI and web-browser generally unusable!



    Good call: Drawing attention to the use of a powered USB hub, 5 Amp power supply output for a 7 port (5 direct + 2 intermittent charging) USB hub in my case has solved all the errant behaviours in one action. Plus the ability to connect a large capacity 2.5" HDD via USB by observing the same power requirement for each connected device and keeping everything within the 5 Amp total again in this case.



    (I searched for this topic on the basis of having both PS/2 mouse and keyboard with a PS/2 x2 female connectors to, a USB x1 male connector, cable connected adaptor. This adaptor I have had ever since USB began to take over from PS/2 and I find it still useful with an original IBM labelled heavy duty claketty-clack keyboard and fortunately an optical 3 button wheelie-mouse. Never throw anything away. IT will always revive an opportunity for cheaper usage! That is even when everybody has forgotten about the different power requirements of old and new tech' and the consequences)



    Thank you.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f446293%2fconnect-ps-2-usb-keyboard-to-linux%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      here the solution: https://askubuntu.com/questions/48792/how-to-enable-an-extern-keyboard-using-ps2-to-usb-adapter-on-a-notebook



      there are 2 kinds of this adapters:
      the first one simply changes one plug for another,
      the other one works on signals.






      share|improve this answer





















      • 1





        Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

        – Canadian Luke
        Jan 14 '13 at 17:23


















      1














      here the solution: https://askubuntu.com/questions/48792/how-to-enable-an-extern-keyboard-using-ps2-to-usb-adapter-on-a-notebook



      there are 2 kinds of this adapters:
      the first one simply changes one plug for another,
      the other one works on signals.






      share|improve this answer





















      • 1





        Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

        – Canadian Luke
        Jan 14 '13 at 17:23
















      1












      1








      1







      here the solution: https://askubuntu.com/questions/48792/how-to-enable-an-extern-keyboard-using-ps2-to-usb-adapter-on-a-notebook



      there are 2 kinds of this adapters:
      the first one simply changes one plug for another,
      the other one works on signals.






      share|improve this answer















      here the solution: https://askubuntu.com/questions/48792/how-to-enable-an-extern-keyboard-using-ps2-to-usb-adapter-on-a-notebook



      there are 2 kinds of this adapters:
      the first one simply changes one plug for another,
      the other one works on signals.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 13 '17 at 12:22









      Community

      1




      1










      answered Jan 14 '13 at 16:36









      emilioemilio

      111




      111








      • 1





        Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

        – Canadian Luke
        Jan 14 '13 at 17:23
















      • 1





        Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

        – Canadian Luke
        Jan 14 '13 at 17:23










      1




      1





      Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

      – Canadian Luke
      Jan 14 '13 at 17:23







      Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

      – Canadian Luke
      Jan 14 '13 at 17:23















      0














      I was facing the same issue too.



      Solution (not sure about the root cause, but this worked for me):




      1. Detach the PS2-to-USB from Laptop.

      2. Detach the keyboard & mouse.

      3. Just attach the PS2-to-USB back to laptop, then plug the keyboard and mouse in. Starts working. Root cause is not known.






      share|improve this answer






























        0














        I was facing the same issue too.



        Solution (not sure about the root cause, but this worked for me):




        1. Detach the PS2-to-USB from Laptop.

        2. Detach the keyboard & mouse.

        3. Just attach the PS2-to-USB back to laptop, then plug the keyboard and mouse in. Starts working. Root cause is not known.






        share|improve this answer




























          0












          0








          0







          I was facing the same issue too.



          Solution (not sure about the root cause, but this worked for me):




          1. Detach the PS2-to-USB from Laptop.

          2. Detach the keyboard & mouse.

          3. Just attach the PS2-to-USB back to laptop, then plug the keyboard and mouse in. Starts working. Root cause is not known.






          share|improve this answer















          I was facing the same issue too.



          Solution (not sure about the root cause, but this worked for me):




          1. Detach the PS2-to-USB from Laptop.

          2. Detach the keyboard & mouse.

          3. Just attach the PS2-to-USB back to laptop, then plug the keyboard and mouse in. Starts working. Root cause is not known.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 4 '16 at 9:28









          Kamil Maciorowski

          27.6k156083




          27.6k156083










          answered Jul 4 '16 at 7:50









          pushkarajthoratpushkarajthorat

          1




          1























              -1














              With very unstable behaviours from both PS/2 keyboard (wild repeating keys, mixed with, vertical cursor movements both up and down) utter chaos when trying to edit a config file! Also unstable PS/2 mouse configuration and action of mouse keys altering at each re-connection making the GUI and web-browser generally unusable!



              Good call: Drawing attention to the use of a powered USB hub, 5 Amp power supply output for a 7 port (5 direct + 2 intermittent charging) USB hub in my case has solved all the errant behaviours in one action. Plus the ability to connect a large capacity 2.5" HDD via USB by observing the same power requirement for each connected device and keeping everything within the 5 Amp total again in this case.



              (I searched for this topic on the basis of having both PS/2 mouse and keyboard with a PS/2 x2 female connectors to, a USB x1 male connector, cable connected adaptor. This adaptor I have had ever since USB began to take over from PS/2 and I find it still useful with an original IBM labelled heavy duty claketty-clack keyboard and fortunately an optical 3 button wheelie-mouse. Never throw anything away. IT will always revive an opportunity for cheaper usage! That is even when everybody has forgotten about the different power requirements of old and new tech' and the consequences)



              Thank you.






              share|improve this answer






























                -1














                With very unstable behaviours from both PS/2 keyboard (wild repeating keys, mixed with, vertical cursor movements both up and down) utter chaos when trying to edit a config file! Also unstable PS/2 mouse configuration and action of mouse keys altering at each re-connection making the GUI and web-browser generally unusable!



                Good call: Drawing attention to the use of a powered USB hub, 5 Amp power supply output for a 7 port (5 direct + 2 intermittent charging) USB hub in my case has solved all the errant behaviours in one action. Plus the ability to connect a large capacity 2.5" HDD via USB by observing the same power requirement for each connected device and keeping everything within the 5 Amp total again in this case.



                (I searched for this topic on the basis of having both PS/2 mouse and keyboard with a PS/2 x2 female connectors to, a USB x1 male connector, cable connected adaptor. This adaptor I have had ever since USB began to take over from PS/2 and I find it still useful with an original IBM labelled heavy duty claketty-clack keyboard and fortunately an optical 3 button wheelie-mouse. Never throw anything away. IT will always revive an opportunity for cheaper usage! That is even when everybody has forgotten about the different power requirements of old and new tech' and the consequences)



                Thank you.






                share|improve this answer




























                  -1












                  -1








                  -1







                  With very unstable behaviours from both PS/2 keyboard (wild repeating keys, mixed with, vertical cursor movements both up and down) utter chaos when trying to edit a config file! Also unstable PS/2 mouse configuration and action of mouse keys altering at each re-connection making the GUI and web-browser generally unusable!



                  Good call: Drawing attention to the use of a powered USB hub, 5 Amp power supply output for a 7 port (5 direct + 2 intermittent charging) USB hub in my case has solved all the errant behaviours in one action. Plus the ability to connect a large capacity 2.5" HDD via USB by observing the same power requirement for each connected device and keeping everything within the 5 Amp total again in this case.



                  (I searched for this topic on the basis of having both PS/2 mouse and keyboard with a PS/2 x2 female connectors to, a USB x1 male connector, cable connected adaptor. This adaptor I have had ever since USB began to take over from PS/2 and I find it still useful with an original IBM labelled heavy duty claketty-clack keyboard and fortunately an optical 3 button wheelie-mouse. Never throw anything away. IT will always revive an opportunity for cheaper usage! That is even when everybody has forgotten about the different power requirements of old and new tech' and the consequences)



                  Thank you.






                  share|improve this answer















                  With very unstable behaviours from both PS/2 keyboard (wild repeating keys, mixed with, vertical cursor movements both up and down) utter chaos when trying to edit a config file! Also unstable PS/2 mouse configuration and action of mouse keys altering at each re-connection making the GUI and web-browser generally unusable!



                  Good call: Drawing attention to the use of a powered USB hub, 5 Amp power supply output for a 7 port (5 direct + 2 intermittent charging) USB hub in my case has solved all the errant behaviours in one action. Plus the ability to connect a large capacity 2.5" HDD via USB by observing the same power requirement for each connected device and keeping everything within the 5 Amp total again in this case.



                  (I searched for this topic on the basis of having both PS/2 mouse and keyboard with a PS/2 x2 female connectors to, a USB x1 male connector, cable connected adaptor. This adaptor I have had ever since USB began to take over from PS/2 and I find it still useful with an original IBM labelled heavy duty claketty-clack keyboard and fortunately an optical 3 button wheelie-mouse. Never throw anything away. IT will always revive an opportunity for cheaper usage! That is even when everybody has forgotten about the different power requirements of old and new tech' and the consequences)



                  Thank you.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 24 at 17:53

























                  answered Jan 24 at 17:31









                  Alexandra CrawfordAlexandra Crawford

                  62




                  62






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f446293%2fconnect-ps-2-usb-keyboard-to-linux%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                       ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕