To use lap times measured with TinyViewPlus in FPVTrackside

# 0. Introduction

This document explains the integration of TinyViewPlus with RotorHazard. If everything works as expected, connecting FPVTrackside should be straightforward since it only requires linking with RotorHazard.

While the practical operation of this setup is still uncertain, I hope you find this experiment useful.

# 1. TinyViewPlus

TinyViewPlus is a software that measures lap times by recognizing **arUco markers** placed on the track. It is available under the MIT license and runs on both Windows and Mac, making it widely used in indoor **Whoop racing** events in Japan.

For single races, it offers all the necessary features, but for large-scale events, it may lack some functionalities. Therefore, TinyViewPlus supports **OSC (Open Sound Control)**, allowing it to send and receive information such as pilot names and lap times with other race management software.

When organizing major races, event hosts often develop custom race management software tailored to their unique race formats.

# 2. FPVTrackside

FPVTrackside functions more as **race management software** rather than a timing system. It integrates with various timing systems, including **ImmersionRC LAP RF, RotorHazard, and Chorus**. (It does not directly connect with TinyViewPlus, which is the primary goal of this integration.) Some notable features of FPVTrackside include:

- **Support for various race formats** – It has evolved by incorporating numerous user-requested features.
- **Pilot registration and race heat management** – Unlike TinyViewPlus, which only handles individual races, FPVTrackside enables **full-scale event management**, including qualifying rounds and finals.
- **Video recording capabilities** – This allows monitoring **VTX feeds** of each pilot during the race and reviewing footage afterward for verification.
- **Lap-time correction during playback** – This enables adjustments while reviewing recorded footage post-race.
- **UI customization** – Users can modify FPVTrackside themes to create a personalized interface.
- **WebSocket integration with OBS** – Allows streaming and overlay functionality.

However, for users accustomed to TinyViewPlus, there are some challenges:

- **US keyboard layout** – Some special characters may be entered incorrectly.
- **Japanese input issues** – Text needs to be entered in an external editor and pasted into FPVTrackside.
- **Limited customization of audio output**
- **Unclear race-start settings** – The **“3, 2, 1 START!”** configuration can be difficult to adjust.

# 3. Main Objective

If you want to manage races using FPVTrackside, you must use **IRC LAP RF or RotorHazard** as the timing system. These systems rely on **RSSI values** from **VTX signals** to detect gate passage.

However, the goal is to keep using **arUco markers for lap measurement** while taking advantage of FPVTrackside.

Thus, the proposed solution is to **remove the RX5808 module from RotorHazard** and instead **inject a simulated RSSI signal** where RX5808 typically outputs RSSI.

### Advantages of this method:
- The simulated **RSSI signal** (approximately **0–1.1V**) is simple to generate, meaning updates or specification changes in **FPVTrackside or RotorHazard** will not affect the setup.

### Drawbacks:
- This method **introduces some inefficiencies** in both software and hardware.

# 4. Expected Outcome

Once implemented, the system will simulate receiving **a single video feed** through **three different receivers**, making it appear as though three pilots are racing.

Ideally, all three feeds should produce identical lap times, but in reality, minor discrepancies occur due to variations in **image flickering and brightness**.

Here's a demonstration video showcasing the concept:

[![Demo Video](https://img.youtube.com/vi/jeTHzHxP-_c/0.jpg)](https://www.youtube.com/watch?v=jeTHzHxP-_c)

# 5. Required Components

1. **First Windows PC** (Runs TinyViewPlus & RotorHazard)
2. **Second Windows PC** (Runs FPVTrackside)
3. **VTX receivers** (UVC-compatible; Three units needed for a three-pilot race, e.g., **Eachine ROTG, SKYDROID, FUAV**)
4. **HDMI to UVC Converter** (Captures video output from the first PC for use in FPVTrackside)  
   [Amazon Link](https://www.amazon.co.jp/gp/product/B0963JG2X3?ie=UTF8&th=1&linkCode=sl1&tag=nslab-22&linkId=ab0ddbc748184e92141f7365f692d793&language=ja_JP&ref_=as_li_ss_tl)
5. **Custom Circuit Board**  
   - [Circuit Diagram](https://github.com/zubon2003/TinyViewPlusAsSensors/blob/main/pcb/TVPAS.pdf)
   - [JLCPCB Manufacturing Files](https://github.com/zubon2003/TinyViewPlusAsSensors/tree/main/pcb)  
     *Currently being ordered—updates will follow after validation.*

### Required Components:
- **2KΩ resistors** (24 units, 2.2KΩ may be used as an alternative)
- **1KΩ resistors** (17 units)
- **10KΩ resistors** (7 units)
- **Arduino Nano** (Preferably **ATmega328P-based** standard Nano)  
  [Firmware](https://github.com/zubon2003/TinyViewPlusAsSensors/tree/main/Arduino/tvpas)
- **STM32C8T6-based Bluepill + STLINKV2** (**C6T6 version lacks sufficient memory**)  
  [Firmware](https://github.com/RotorHazard/RotorHazard/tree/main/firmware)  
  [STM32CubeProgrammer](https://www.st.com/ja/development-tools/stm32cubeprog.html)
- **Pin headers/sockets** (For easy module replacement)
- **USB-to-serial converter**  
  [Adafruit CP2102N Friend](https://www.marutsu.co.jp/pc/i/2844423/) is recommended, but alternatives like [Pololu](https://www.switch-science.com/products/6841) and [SwitchScience](https://www.switch-science.com/products/2782) might also work.
- **2N7000 (N-channel MOSFET)**

### Final assembly example:
![IMG_8227.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/4072330/88a4d5ed-2974-4033-9223-c43c70349ffd.jpeg)

# 6. Software Installation (TinyViewPlus As Sensors / TVPAS)

1. Download **TinyViewPlusAsSensors.zip** from [here](https://github.com/zubon2003/TinyViewPlusAsSensors/releases/tag/TinyViewPlusAsSensores) and extract it.
2. Run `TinyViewPlusAsSensors.exe` from the `bin` folder.
3. If execution fails, install [Microsoft Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe) and retry.
4. Check the **COM port** for **Arduino Nano** and update `settings.xml` in the `data` folder.

---

This version is formatted in Markdown for easy readability and compatibility. Let me know if you need any adjustments!