Skip to content
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

Keyboard & trackpad firmware version returned by USB #8

Closed
Lady-Galadriel opened this issue Jan 22, 2020 · 7 comments
Closed

Keyboard & trackpad firmware version returned by USB #8

Lady-Galadriel opened this issue Jan 22, 2020 · 7 comments

Comments

@Lady-Galadriel
Copy link

Would it now be possible to add a USB feature to get the firmware version?

The command "lsusb -v" against the device shows lots of information;

Bus 008 Device 002: ID 258a:001e  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x258a 
  idProduct          0x001e 
  bcdDevice            1.00
  iManufacturer           1 HAILUCK CO.,LTD
  iProduct                2 USB KEYBOARD
  iSerial                 0 
  bNumConfigurations      1
...

Perhaps use the currently un-used "iSerial" field.

Or perhaps someone more knowlegable on USB can make a suggestion where to put the firmware version.

@Lady-Galadriel
Copy link
Author

Actually looking at my keyboard, it appears to have the version field in USB as;

Revision Number:  1.05

Can we add that to the USB info sent on inquiry?

@jackhumbert
Copy link
Owner

We can customise all of that info (the strings probably being the most useful), but the actual info there is limited to what the device descriptors return. It might be possible to specify some different options to get it to show different things though. Do you have any USB devices that show what you want there?

I just pushed some notes on where this stuff is in the fw_ansi.a51 file.

@Lady-Galadriel
Copy link
Author

I probably should have said that "my keyboard" was an external USB keyboard. And that Revision Number: output is directly from lsusb -v for that keyboard.

People in the Pinebook Pro forums wanted to know if they have the updated firmware. If we start versioning it, and can view the version in lsusb -v then the answer is straight forward. Instead of "put finger on trackpad, try typing. If typing works, you have new firmware".

@jackhumbert
Copy link
Owner

To get the best experience with lsusb, we'll probably need to modify the usb id list at /var/lib/usbutils/usb.ids to include something like this:

258a  Pine Microsystems
	001e  Pinebook Pro Keyboard

but maybe choose a different vendor/product ID from Sinowealth's. This will allow the lsusb -v to have whatever we put there next to the vendor/product ID, in addition to the Manufactuer/Product Strings. FWIW, I'm only able to see those strings when sudo-ing, but that might be a rule that could be customised as well.

I'm not sure why we can't see the revision number here like that (it should be the same as bcdDevice from what I can tell), but maybe that's something that needs messed with.

@jackhumbert
Copy link
Owner

How's something like this?

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x258a
  idProduct          0x001e
  bcdDevice            1.00
  iManufacturer           1 Pine64
  iProduct                2 Pinebook Pro
  iSerial               255 ANSI 0.1

It does require sudo, unless we modify the rules. This is without the usb.ids modification. I'm not sure how the device you have is expliciting showing "Revision Number" - do you have any more info on that device?

@Lady-Galadriel
Copy link
Author

Yes, what you wrote looks great. For getting the firmware version, I think using SUDO is perfectly acceptable. It's rare that we need it. But, if a user is having trouble, we can request the existing Manufacturer, Product and firmware version of their keyboard.

It's also good that you specify ANSI, because we have at least 1 other keyboard type, ISO. As time goes on, we might even have 3rd or 4th choices.

I thought I got the "Revision Number" from my Sun Type 7 USB keyboard, (with built in USB hub). But now that you have asked me to get more information, I can't find it again :-(.
From the simple lsusb output, this is my keyboard;

Bus 001 Device 107: ID 0430:00a2 Sun Microsystems, Inc. Type 7 Keyboard
Bus 001 Device 106: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 105: ID 0430:100e Sun Microsystems, Inc. 24.1" LCD Monitor v4 / FID-638 Mouse
Bus 001 Device 104: ID 0bda:5401 Realtek Semiconductor Corp. RTL 8153 USB 3.0 hub with gigabit ethernet

Note that I have a mouse wireless dongle plugged into one of the keyboard's USB hub ports. The LCD Monitor and Realtek devices are not brought out.

Trying detailed information does not show any Revision Number, on any device, on any of my 3 systems, (desktop, miniature media server, or Pinebook Pro).

Oh, well, phantoms have been at work.

@jackhumbert
Copy link
Owner

Ahh well shoot. It might have been a custom string somewhere.

I've added this to master with #14, so I think this can be closed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants