gotzl / hid-fanatecff

Driver to support FANATEC input devices, in particular ForceFeedback of various wheel-bases
GNU General Public License v2.0
173 stars 21 forks source link

I've got 6 more LEDs on my Formula 2.5X #38

Open GoLD-ReaVeR opened 1 year ago

GoLD-ReaVeR commented 1 year ago

Could you look for them? :D

I'd like to bind traction control and abs triggers to the lights. As well as perhaps the current gear.

gotzl commented 1 year ago

Kind of similar situation as for #37, we would need a USB traffic dump to see how this LEDs are controlled..

Cykyrios commented 11 months ago

I just got myself the Clubsport F1 2023 wheel, which is basically the same as the Formula 2.5 wheel. Here's a Wireshark trace of the LED test and a gif of the LED animation (starting with the side LEDs). led.pcapng.zip

Fanatec_CS_F1_led

I did the same for the OLED display (the test starts with the empty white screen): display.pcapng.zip

Fanatec_CS_F1_display

@gotzl let me know if you need anything else, I'd be happy to help.

Cykyrios commented 11 months ago

So, I had a look at the trace and found the following:

With the above, the first line of the test being ff 01 01 00 1f 00 00 00 00 00 1f 00 00 00 00, the 1st and 4th flag LEDs (bottom on both sides) are red.

gotzl commented 11 months ago

Hey, thanks for the dumps and already analyzing the LEDs function. I'm gonna work on that soon, I'll wire this up in the kernel using the multicolor subsys. Question is how to organize the sysfs files. What do you think about having LFLAG1..LFLAG3 and RFLAG1..RFLAG3 for the flags and the RPM1..RPM9 for the others? Also, could you post the value of the wheel_id sysfs file?

Cykyrios commented 11 months ago

LFLAG, RFLAG and RPM sounds good to me, I just went through the wheels on Fanatec's website, and it does seem like all wheels that have them have 9 RPM LEDs and 2x3 flag LEDs. I'll get back to you about wheel_id on friday or saturday as I won't be able to check before then, but I assume it won't be the same value as the 0020 that was associated with my CS DD wheelbase, and rather something to tell apart the wheel itself from other wheels?

gotzl commented 11 months ago

Yep, AFAIU the wheel_id should identify the mounted wheel rim (so independent of wheel-base)...

Cykyrios commented 11 months ago

Hey, got back to my rig, wheel_id is 0x000a.

gotzl commented 11 months ago

K, guess that checks out. Apparently, it has the same ID as the Formula V2 wheel, which seems to have the same display/LEDs situation.

Cykyrios commented 7 months ago

Hi, while I'm waiting for this to be added, I'd like to ask a few things:

gotzl commented 7 months ago

Hi!

Cykyrios commented 7 months ago

The Button Module Endurance has multi-color LEDs just like the Formula wheel, the wireshark trace for the LED test appears to be the same (or at least very close) for both wheels. I'm not sure I'll be able to do anything useful about the display though, it only works in Legacy mode (without all the telemetry data), I'll have to see if I can find a drive to put a non-VM Windows on and test that. LFS kinda works on VirtualBox but I get no LEDs at all, though it may be because of the game itself.

I'm somewhat confused about wheel_id for the Button Module Endurance as I first found 0x04, but it sometimes changes to 0x06 or even 0x00 when I switch wheels, right now I have 0x04 for the Formula wheel too...

I managed to write to the sysfs file (0 or 1) for RPM LEDs and they do turn on or off. Is #60 in a state that I could test colors (and flags) in the same way?

gotzl commented 7 months ago

LFS kinda works on VirtualBox but I get no LEDs at all, though it may be because of the game itself.

Afaiu, games use the Fanatec SDK in windows to drive the extended features of the wheel. I don't think that this is integrated into LFM ...

I'm somewhat confused about wheel_id ...

I found this wheel_id by looking into what field changes when putting on another wheel. I found 0x04 for my CSL_ELITE_STEERING_WHEEL_WRC_ID. So it seems that the way I try to get the wheel_id is not correct :(

I managed to write to the sysfs file (0 or 1) for RPM LEDs and they do turn on or off

Ok, so then you should get some blinking by using hid-fanatecff-tool, I guess ...

Is https://github.com/gotzl/hid-fanatecff/pull/60 in a state that I could test colors (and flags) in the same way?

I think in principle yes. But the sysfs files it creates depend on the wheel_id, and the functions for the Formula wheel are selected when this is 0x0a ... So in the current state you won't get the correct sysfs files. I guess we've to figure the wheel_id out, first. (You could modify the IDs in hid-ftec.h to fit what you're getting, though ...) Also note that it is under development. So I don't guarantee that it doesn't crash your PC ;)