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

Package Custom Terminal Emulator #40

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
01c78b4
Custom TTY Host init work
brenapp Oct 27, 2024
538451a
Tauri Configuration
brenapp Oct 27, 2024
11dcf1e
Prepare for tauri runtime
brenapp Oct 27, 2024
13e91b7
Deno JSON file
brenapp Oct 27, 2024
bd1c5ad
Fix error reporting
brenapp Oct 27, 2024
07bd6ae
Fix warnings in host
brenapp Oct 27, 2024
5db9b1b
Package scripts
brenapp Oct 27, 2024
6d08feb
Customize icons
brenapp Oct 27, 2024
83e7a6a
Standardize compile targets
brenapp Oct 27, 2024
ac7d4f7
Adjust icon to be a bit bigger
brenapp Oct 27, 2024
eaa24ac
remove secret.template, replace with .env.template
brenapp Oct 27, 2024
c2052f8
Fix imports to be es modules
brenapp Oct 28, 2024
c55596e
Set correct term environment variables
brenapp Oct 30, 2024
74caa59
Properly include env variables into package
brenapp Oct 30, 2024
e52de34
Fix css imports, so we're not relying on node_modules imports
brenapp Oct 30, 2024
004ecd1
Compile script
brenapp Oct 30, 2024
4e61bc9
2.0.0
brenapp Oct 30, 2024
d0f3c58
2.0.1
brenapp Oct 30, 2024
83d4b84
Update set version
brenapp Oct 30, 2024
a303787
Release process
brenapp Oct 30, 2024
c7f7dcb
Fix node version to 22
brenapp Oct 30, 2024
8d20791
Install host dependencies
brenapp Oct 30, 2024
5019752
Add tauri build to branch check
brenapp Oct 30, 2024
ea1b920
don't include github token in build action
brenapp Oct 30, 2024
35d9ff4
Fix cwd for build-host
brenapp Oct 30, 2024
c9dc401
Require switcher build for publish
brenapp Oct 30, 2024
3224bbe
Remove duplicate install deps
brenapp Oct 30, 2024
e8bce5e
Specify project path when host build
brenapp Oct 30, 2024
ff85fc1
Include debug in working directory
brenapp Oct 30, 2024
3eee264
Compile switcher properly
brenapp Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Reporting Server Credentials
LOG_SERVER=https://logs.bren.app
LOG_SERVER_TOKEN=

# Tournament Manager Credentials
TM_CLIENT_ID=
TM_CLIENT_SECRET=
TM_CLIENT_EXPIRES=

# Program version
VERSION=
24 changes: 10 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,30 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: brenapp

---

**Describe the bug**
*A clear and concise description of what the bug is.*
**Describe the bug** _A clear and concise description of what the bug is._

**Expected Behavior**
*What did you expect to happen?*
**Expected Behavior** _What did you expect to happen?_

**Log File**
*Include the contents of your log file here. At the start of each program, TM Switcher includes a link to a log file that captures all executions for the day.*
**Log File** _Include the contents of your log file here. At the start of each
program, TM Switcher includes a link to a log file that captures all executions
for the day._

```

```

**Event Configuration**
*How is your event and TM Switcher set up?*
**Event Configuration** _How is your event and TM Switcher set up?_

**Tournament Manager**

1. Operating System of Host Computer:
2. TM Version:
3. Field Control System:

**TM Switcher**
1. Operating System of Host Computer:
2. TM Switcher Version:


1. Operating System of Host Computer:
2. TM Switcher Version:

****
---
17 changes: 8 additions & 9 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: brenapp

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Is your feature request related to a problem? Please describe.** A clear and
concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe the solution you'd like** A clear and concise description of what you
want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Describe alternatives you've considered** A clear and concise description of
any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
**Additional context** Add any other context or screenshots about the feature
request here.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Runs on all other branches and ensures that the code builds successfully
name: Build

on:
push:
branches-ignore:
- master

jobs:
build-switcher:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: "22.x"
- name: Install Switcher dependencies
run: npm ci
- name: Install Host dependencies
run: npm ci
working-directory: ./host
- name: Build Switcher
run: sh ./scripts/compile_switcher.sh
build-host:
needs: build-switcher
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install Dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- uses: tauri-apps/tauri-action@v0
with:
projectPath: ./host
args: ${{ matrix.args }}
65 changes: 65 additions & 0 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Publishes a Release Candidate when a push to master with a tag is detected

name: Release Candidate
on:
push:
branches:
- master
tags:
- "v*"

jobs:
build-switcher:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: "22.x"
- name: Install Dependencies (switcher)
run: npm install
- name: Build Switcher
run: sh ./scripts/compile_switcher.sh
publish:
needs: build-switcher
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- name: Install Dependencies (host)
working-directory: ./host
run: npm install
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: "TM Switcher v__VERSION__"
releaseBody: "This build was created automatically as a release canddiate."
releaseDraft: true
prerelease: true
projectPath: ./host
args: ${{ matrix.args }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ out
.DS_Store
secret

*.csv
*.csv
.env
.env.old
19 changes: 13 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
As always, contributions are always welcome! To develop, you will need to get access to a set of Third Party Integrations from DWAB.
As always, contributions are always welcome! To develop, you will need to get
access to a set of Third Party Integrations from DWAB.

## Run From Source

Expand All @@ -14,8 +15,9 @@ software installed:
- obs-websocket-js
- vex-tm-client

To run from source, you would need to supply your third-party credentials from DWAB. More
information about obtaining these can be found in the [REC Foundation Knowledge Base](https://kb.roboticseducation.org/hc/en-us/articles/19238156122135)
To run from source, you would need to supply your third-party credentials from
DWAB. More information about obtaining these can be found in the
[REC Foundation Knowledge Base](https://kb.roboticseducation.org/hc/en-us/articles/19238156122135)

1. Clone or download this repository

Expand All @@ -32,7 +34,8 @@ Create the secrets directory from the template
cp -r secret.template secret
```

Edit `secret/vextm.json` to include your client credentials. It should look something like
Edit `secret/vextm.json` to include your client credentials. It should look
something like

```json
{
Expand All @@ -58,6 +61,10 @@ npm run-script run

## Notice

By submitting contributions to this project, you agree to license all contributions under the current project license if merged. The current project license can be obtained at https://github.com/brenapp/tm-switcher/blob/master/LICENSE.
By submitting contributions to this project, you agree to license all
contributions under the current project license if merged. The current project
license can be obtained at
https://github.com/brenapp/tm-switcher/blob/master/LICENSE.

Additionally, you attest that you have the legal right of authorship for the changes you are submitting.
Additionally, you attest that you have the legal right of authorship for the
changes you are submitting.
78 changes: 55 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,77 @@
![TM Switcher](https://user-images.githubusercontent.com/8839926/194345784-558c3ab7-8e0b-4d5d-a789-0ef14376bb56.png)

TM Switcher will automatically manage robotics competition livestreams that use VEX Tournament Manager. It has been used successfully at dozens of events, including the [Kalahari Classic Signature Event](https://www.youtube.com/watch?v=Z_GiBfU6cU8), [Northeast Wisconsin VRC Showdown](https://www.youtube.com/watch?v=p9lWt9ZrTQw), Speedway Signature Event, Haunted Signature Event, and numerous state championships across multiple seasons.
TM Switcher will automatically manage robotics competition livestreams that use
VEX Tournament Manager. It has been used successfully at dozens of events,
including the
[Kalahari Classic Signature Event](https://www.youtube.com/watch?v=Z_GiBfU6cU8),
[Northeast Wisconsin VRC Showdown](https://www.youtube.com/watch?v=p9lWt9ZrTQw),
Speedway Signature Event, Haunted Signature Event, and numerous state
championships across multiple seasons.

This application provides automation to simplify the workload of running a livestream for your event. See below for a list of features!
This application provides automation to simplify the workload of running a
livestream for your event. See below for a list of features!

- Integrates with OBS to automatically change scenes when matches are queued or started
- Integrates with OBS to automatically change scenes when matches are queued or
started

- Capable of controlling an ATEM switcher over the network when matches are queued or started
- Capable of controlling an ATEM switcher over the network when matches are
queued or started

- Record timestamps for when each match starts and its timestamp in the livestream
- Record timestamps for when each match starts and its timestamp in the
livestream

- Create recordings for every match

- Support for events with multiple fieldsets and multiple divisions. This software assumes that _each_ fieldset has its own livestream, so you will need to run an instance of the switcher for every livestream you wish to control.
- Support for events with multiple fieldsets and multiple divisions. This
software assumes that _each_ fieldset has its own livestream, so you will need
to run an instance of the switcher for every livestream you wish to control.

<img width="1124" alt="image" src="https://github.com/brenapp/tm-switcher/assets/8839926/217ed739-fefb-4aa6-b24f-ace06457a8c7">

## Install

Download the most recent build for your OS from [releases](https://github.com/brenapp/tm-switcher/releases/), and run!
Download the most recent build for your OS from
[releases](https://github.com/brenapp/tm-switcher/releases/), and run!

## Running at Events

Some key implementation details to be aware of when deploying this at your event.

- Make sure your LAN allows connections between devices! Typically, as an Event Partner, I will deploy our own router attached to the upstream network for our events. This is strongly recommended if you use tablet scoring or multiple computers in your tournament. Additionally, make sure that connections at the following ports are allowed between devices on your network: `80`, `4455`

- ATEM control over USB is not supported due to a quirk in the control protocol. You will need to ensure that your switcher is connected to the network. Most ATEM switchers assign themselves static IPs (usually 192.168.10.240), so make sure that your router is able to assign that IP. You can use the ATEM Setup utility over USB to connect to your switcher and determine what the network address of the device is.

- DWAB's Third Party API requires that integrations have an internet connection. This means that the
device running the switcher must have access to the internet. Currently, the tokens DWAB issues
have a lifetime of around 2 hours, and TM Switcher requests a new token every hour. This means
that if your device running the switcher loses access to the internet, you have at least an hour
to regain the connection before TM rejects the integration.

- You will need to supply an API Key from Tournament Manager. This can be obtained from `Tools > Options > Web Publishing`.

- When using Audience Display Automation, you likely want to select a relatively neutral scene transition effect, like a fade. Wipes or other lateral motion can interact poorly with how TM Switcher sequences audience display commands and scene changes.
Some key implementation details to be aware of when deploying this at your
event.

- Make sure your LAN allows connections between devices! Typically, as an Event
Partner, I will deploy our own router attached to the upstream network for our
events. This is strongly recommended if you use tablet scoring or multiple
computers in your tournament. Additionally, make sure that connections at the
following ports are allowed between devices on your network: `80`, `4455`

- ATEM control over USB is not supported due to a quirk in the control protocol.
You will need to ensure that your switcher is connected to the network. Most
ATEM switchers assign themselves static IPs (usually 192.168.10.240), so make
sure that your router is able to assign that IP. You can use the ATEM Setup
utility over USB to connect to your switcher and determine what the network
address of the device is.

- DWAB's Third Party API requires that integrations have an internet connection.
This means that the device running the switcher must have access to the
internet. Currently, the tokens DWAB issues have a lifetime of around 2 hours,
and TM Switcher requests a new token every hour. This means that if your
device running the switcher loses access to the internet, you have at least an
hour to regain the connection before TM rejects the integration.

- You will need to supply an API Key from Tournament Manager. This can be
obtained from `Tools > Options > Web Publishing`.

- When using Audience Display Automation, you likely want to select a relatively
neutral scene transition effect, like a fade. Wipes or other lateral motion
can interact poorly with how TM Switcher sequences audience display commands
and scene changes.

If your event has trouble with this tool, please get in touch with me!

## Disclaimer

This software is not officially supported by DWAB, VEX Robotics, or the REC Foundation. Event Partners utilizing TM Switcher are doing so at their own risk. This software is licensed under the MIT License, which permits commercial and non-commercial uses. The author disclaims all liability for running this software at your events.
This software is not officially supported by DWAB, VEX Robotics, or the REC
Foundation. Event Partners utilizing TM Switcher are doing so at their own risk.
This software is licensed under the MIT License, which permits commercial and
non-commercial uses. The author disclaims all liability for running this
software at your events.
26 changes: 26 additions & 0 deletions host/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

src-tauri/binaries
10 changes: 10 additions & 0 deletions host/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tauri + Vanilla TS

This template should help get you started developing with Tauri in vanilla HTML,
CSS and Typescript.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) +
[Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) +
[rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
Loading
Loading