Re: Litra Glow on Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 25 Oct 2022 at 09:46, Benjamin Tissoires
<benjamin.tissoires@xxxxxxxxxx> wrote:
> Depending on how the device presents itself, we might have to use
> hid-logitech-hidpp, not hid-lg FWIW.
Ah, indeed it seems to be a hidpp device.
I so far wrote code to interact with the device using hidraw and
hiddev. What are the implications of a hidpp device?
How is hidpp exposed to userspace?
>From a search it seems like there are very few userspace programs that
handle hidpp on Linux.

> And to answer the question "how to map the device to input
> "primitives".", it all depends on how the device exports itself.
All information that I have gathered so far is on
https://github.com/abergmeier/litra_glow_linux.

The output of `hidpp-list-features /dev/hidraw0` is:
```
Logi Litra Glow (046d:c900) is a HID++ 4.2 device
Feature 0x01: [0x0001] Feature set
Feature 0x02: [0x0003] Device FW version
Feature 0x03: [0x0005] Device name
Feature 0x04: [0x1990] ?
Feature 0x05: [0x1eb0] ? (hidden)
Feature 0x06: [0x00c2] DFUcontrol 3 (hidden)
```
Is it possible that Feature 0x04 is the protocol for sending changes
to the device?
All the payload that is sent to the device has a 0x04 directly in
front of the instructions.
As an example, for turning the light on you send raw bytes: [0x11,
0xff, 0x04, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
0x10 seems to indicate setting the on state.

> > To recap there are 5 hardware buttons and 3 states:
> > - State: "Color temperature in range [u, x]" Button: up
> > - State: "Color temperature in range [u, x]" Button: down
> > - State/Button On/Off
> > - State "Brightness in range [y, z]" Button: up
> > - State "Brightness in range [y, z]" Button: down
>
> FWIW, you should be able to use hid-recorder[0] (as root) to record
> traces of the events, and to parse them on the fly. Also, if you
> provide us the output, we can replay the traces locally as if we
> virtually plugged in the device.

See the GitHub repo - there are already initial recordings.

> FWIW, if the first byte you have to send to control the LED is 0x10,
> 0x11 or 0x12 then this is a HID++ device that needs to go in
> hid-logitech-hidpp and a lot of groundwork is already done in the
> kernel for it.
I am trying to get up to speed with hidpp - but I am not there yet.
Do you have any hints on what code to read specifically since
logitech-hidpp is a bit long...

Thanks for the feedback so far



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux