/crewtimer-fl-connect

Connector for FinishLynx to capture time events which are published to CrewTimer

Primary LanguageTypeScriptMIT LicenseMIT

CrewTimer FinishLynx Connect

CrewTimer FinishLynx Connect is built using Electron, and specificlly the Electron React Boilerplate Project.

See the VSCode plugins suggested here.

Installation and Configuration tweaks

MacOS can build for all targets - mac, win, linux

To build native libs (sqlite3) a recent version of npm is needed.

These versions are known to work together:

node 14.17.0 npm 6.14.13 node-gyp 9.1.0

  • Run nvm ls-remote --lts and pick a version. e.g. 15.11.0
  • Install nvm install 15.11.0
  • Use it nvm use 15.11.0
  • Make it default nvm alias default v15.11.0
  • Update node-gyp npm i -g node-gyp@latest". Required to build sqlite3.
  • Some report needing this: npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
  • Add sqlite3 to release/app/package.json instead of top level. cd release/app && npm i --save sqlite3
  • For firebase, edit webpack.config.renderer.dev.dll.ts and modify renderer field entry: { renderer: Object.keys(dependencies || {}).filter((it) => it !== 'firebase'), }, . See stackoverflow for issue it resolves.
  • In resolve: section of , add fallback: { path: require.resolve('path-browserify'), }, to make path available from the renderer.

Update Node 18 fails when building native support. Node 16 is currently working and has several workarounds in place:

  1. Added an explicity dependency forcing of "isbinaryfile": "4.0.8" in resolutions section of package.json.
  2. Manually create src/node_modules symbolic link to release/app/node_modules in postinstall script. This should be done as one of the build automation steps but for some reason is not.

Building from scratch

node 16 is known to work. node 18 may be problematic. Try one or the other if issues.

# Verify using npm 16.  18 does not work
npm --version
# Clone the repo
git clone git@github.com:crewtimer/crewtimer-fl-connect.git
# Build
cd crewtimer-fl-connect
yarn install
# Run
yarn start

To create a notarized macos build, create a .env file with the following contents. Do not commit this file to the repo

APPLE_ID=glenne@engel.org
APPLE_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx
TEAM_ID=P<snip>4

If the build fails with a node-gyp error, be sure node-gyp is installed globally.

If the run fails with 'cannot locate sqlite', remove the src/node_modules symbolic link and yarn install again.

Debugging

Starting from VSCode seems broke. Try this command line

yarn "start:main" "--inspect=5858" "--remote-debugging-port=9223"

Open dev window with releases code:

yarn cross-env DEBUG_PROD=true yarn package

See also the Electron React Boilerplate page.

File Locations

Windows

  • CrewTimer.db No longer correct: C:\Users\glenne\AppData\Local\Programs\crewtimer-fl-connector\CrewTimer.db
  • Images and assets C:\Users\glenne\AppData\Local\Programs\crewtimer-fl-connector\resources\assets
  • config.json C:\Users\glenne\AppData\Roaming\CrewTimer FinishLynx Connector\config.json

MacOS

  • CrewTimer.db '/Users/glenne/Library/Application Support/Electron/CrewTimer.db'

Debugging with Parallels and MacOS

FL connects via TCP/IP to the CrewTimer FL Connect app. When running with parallels the scoreboard must be provided with the IP address where CrewTimer FL Connect is running.

  1. Find the macOS IP Address for the Parallels container. Issue ifconfig and look for the IP address associated with the vnic1 interface. E.g. 10.37.129.2. This will be used within FinishLynx.
  2. Run FinishLynx within Parallels and configure a scoreboard with the IP address found in the prior step.
  3. Run CrewTimer FL Connect on macOS: npm start

Using Manual Start on FL

  1. Go to File|Options|General and set the Hardware Type = None.
  2. Set Camera Settings -> Input -> Wired Sensor = Open if not using a start sensor.
  3. Go to LapTime options and click New.
  4. Restart FL

Releasing new versions

  1. Edit release/app/package.json and src/renderer/Nav.tsx and adjust version info
  2. Execute npm run winbuild
  3. Look in release/ for the exe file
  4. Copy the exe to the 'CrewTimer Installers' google drive folder.
  5. Make a copy of the installer and rename it without a version: CrewTimerConnect Setup.exe.

Tips