nightmode/logitech-g29

Calibration

Closed this issue · 3 comments

7CUP7 commented

Thank you for the great code!

I am currently trying to write several small .exe files that will each move the wheel to a certain position based on your code. I then want to/need to call these .exe files from another program (for various reasons - long story). Right now, the only issue I am encountering is that once the connect function is used, the wheel always calibrates before moving to the indicated position and I need to turn the calibration off, because otherwise the .exe files will always re-calibrate the wheel when started from my other program. I was checking the code, but so far have not been succesful in locating the lines that control when the calibration is done. Could you give me a hint where I can find them and turn calibration off?

Thank you very much in advance!

Ack, sorry for the delayed reply.

Before we get into code, a quick overview of what should happen.

  • Code looks for a USB device that it thinks is a Logitech G29 wheel and if it finds a match, it proceeds.
  • Code uses a force feedback effect to turn the wheel a bit and generate a data event we can read.
  • The data event we read can be in two formats, low or high precision. If low precision, calibrate the wheel into high precision mode. If the wheel is already in high precision mode, skip the calibration.
  • Code is now ready to read events as they happen or send commands to activate force feedback, LEDs, etc...

Ok now some code from the code\index.js file.

Line 157 is for the function findWheel and if something goes wrong here, you won't even get to the calibration code. Sounds like this function is working good for you so not too much to worry about here.

Line 91 is for the function connect and there is some interesting stuff in here. Line 116 for example is checking the length of a data read event and if it is long enough, the code knows the wheel is already in high precision mode and it can skip the calibration. Line 131 is the wheel calibration you are looking for. Ideally it should only need to be run once per time you plug the wheel into your system. As long as power is uninterrupted and it stays in the same USB slot, the wheel seems to stay in high precision mode.

If things are still acting weird after you make modifications, make sure you are running a G29 wheel plugged directly into a real physical machine and not a virtual machine. I've seen lots of odd behaviors with virtual machines that share resources.

Another thing to check is the platform mode switch on the wheel. Make sure it is set to PS3. More info at https://support.logitech.com/en_us/article/Set-the-G29-racing-wheel-for-Playstation-4-Playstation-3-or-PC-platforms?product=a0qi0000006PmxKAAS

7CUP7 commented

Thank you for the detailed help!

I have tried deleting those lines of code (as well as larger portions of the code) and noticed that my problem has apparently been a different one all along. I had thought that I was just not finding the right code in the index.js file, but it turns out that no matter what I change in the index.js file, the code is not updated and the original code is run.

I am totally new to using node. I´ve tried uninstalling and installing logitech-g29 again and I have also tried to rebuilt logitech-g29 from source using the information you provided. But so far I have not succeded.

Could you give me some guidance on how to have the program use the updated index.js code?
It would be great if you could give me some hints on where to look for a solution.

Thank you very much for your help!

If you are using any source control I would skip that for now to make things simpler. You can bypass the npm install for the logitech-g29 library too by downloading a ZIP from https://github.com/ForestMist/logitech-g29/archive/master.zip

Next, go to whatever directory you unzipped the logitech-g29 library into and run npm install to install dependencies.

At this point, you should be able to hack the code\index.js file and see things change when you run node . from the root of the logitech-g29 library.