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

interface number wrong #20

Open
krayon opened this issue Jun 12, 2020 · 5 comments
Open

interface number wrong #20

krayon opened this issue Jun 12, 2020 · 5 comments
Assignees

Comments

@krayon
Copy link
Owner

krayon commented Jun 12, 2020

I ran these apt-get commands and then make and everything worked except for the interface number, which defaults to 1 but had to be 0 on my system and which resulted in the fact that the kernel driver could not be detached.

sudo apt-get install build-essential pkg-config linux-headers-amd64 libusb-1.0-0-dev

Originally posted by @silkentrance in #10 (comment)

@krayon
Copy link
Owner Author

krayon commented Jun 12, 2020

@silkentrance Are you saying that the interface number in the source code needed to be 0?

Are you talking about here:

ratslap/main.c

Lines 1341 to 1342 in da17398

// FIXME: Get interface index somehow
usb_interface_index = 1;

@silkentrance
Copy link

silkentrance commented Jun 13, 2020

@krayon Yes, after having changed that to 0 it worked. Debian/Buster.

@krayon krayon self-assigned this Aug 31, 2020
@A-J-S-B
Copy link

A-J-S-B commented Dec 19, 2020

Hello,
I have more details about this issue and another one:

Compiling with Value 1 is the only way to detach the G300s Keyboard.
Compiling with Value 0 is the only way to program and read profiles.

Here is a resume...

  1. Compile RATSLAP with USB_INTERFACE_INDEX set to 1

  2. Execute these two commands in the Terminal with that version...

sudo ./ratslap -s F3
sudo ./ratslap -p F3

These two commands and respective order is the ONLY way to detach the Keyboard.
1st Command executes successfully , 2nd fails BUT i have to issue it or Keyboard doesn't detach...you can use F4 or F5 to achieve same results.

  1. Compile other version of RATSLAP with USB_INTERFACE_INDEX set to 0.

  2. Execute any further commands that you need to read or program the G300s with this other version.

After all modifications are done to your profiles, reboot PC OR disconnect and reconnect G300s after some seconds.
ALL Button assignments, etc. will be FULLY working, ANY further modifications, need execution again of the two RATSLAP versions with above commends to correctly initiate the Programming/Reading Mode of the G300s. .

Linux Distro : SLACKWARE-CURRENT 64bit

@A-J-S-B
Copy link

A-J-S-B commented Dec 19, 2020

So, I guess a solution is that program would be modified somehow to automatically, no matter the command we want to execute, the program silently (sending result to /dev/null) will internally issue by itself sudo ./ratslap -s , followed by sudo ./ratslap -s with usb_interface_index set to 1 and then execute user command with usb_interface_index set to 0....

A crude solution, i know...but it would work flawlessly and meanwhile you could find a better solution :D

@A-J-S-B
Copy link

A-J-S-B commented Dec 19, 2020

PS:
Dunno what happened but i made fresh compilations of RATSLAP with values 1 and 0 and now all works well with version with Value at 1 and G300s "Keyboard" is not even (need to be) disabled at any moment, go figure.

Another thing is that the issue continued to happen with 0.4.1 Binary distributed from you.

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

3 participants