Coder Social home page Coder Social logo

ac_shifting_leds's Introduction

Logitech G29 Shifter LEDs for Assetto Corsa & Dirt 4

A Linux utility for Assetto Corsa and Dirt 4 that lights up the shifting LEDs on the Logitech G29 wheel based on the car's engine RPM.

image of the shifting LEDs on the G29

Requirements

  • NodeJS
    • Ubuntu: sudo apt install nodejs
  • node-hid
    • npm install node-hid

Usage

  1. Download ac_shifting_leds.js.

  2. In terminal, launch ac_shifting_leds.js:

#:~/Downloads$ node ac_shifting_leds.js 
  1. Then launch your game of choice and start playing.

If you switch back to the terminal, you should see some success messages:

Connecting to Dirt / Codemasters
Connecting to Assetto Corsa
Assetto Corsa: subscribing to updates
{
  carName: 'bmw_1m',
  driverName: 'Player',
  identifier: 4242,
  version: 1,
  trackName: 'drift',
  trackConfig: 'drift'
}
Peak RPM set to 7000
Connected to Logitech G29 wheel
Receiving data. First message:
{
 "identifier": 97,
 "size": 328,

Potential Issues

  • You may get HID permission errors if the G29 isn't accessible to your user account. If that's the case, then you may need to update your udev rules. See the instructions in the Oversteer docs for more details.

  • In Dirt 4, you will need to enable UDP telemetry data. Open the following file in your favorite text editor:

~/.local/share/feral-interactive/DiRT 4/VFS/User/AppData/Roaming/My Games/DiRT 4/hardwaresettings/hardware_settings_config.xml

and change:

<udp enabled="false" extradata="3" ip="127.0.0.1" port="20777" delay="1" />`

to

<udp enabled="true" extradata="3" ip="127.0.0.1" port="20777" delay="1" />`

Feedback

Feel free to file issues here.

ac_shifting_leds's People

Contributors

d4rk avatar

Stargazers

 avatar  avatar Tinolm avatar  avatar Michał Kopeć avatar  avatar Neros avatar mamgo avatar Samuel Perron avatar  avatar utzuro avatar Huy Doan avatar Peter Marks avatar Chris Duranti avatar Michiel Scholten avatar Arnaud Couderc avatar khomkrit Uparakham  avatar  avatar

Watchers

 avatar leillo1975 avatar James Cloos avatar  avatar Tinolm avatar

Forkers

mkopec

ac_shifting_leds's Issues

Some feedback

So I tested this on Dirt 4 and Dirt Rally, it works on both.

However, I have to launch the script with root privileges (sudo). Maybe I can add my user to a group to avoid this.

I think the Dirt/CM part could work on quite a bunch of CM games (F1 2017, Grid Autosport,...) as there are similar config lines in the hardware_settings_config of these games.

Maybe it could also work with Project Cars / PC2 with some futher coding.

Cheers

Buffer overflow error

When I run Dirt4, I see the following:

$ node -v                                                                                                                                                                                                                                                                                   
v12.21.0

$ node ac_shifting_leds.js

Connecting to Dirt / Codemasters
Connecting to Assetto Corsa
internal/buffer.js:82
  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 64. Received 148
	at boundsError (internal/buffer.js:82:9)
	at Buffer.readFloatForwards [as readFloatLE] (internal/buffer.js:528:5)
	at BufferReader.float (/home/ttelford/src/github/ac_shifting_leds/ac_shifting_leds.js:54:30)
	at CodemastersClient._processUDPMessage (/home/ttelford/src/github/ac_shifting_leds/ac_shifting_leds.js:400:25)
	at Socket.<anonymous> (/home/ttelford/src/github/ac_shifting_leds/ac_shifting_leds.js:104:13)
	at Socket.emit (events.js:314:20)
	at UDP.onMessage [as onmessage] (dgram.js:921:8) {
  code: 'ERR_OUT_OF_RANGE'

I'm happy to include any other dependency information - but I'm not quite sure how to gather them in Node.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.