Giter Site home page Giter Site logo

apihlaja / node-irsdk Goto Github PK

View Code? Open in Web Editor NEW
98.0 12.0 54.0 442 KB

iRacing SDK implementation for Node.js.

Home Page: https://apihlaja.github.io/node-irsdk

License: MIT License

Python 0.69% JavaScript 53.03% C++ 27.93% C 18.23% HTML 0.12%
nodejs iracing

node-irsdk's Introduction

node-irsdk

Build status Greenkeeper badge Dependencies devDependencies npm version

Unofficial iRacing SDK implementation for Node.js.

node-irsdk provides data access (live telemetry and session info) and most of available commands. You can find some usage examples from utils directory, and there is some data samples too.

Other iRSDK implementations:

Installing

Make sure you have Node.js v6 x64 or later.

npm install --save node-irsdk

API documentation

irsdk

irsdk.init([opts]) ⇒ iracing

Initialize JsIrSdk, can be done once before using getInstance first time.

Kind: static method of irsdk
Returns: iracing - Running instance of JsIrSdk

Param Type Default Description
[opts] Object Options
[opts.telemetryUpdateInterval] Integer 0 Telemetry update interval, milliseconds
[opts.sessionInfoUpdateInterval] Integer 0 SessionInfo update interval, milliseconds
[opts.sessionInfoParser] sessionInfoParser Custom parser for session info
var irsdk = require('node-irsdk')
// look for telemetry updates only once per 100 ms
var iracing = irsdk.init({telemetryUpdateInterval: 100})

irsdk.getInstance() ⇒ iracing

Get initialized instance of JsIrSdk

Kind: static method of irsdk
Returns: iracing - Running instance of JsIrSdk

var irsdk = require('node-irsdk')
var iracing = irsdk.getInstance()

iracing ⇐ events.EventEmitter

Kind: global class
Extends: events.EventEmitter
Emits: Connected, Disconnected, Telemetry, TelemetryDescription, SessionInfo
See: EventEmitter API

new JsIrSdk()

JsIrSdk is javascript implementation of iRacing SDK.

Don't use constructor directly, use getInstance.

var iracing = require('node-irsdk').getInstance()

iracing.Consts : IrSdkConsts

iRacing SDK related constants

Kind: instance property of iracing

iracing.camControls : Object

Camera controls

Kind: instance property of iracing

camControls.setState(state)

Change camera tool state

Kind: static method of camControls

Param Type Description
state CameraState new state
// hide UI and enable mouse aim
var States = iracing.Consts.CameraState
var state = States.CamToolActive | States.UIHidden | States.UseMouseAimMode
iracing.camControls.setState(state)

camControls.switchToCar(carNum, [camGroupNum], [camNum])

Switch camera, focus on car

Kind: static method of camControls

Param Type Description
carNum Integer | String | CamFocusAt Car to focus on
[camGroupNum] Integer Select camera group
[camNum] Integer Select camera
// show car #2
iracing.camControls.switchToCar(2)
      
// show car #02
iracing.camControls.switchToCar('02')
      
// show leader
iracing.camControls.switchToCar('leader')
      
// show car #2 using cam group 3
iracing.camControls.switchToCar(2, 3)

camControls.switchToPos(position, [camGroupNum], [camNum])

Switch camera, focus on position

Kind: static method of camControls

Param Type Description
position Integer | CamFocusAt Position to focus on
[camGroupNum] Integer Select camera group
[camNum] Integer Select camera
iracing.camControls.switchToPos(2) // show P2

iracing.playbackControls : Object

Replay and playback controls

Kind: instance property of iracing

playbackControls.play()

Play replay

Kind: static method of playbackControls

iracing.playbackControls.play()

playbackControls.pause()

Pause replay

Kind: static method of playbackControls

iracing.playbackControls.pause()

playbackControls.fastForward([speed])

fast-forward replay

Kind: static method of playbackControls

Param Type Default Description
[speed] Integer 2 FF speed, something between 2-16 works
iracing.playbackControls.fastForward() // double speed FF

playbackControls.rewind([speed])

rewind replay

Kind: static method of playbackControls

Param Type Default Description
[speed] Integer 2 RW speed, something between 2-16 works
iracing.playbackControls.rewind() // double speed RW

playbackControls.slowForward([divider])

slow-forward replay, slow motion

Kind: static method of playbackControls

Param Type Default Description
[divider] Integer 2 divider of speed, something between 2-17 works
iracing.playbackControls.slowForward(2) // half speed

playbackControls.slowBackward([divider])

slow-backward replay, reverse slow motion

Kind: static method of playbackControls

Param Type Default Description
[divider] Integer 2 divider of speed, something between 2-17 works
iracing.playbackControls.slowBackward(2) // half speed RW

playbackControls.search(searchMode)

Search things from replay

Kind: static method of playbackControls

Param Type Description
searchMode RpySrchMode what to search
iracing.playbackControls.search('nextIncident')

playbackControls.searchTs(sessionNum, sessionTimeMS)

Search timestamp

Kind: static method of playbackControls

Param Type Description
sessionNum Integer Session number
sessionTimeMS Integer Session time in milliseconds
// jump to 2nd minute of 3rd session
iracing.playbackControls.searchTs(2, 2*60*1000)

playbackControls.searchFrame(frameNum, rpyPosMode)

Go to frame. Frame counting can be relative to begin, end or current.

Kind: static method of playbackControls

Param Type Description
frameNum Integer Frame number
rpyPosMode RpyPosMode Is frame number relative to begin, end or current frame
iracing.playbackControls.searchFrame(1, 'current') // go to 1 frame forward

iracing.telemetry

Latest telemetry, may be null or undefined

Kind: instance property of iracing

iracing.telemetryDescription

Latest telemetry, may be null or undefined

Kind: instance property of iracing

iracing.sessionInfo

Latest telemetry, may be null or undefined

Kind: instance property of iracing

iracing.execCmd(msgId, [arg1], [arg2], [arg3])

Execute any of available commands, excl. FFB command

Kind: instance method of iracing

Param Type Description
msgId Integer Message id
[arg1] Integer 1st argument
[arg2] Integer 2nd argument
[arg3] Integer 3rd argument

iracing.reloadTextures()

Reload all car textures

Kind: instance method of iracing

iracing.reloadTextures() // reload all paints

iracing.reloadTexture(carIdx)

Reload car's texture

Kind: instance method of iracing

Param Type Description
carIdx Integer car to reload
iracing.reloadTexture(1) // reload paint of carIdx=1

iracing.execChatCmd(cmd, [arg])

Execute chat command

Kind: instance method of iracing

Param Type Description
cmd ChatCommand
[arg] Integer Command argument, if needed
iracing.execChatCmd('cancel') // close chat window

iracing.execChatMacro(num)

Execute chat macro

Kind: instance method of iracing

Param Type Description
num Integer Macro's number (0-15)
iracing.execChatMacro(1) // macro 1

iracing.execPitCmd(cmd, [arg])

Execute pit command

Kind: instance method of iracing

Param Type Description
cmd PitCommand
[arg] Integer Command argument, if needed
// full tank, no tires, no tear off
iracing.execPitCmd('clear')
iracing.execPitCmd('fuel', 999) // 999 liters
iracing.execPitCmd('lf') // new left front
iracing.execPitCmd('lr', 200) // new left rear, 200 kPa

iracing.execTelemetryCmd(cmd)

Control telemetry logging (ibt file)

Kind: instance method of iracing

Param Type Description
cmd TelemCommand Command: start/stop/restart
iracing.execTelemetryCmd('restart')

"Connected"

iRacing, sim, is started

Kind: event emitted by iracing

iracing.on('Connected', function (evt) {
  console.log(evt)
})

"Disconnected"

iRacing, sim, was closed

Kind: event emitted by iracing

iracing.on('Disconnected', function (evt) {
  console.log(evt)
})

"TelemetryDescription"

Telemetry description, contains description of available telemetry values

Kind: event emitted by iracing

iracing.on('TelemetryDescription', function (data) {
  console.log(evt)
})

"Telemetry"

Telemetry update

Kind: event emitted by iracing

iracing.on('Telemetry', function (evt) {
  console.log(evt)
})

"SessionInfo"

SessionInfo update

Kind: event emitted by iracing

iracing.on('SessionInfo', function (evt) {
  console.log(evt)
})

"update"

any update event

Kind: event emitted by iracing

iracing.on('update', function (evt) {
  console.log(evt)
})

iracing~sessionInfoParser ⇒ Object

Parser for SessionInfo YAML

Kind: inner typedef of iracing
Returns: Object - parsed session info

Param Type Description
sessionInfo String SessionInfo YAML

IrSdkConsts

IrSdkConsts, iRacing SDK constants/enums.

Kind: global constant

var IrSdkConsts = require('node-irsdk').getInstance().Consts

IrSdkConsts.BroadcastMsg

Available command messages.

Kind: static enum of IrSdkConsts
Properties

Name Default Description
CamSwitchPos 0 Switch cam, args: car position, group, camera
CamSwitchNum 1 Switch cam, args, driver #, group, camera
CamSetState 2 Set cam state, args: CameraState, unused, unused
ReplaySetPlaySpeed 3 Set replay speed, args: speed, slowMotion, unused
ReplaySetPlayPosition 4 Jump to frame, args: RpyPosMode, Frame Number (high, low)
ReplaySearch 5 Search things from replay, args: RpySrchMode, unused, unused
ReplaySetState 6 Set replay state, args: RpyStateMode, unused, unused
ReloadTextures 7 Reload textures, args: ReloadTexturesMode, carIdx, unused
ChatComand 8 Chat commands, args: ChatCommand, subCommand, unused
PitCommand 9 Pit commands, args: PitCommand, parameter
TelemCommand 10 Disk telemetry commands, args: TelemCommand, unused, unused
FFBCommand 11 not supported by node-irsdk*: Change FFB settings, args: FFBCommandMode, value (float, high, low)
ReplaySearchSessionTime 12 Search by timestamp, args: sessionNum, sessionTimeMS (high, low)

IrSdkConsts.CameraState

Camera state Camera state is bitfield; use these values to compose a new state.

Kind: static enum of IrSdkConsts
Properties

Name Default Description
IsSessionScreen 1 Is driver out of the car
IsScenicActive 2 The scenic camera is active (no focus car)
CamToolActive 4 Activate camera tool
UIHidden 8 Hide UI
UseAutoShotSelection 16 Enable auto shot selection
UseTemporaryEdits 32 Enable temporary edits
UseKeyAcceleration 64 Enable key acceleration
UseKey10xAcceleration 128 Enable 10x key acceleration
UseMouseAimMode 256 Enable mouse aim

IrSdkConsts.RpyPosMode

Kind: static enum of IrSdkConsts
Properties

Name Default Description
Begin 0 Frame number is relative to beginning
Current 1 Frame number is relative to current frame
End 2 Frame number is relative to end

IrSdkConsts.RpySrchMode

Kind: static enum of IrSdkConsts
Properties

Name Default
ToStart 0
ToEnd 1
PrevSession 2
NextSession 3
PrevLap 4
NextLap 5
PrevFrame 6
NextFrame 7
PrevIncident 8
NextIncident 9

IrSdkConsts.RpyStateMode

Kind: static enum of IrSdkConsts
Properties

Name Default Description
EraseTape 0 Clear any data in the replay tape (works only if replay spooling disabled)

IrSdkConsts.ReloadTexturesMode

Kind: static enum of IrSdkConsts
Properties

Name Default
All 0
CarIdx 1

IrSdkConsts.ChatCommand

Kind: static enum of IrSdkConsts
Properties

Name Default Description
Macro 0 Macro, give macro num (0-15) as argument
BeginChat 1 Open up a new chat window
Reply 2 Reply to last private chat
Cancel 3 Close chat window

IrSdkConsts.PitCommand

Kind: static enum of IrSdkConsts
Properties

Name Default Description
Clear 0 Clear all pit checkboxes
WS 1 Clean the winshield, using one tear off
Fuel 2 Request fuel, optional argument: liters
LF 3 Request new left front, optional argument: pressure in kPa
RF 4 Request new right front, optional argument: pressure in kPa
LR 5 Request new left rear, optional argument: pressure in kPa
RR 6 Request new right rear, optional argument: pressure in kPa
ClearTires 7 Clear tire pit checkboxes
FR 8 Request a fast repair
ClearWS 9 Disable clear windshield
ClearFR 10 Disable fast repair
ClearFuel 11 Disable refueling

IrSdkConsts.TelemCommand

Kind: static enum of IrSdkConsts
Properties

Name Default Description
Stop 0 Turn telemetry recording off
Start 1 Turn telemetry recording on
Restart 2 Write current file to disk and start a new one

IrSdkConsts.CamFocusAt

When switching camera, these can be used instead of car number / position

Kind: static enum of IrSdkConsts
Properties

Name Default Description
Incident -3
Leader -2
Exciting -1
Driver 0 Use car number / position instead of this

Development

To develop node-irsdk itself, you need working working installation of node-gyp.

Useful commands:

  • npm install builds binary addon
  • npm run ready runs tests and updates docs

Making a new release

  1. Check if license file needs updating
  2. npm run ready
  3. Tag new version using npm version, push to Github
  4. Wait for Appveyor to upload binaries
  5. npm publish
  6. Add release notes to Github, helper npm run release-notes.

License

Released under the MIT License.

Credits

Parts of original irsdk used, license available here: https://github.com/apihlaja/node-irsdk/blob/master/src/cpp/irsdk/irsdk_defines.h (BSD-3-Clause)

node-irsdk's People

Contributors

apihlaja avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-irsdk's Issues

SessionInfo

A question really. I've been writing some code using node-irsdk and electron for the past two weeks.
One thing I have been struggling is that I always manage to lose the first SessionInfo data after hooking the listerner to my browserwindow. Any tip on that?

Licence Color

The licence color value returning in a format that I couldn't figure out how to get a color out of it.
Licence colors as we have now:
87003
50946
16706564

How i suppose to convert these to actual colors?

An in-range update of mocha is breaking the build 🚨

Version 3.3.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/appveyor/branch** AppVeyor build failed [Details](https://ci.appveyor.com/project/apihlaja/node-irsdk/build/141)

Release Notes coverave

Thanks to all our contributors, maintainers, sponsors, and users! ❤️

As highlights:

  • We've got coverage now!
  • Testing is looking less flaky \o/.
  • No more nitpicking about "mocha.js" build on PRs.

🎉 Enhancements

  • #2659: Adds support for loading reporter from an absolute or relative path (@sul4bh)
  • #2769: Support --inspect-brk on command-line (@igwejk)

🐛 Fixes

  • #2662: Replace unicode chars w/ hex codes in HTML reporter (@rotemdan)

🔍 Coverage

🔩 Other

Commits

The new version differs by 89 commits0.

  • fb1687e :ship: Release v3.3.0
  • 1943e02 Add Changelog for v3.3.0
  • 861e968 Refactor literal play-icon hex code to a var
  • 1d3c5bc Fix typo in karma.conf.js
  • 9bd9389 Fix spec paths in test HTML files
  • 0a93024 Adds tests for loading reporters w/ relative/absolute paths (#2773)
  • 73929ad Comment special treatment of '+' in URL query parsing
  • e2c9514 Merge pull request #2769 from igwejk/support_inspect_break_in_opts
  • 038c636 Support --inspect-brk on command-line
  • b4ebabd Merge pull request #2727 from lamby/reproducible-build
  • 882347b Please make the build reproducible.
  • a2fc76c Merge pull request #2703 from seppevs/cover_utils_some_fn_with_tests
  • ed61cd0 cover .some() function in utils.js with tests
  • f42cbf4 Merge pull request #2701 from craigtaub/landingSpec
  • 6065242 use stubbed symbol

There are 89 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Not working on latest node.js version

  • development dependencies are mess
    • figure out working versions
    • reduce deps, use Jest?
  • update Node.js / Electron support details (active LTS-versions for now?)

An in-range update of prebuild-install is breaking the build 🚨

The dependency prebuild-install was updated from 5.2.4 to 5.2.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prebuild-install is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 2 commits.

  • c269703 5.2.5
  • ecc03b1 Replace '-' with '_' in pkg name when checking npm_config env (#97)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Electron support?

package.json has only node.js version defined at the moment. But Electron binaries are available too. Should figure out which versions of Electron actually work.

Prebuild / NPM install fails on macOS

Is it possible to install this repo also on macOS and develop everything there? Or is Windows mandatory? I get this error when installing with npm on macOS:

prebuild-install WARN install No prebuilt binaries found (target=12.10.0 runtime=node arch=x64 libc= platform=darwin)
  CXX(target) Release/obj.target/IrSdkNodeBindings/src/cpp/IrSdkNodeBindings.o
../src/cpp/IrSdkNodeBindings.cpp:1:12: warning: #pragma once in main file [-Wpragma-once-outside-header]
<U+FEFF>#pragma once
                ^
In file included from ../src/cpp/IrSdkNodeBindings.cpp:3:
In file included from ../src/cpp/IRSDKWrapper.h:3:
../src/cpp/irsdk/irsdk_defines.h:84:10: fatal error: 'tchar.h' file not found
#include <tchar.h>
         ^~~~~~~~~
1 warning and 1 error generated.
make: *** [Release/obj.target/IrSdkNodeBindings/src/cpp/IrSdkNodeBindings.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/username/Documents/Github/iracing/node_modules/node-irsdk
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have XCode and Command Line Tools installed. Running node v12.10.0 and npm v6.10.3 …

charset and special characters.

First of all, thanks for making this.

But it seems that special chars like é, ä etc. are not encoded corretly in the sessioninfo. I get driver names with unreadable chars. I've backtracked the sessioninfo and the call to IrSdkWrapper.getSessionInfo() in JsIrSdk.js doesn't return a propper utf8 encoded yaml string.

Prebuild binaries

I have been thinking about providing pre-build binaries. Without prebuild-ci, it would have been pretty complicated. And I found the module only yesterday. Apparently it have been there for 2 years. Doh.

Pre-build binaries would mean that node-irsdk can be used without node-gyp: no need to go thru this to get started. Much easier..

So, that's on todo-list now. I´ll work on it soon™.

Other thing holding back this, is to figure out Node.js ABI versioning..

Issue installing - invalid non-printable character

I'm trying to install the modules. I tried by installing with the command, with and without the --save param and also tried including the module as a dependency in my package.json, but none of the options worked.
I installed the latest versions of python and visual studio but i still get this error:

npm ERR! File "binding.gyp", line 1 npm ERR! \ufeff{ npm ERR! ^ npm ERR! SyntaxError: invalid non-printable character U+FEFF

What should I do to install it?
Thanks for any info

Team and Driver names are not parsed properly

node-irsdk uses YAML parser for session info but session info is not following YAML spec strictly. Thus there is random issues.

Only issue Im aware of at the moment is team names, for example: output and input. Part of team name is missing because # is comment character in Yaml. There may be some other glitches too.

Also, ' in driver and team names are simply replaced by . Thats done by iRacing, thus its impossible match names you see on screen in iRacing.

Tyre Temps

During a session, the tyre temps are not updated on the fly like the engine RPMs

Add unified "update" event

At the moment, each data update have a little bit different payload. I think I'll add new update event which uses same structure for all events, something like:

{
  timestamp: new Date(),
  type: 'Disconnected',
  data: null
}

Latitude and Longitude in Telemetry events

I was looking though the telemetry event and noticed that latitude and longitude were not available. Is this because these values are not provided by iRacing themselves? Or is this value omitted from the exposed telemetry event? If these values cannot be included due to restrictions on iRacing's side, then are there any other type of coordinate systems that can be exposed?

I am aware that the current library/iRacing exposes the distance along the track since the starting line, but I am looking for something that provides a more detailed, raw, position of the vehicle.

Error installing on Node v14

When trying to install on Node v14, the build process errors.

> [email protected] install C:\Users\jacen\Documents\kandagawa\node_modules\node-irsdk
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.15.1 runtime=node arch=x64 libc= platform=win32)

C:\Users\jacen\Documents\kandagawa\node_modules\node-irsdk>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  IrSdkNodeBindings.cpp
  IrSdkCommand.cpp
  IRSDKWrapper.cpp
  IrSdkBindingHelpers.cpp
  win_delay_load_hook.cc
c:\users\jacen\documents\kandagawa\node_modules\node-irsdk\src\cpp\irsdknodebindings.h(39): warning C4996: 'node::AtExi
t': was declared deprecated (compiling source file ..\src\cpp\IrSdkNodeBindings.cpp) [C:\Users\jacen\Documents\kandagaw
a\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\jacen\appdata\local\node-gyp\cache\14.15.1\include\node\node.h(852): note: see declaration of 'node::AtExit'
   (compiling source file ..\src\cpp\IrSdkNodeBindings.cpp)
c:\users\jacen\documents\kandagawa\node_modules\node-irsdk\src\cpp\irsdkbindinghelpers.cpp(52): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments [C:\Users\jacen\Documents\kandagawa\node_modules\node-irsdk\build\IrS
dkNodeBindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jacen\Documents\kandagawa\node_modules\node-irsdk
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jacen\AppData\Roaming\npm-cache\_logs\2020-11-30T00_37_05_432Z-debug.log

I tested on a fresh Windows installation, and the build process completes without issue on Node v8, but errors once upgraded to Node v14.

Script crashes with exit status 3221225477 if iRacing hasn't been started once

Hey, I recently got everything working with node-irsdk in electron. So far, so good. I first thought I set up my computer somewhat wrong (wrong MSVS version, missing an SDK, or so) but it seems to be another problem.

I have the reproducable error that happens when iRacing hasn't been started once on the machine.

The iRacing service is running after a fresh start / reboot, but the app immediately crashes without a stack trace or message and with exit status 3221225477.

After starting iRacing once, this issue doesn't occur anymore. I can even close iRacing and the app will start (but receive no data).

My wild guess: could it be that trying to access the shared memory map file (which doesn't exist if the sim hasn't been started at least once) let the library fail?

I've seen that Kutu does a little check on a local webserver whether the sim is running or not and only accesses the file if it is running. Maybe you could address this issue the same?

My C/C#/C++/Whatever skills are too bad thus I can't fix that myself :(

Telemetry update interval ignored for replays.

I am trying to get info about current positions and deltas from a replay.
I have this code running:
`iracing.on('Telemetry', function (data) {
console.log('got Telemetry')

for(var i = 0;i<drivers.length;i++){
    var driver = drivers[i];
    //console.log(driver.UserName + " Num: " + driver.CarNumber + " Idx " + driver.CarIdx);
}

var tel = data.values;
//console.log(tel);


var carPositions = tel.CarIdxPosition;
var delta = tel.CarIdxF2Time;


for(var i =1;i<carPositions.length;i++){
    if(carPositions[i] != 0){
        var driver = drivers[carPositions[i]];
        console.log(driver.UserName + " Delta: " + delta[i-1]);
    }
}
console.log("----------------------------------------------------");

})`

The update interval is set to 1000 so every second it outputs the data however I notice it's always the same.
Only when the leader crosses the line, the data is updated.

An in-range update of sinon is breaking the build 🚨

The devDependency sinon was updated from 7.4.1 to 7.4.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 18 commits.

  • 3dd59a5 Update docs/changelog.md and set new release id in docs/_config.yml
  • 5419db2 Add release documentation for v7.4.2
  • d163383 7.4.2
  • ad553d1 Update CHANGELOG.md and AUTHORS for new release
  • bbe6f5e Upgrade nise to latest
  • 78a676f Update @sinonjs/samsam to latest
  • 157b537 Restore sinon.createStubInstance() behaviour (#2073)
  • 766cae4 Merge pull request #2076 from sinonjs/github-workflow
  • 261c4cd renamed step
  • 8525f4d trying built-in coveralls support
  • cf0f402 added coveralls (via npx)
  • 88cf7a9 added code coverage
  • e716d8d Upgrade eslint to latest
  • 4e7bcef Bump eslint-utils from 1.3.1 to 1.4.2
  • 2b1b2df Fix Typo in migration 6 and updated migration docs for migration from… (#2074)

There are 18 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of moment is breaking the build 🚨

Version 2.19.2 of moment was just published.

Branch Build failing 🚨
Dependency moment
Current Version 2.19.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

moment is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch AppVeyor build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Developer support

Hi there!

I'm very extremely happy to have this package open sourced.
It would be great if we developers could contribute to your project, but unfortunately there is no description about how to set up a development environment, and how to compile everything to check if things are working properly.

For example I'm having problems with node version, because in some c headers there is still the old node reference and so it cannot be used with other version of nodes.

Would be great if you can extend the readme for some developer support! I'd love to join and help you out.

[Guide] node-irsdk with vuejs + electron-builder

Hi guys,

it took some time for me to figure out how to create a vuejs based electron app with node-irsdk support. I hope it's ok to leave a step by step guide here, even though it's not an issue. I wasn't sure where to put it else and thought maybe it's worth the write.

npm install -g @vue/cli

vue create myapp

cd into your app

vue add electron-builder
Latest version as of writing is electron 11

npm install --save https://github.com/sabifa/node-irsdk
I selected this fork, as it already fixed the import of the compiled source. If there is any better out there, let me know.

npm install --save-dev electron-rebuild

.\node-modules\.bin\electron-rebuild.cmd
This will rebuild the node-irsdk to be compatible with the electron version you selected - at least on windows.

Add a vue.config.js file to your project root with the following content

module.exports = {
    pluginOptions: {
        electronBuilder: {
            externals: ['node-irsdk'],
            nodeIntegration: true
        }
    }
}

This was the most crucial part to figure out - at least for me.

Now you can run your node-irsdk code in background.js as you would in every other electron app.

....
import * as irsdk from 'node-irsdk'
....
const iracing = irsdk.init({telemetryUpdateInterval: 500, sessionInfoUpdateInterval: 2000})
iracing.on('Connected', function() {
  console.log('iRacing connected..')
})
iracing.on('Disconnected', function() {
  console.log('iRacing disconnected..')
})

*edit: as this is way outdated and as of 30/12/2022 I couldn't get a solution with existing forks, I tried to come up with my own solution. So, if you want to give it a try, you can find it here.

Issue installing with node 16.13.1

I'm a bit of a noob so this may be a basic question. I've been trying to get this installed, and I am unable to troubleshoot this warning when doing npm i node-irsdk

npm WARN install Usage of the --dev option is deprecated. Use --include=dev instead.
npm ERR! code 1
npm ERR! path C:\Users\Nick\Desktop\irtest\node_modules\node-irsdk
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.6 found at "C:\Users\Nick\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp info find VS using VS2017 (15.9.28307.1759) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\Nick\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\Nick\Desktop\irtest\node_modules\node-irsdk\build\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\Nick\AppData\Local\node-gyp\Cache\16.13.1\include\node\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\Nick\AppData\Local\node-gyp\Cache\16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\Nick\\AppData\\Local\\node-gyp\\Cache\\16.13.1\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\Users\Nick\Desktop\irtest\node_modules\node-irsdk',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\Users\Nick\Desktop\irtest\node_modules\node-irsdk\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 45, in
npm ERR! sys.exit(gyp.script_main())
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 662, in script_mainnpm ERR! return main(sys.argv[1:])
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 654, in main
npm ERR! return gyp_main(args)
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 621, in gyp_main
npm ERR! [generator, flat_list, targets, data] = Load(
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 142, in Load
npm ERR! result = gyp.input.Load(
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 3009, in Load
npm ERR! LoadTargetBuildFile(
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 400, in LoadTargetBuildFile
npm ERR! build_file_data = LoadOneBuildFile(
npm ERR! File "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 237, in LoadOneBuildFile
npm ERR! build_file_data = eval(build_file_contents, {"builtins": {}}, None)
npm ERR! File "binding.gyp", line 1
npm ERR! \ufeff{
npm ERR! ^
npm ERR! SyntaxError: invalid non-printable character U+FEFF
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Nick\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Nick\Desktop\irtest\node_modules\node-irsdk
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nick\AppData\Local\npm-cache_logs\2022-01-02T01_49_11_284Z-debug-0.log

Thank you for any insight!

An in-range update of jsdoc-to-markdown is breaking the build 🚨

Version 3.0.1 of jsdoc-to-markdown was just published.

Branch Build failing 🚨
Dependency jsdoc-to-markdown
Current Version 3.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

jsdoc-to-markdown is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 5 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[Question] is there a way to get incidents data ?

Hi,

First of all let me thank you for your awesome work, it's brilliant!

I have a question regarding incidents, is there a way to gather the number of incidents for each car?

Regards,

Jean-Philippe.

An in-range update of js-yaml is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚

Find out how to migrate to Snyk at greenkeeper.io


The dependency js-yaml was updated from 3.13.1 to 3.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

js-yaml is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 23 commits.

  • 34e5072 3.14.0 released
  • 7b25c83 Browser files rebuild
  • 6f73473 Dev deps bump
  • 0c29349 Travis-CI: drop old nodejs versions
  • 10be97e fix(loader): Add support for safe/loadAll(input, options)
  • d6983dd Fix issue #526: wrong quote position writing condensed flow (#527)
  • 93fbf7d fix issue 526 (wrong quote position writing condensed flow)
  • e569cc7 readme: update titelift info
  • 8fb2905 changelog format update
  • 33c2236 Verify that there are no null-bytes in input
  • aeb6828 Check the node type for !<?> tag in case user manually specifies it
  • 3e93973 Merge pull request #523 from tmcw/unpkg-jsdelivr-fields
  • b565e1a Add unpkg and jsdelivr fields to point to browser build
  • d9fe622 Merge pull request #521 from vcache/feature/dumper-spec-compilance
  • 667b3a1 dumper: don't quote strings with # without need

There are 23 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of prebuild-install is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚

Find out how to migrate to Snyk at greenkeeper.io


The dependency prebuild-install was updated from 5.3.3 to 5.3.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prebuild-install is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Switching from Practice to Race

I recently discovered that my Electron app starts hanging (doesn't respond anymore) when I switch for Practice to Race in game (it doesn't happend when I close iRacing and click on "Join" in the browser to join the race). I also don't get any error messages, the IRSDK seems to get a hiccup.

Since my software hangs, I have no debug trace or something alike. Its also hard to test because you have to join a Race and risk losing SR/IR if you only join to test that behavior :-/

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.