04f2:1670 Chicony Electronics Co., Ltd keyboard is broken by hidapi example (hidapi-libusb) #105

Closed
opened 2019-10-17 10:47:59 -05:00 by amosbird · 19 comments
amosbird commented 2019-10-17 10:47:59 -05:00 (Migrated from github.com)

Hello. I'm trying to test hidapi and possibly use it to set fn_lock of my keyboard. I grabbed the example code and tried to see if it runs. https://github.com/libusb/hidapi#what-does-the-api-look-like

Then suddenly my keyboard stops responding, lsusb doesn't list it anymore. The id was 0x17ef, 0x60b5 now becomes 0x04f2, 0x1670 (I tested it while unplug and plug).

Is there any way of restoring my keyboard? Thank you!

Hello. I'm trying to test hidapi and possibly use it to set fn_lock of my keyboard. I grabbed the example code and tried to see if it runs. https://github.com/libusb/hidapi#what-does-the-api-look-like Then suddenly my keyboard stops responding, `lsusb` doesn't list it anymore. The id was `0x17ef, 0x60b5` now becomes `0x04f2, 0x1670` (I tested it while unplug and plug). Is there any way of restoring my keyboard? Thank you!
amosbird commented 2019-10-17 11:54:48 -05:00 (Migrated from github.com)

The device is very much broken

Bus 003 Device 012: ID 04f2:1670 Chicony Electronics Co., Ltd
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04f2 Chicony Electronics Co., Ltd
  idProduct          0x1670
  bcdDevice            4.00
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      31
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
The device is very much broken ``` Bus 003 Device 012: ID 04f2:1670 Chicony Electronics Co., Ltd Couldn't open device, some information will be missing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x04f2 Chicony Electronics Co., Ltd idProduct 0x1670 bcdDevice 4.00 iManufacturer 0 iProduct 0 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0029 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.10 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 31 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 ```
Youw commented 2019-10-17 12:15:27 -05:00 (Migrated from github.com)

What backend are you using, hidraw or libusb?

What backend are you using, hidraw or libusb?
amosbird commented 2019-10-17 12:19:42 -05:00 (Migrated from github.com)

libusb -lhidapi-libusb

libusb `-lhidapi-libusb`
Youw commented 2019-10-17 12:57:15 -05:00 (Migrated from github.com)
  1. Is there any way of restoring my keyboard?

So re-plug doesn't help?

  1. Have tried hidraw backend?
1) Is there any way of restoring my keyboard? So re-plug doesn't help? 2) Have tried hidraw backend?
amosbird commented 2019-10-17 13:40:46 -05:00 (Migrated from github.com)

So re-plug doesn't help?

It doesn't

Have tried hidraw backend?

But what should I try? Rerun the example doesn't seem to be able to fix the keyboard

> So re-plug doesn't help? It doesn't > Have tried hidraw backend? But what should I try? Rerun the example doesn't seem to be able to fix the keyboard
Youw commented 2019-10-17 14:10:33 -05:00 (Migrated from github.com)

Is it appears broken when you plug it to a different PC / OS ?
(To identify is it host or dev issue.)

Is it appears broken when you plug it to a different PC / OS ? (To identify is it host or dev issue.)
amosbird commented 2019-10-17 14:23:12 -05:00 (Migrated from github.com)

I tried plugging into windows 10 machine, doesn't work either. It's dev issue

I tried plugging into windows 10 machine, doesn't work either. It's dev issue
Youw commented 2019-10-17 15:42:51 -05:00 (Migrated from github.com)

So far I haven't heard of devices broken by hidapi, and it (hidapi) definitely doesn't do anything that is out of spec from HID (or USB) perspective.

What you experience is look like device's internal state (flash memory or smth.) has been changed in some weird way, and it is likely a vendor bug.

I'd suggest trying to contact your keyboard vendor support to identify what might went wrong.

So far I haven't heard of devices broken by `hidapi`, and it (hidapi) definitely doesn't do anything that is out of spec from HID (or USB) perspective. What you experience is look like device's internal state (flash memory or smth.) has been changed in some weird way, and it is likely a vendor bug. I'd suggest trying to contact your keyboard vendor support to identify what might went wrong.
amosbird commented 2019-10-17 15:47:14 -05:00 (Migrated from github.com)

I'd suggest trying to contact your keyboard vendor support to identify what might went wrong.

Then I'm out of luck.

> I'd suggest trying to contact your keyboard vendor support to identify what might went wrong. Then I'm out of luck.
Youw commented 2019-10-17 15:51:15 -05:00 (Migrated from github.com)

BTW: example from README uses device's specific control command, and it is not advisable to try it with the unknown device.
Looks like it worth explicitly adding it to the readme.

BTW: example from README uses device's specific control command, and it is not advisable to try it with the unknown device. Looks like it worth explicitly adding it to the readme.
amosbird commented 2019-10-17 15:51:43 -05:00 (Migrated from github.com)

Exactly! I wish there is a WARNING SIGN.

Exactly! I wish there is a WARNING SIGN.
z3ntu commented 2019-10-17 16:10:29 -05:00 (Migrated from github.com)

So it seems that 17ef:60b5 is Lenovo ThinkPad X1 Tablet Thin Keyboard Gen 3 , is that correct?

So it seems that `17ef:60b5` is `Lenovo ThinkPad X1 Tablet Thin Keyboard Gen 3` , is that correct?
amosbird commented 2019-10-17 18:07:42 -05:00 (Migrated from github.com)

Yes

Yes
Qbicz commented 2019-10-18 02:22:55 -05:00 (Migrated from github.com)

Looks like these 2 writes (0x80, 0x81) changed state of your keyboard in a way that the firmware authors have not intercepted. Well, you should never run code from Internet if you don't fully understand it, but we can definitely put a warning before the code sample. @amosbird I hope you will be able to contact the vendor and fix the issue.

Looks like these 2 writes (0x80, 0x81) changed state of your keyboard in a way that the firmware authors have not intercepted. Well, you should never run code from Internet if you don't fully understand it, but we can definitely put a warning before the code sample. @amosbird I hope you will be able to contact the vendor and fix the issue.
Qbicz commented 2019-10-18 02:34:56 -05:00 (Migrated from github.com)

Opened https://github.com/libusb/hidapi/pull/106 to prevent problems like this.

Opened https://github.com/libusb/hidapi/pull/106 to prevent problems like this.
amosbird commented 2019-10-18 10:37:22 -05:00 (Migrated from github.com)

Is it possible to extract the firmware from another working keyboard and flash it to this broken one?

Is it possible to extract the firmware from another working keyboard and flash it to this broken one?
Youw commented 2019-10-18 12:13:59 -05:00 (Migrated from github.com)

That is a good question to a keyboard vendor.
There is no universal solution.

That is a good question to a keyboard vendor. There is no universal solution.
amosbird commented 2019-10-18 12:16:04 -05:00 (Migrated from github.com)

OK. Anyway, the tuition is 100$ and I've learned it hard.

OK. Anyway, the tuition is 100$ and I've learned it hard.
Qbicz commented 2019-11-05 07:22:32 -06:00 (Migrated from github.com)

Merged #106.

Merged #106.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#105
No description provided.