Skip to main content

Running Data Viewer Log Server on Windows

Background

On (one of) the co-processor(s) on the robot we run a log recorder/server. This server is contained in the robot code, typically called CoProcessorMain and is deployed using ./gradlew raspiDeploy.

As the robot code runs, data is streamed to the recorder using UDP and logged to binary files on the co-processor. When the robot comes back from a match, we can then open the web interface on the co-processor (10.1.76.19:8001 in 2024) to view historical logs. This guide will tell you how to run the log server locally on your Windows machine so that you can store/view robot logs without needing to be connected to the robot.

Software pre-requisites

  1. Node.js (v22.1.0 at time of writing)
  2. Eclipse Temurin (17 LTS at time of writing)
  3. Intellij (optional, but is used to run CoProcessorMain in the robot code)
  4. Yarn (npm install -g yarn)
    1. Allow yarn to be run: Start Menu > Powershell, Right click > “Run as Administrator”. Then run the following command:
Set-ExecutionPolicy -ExecutionPolicy Bypass

Setup

Clone repositories

  1. Aces-Web-Data-Viewer
  2. 2024-Robot-Code

Run the frontend

In Aces-Web-Data-Viewer:

yarn install
yarn start

This will take a minute - your web browser should open and show the data viewer. If not, navigate manually to localhost:3000.

Run the log server

  1. In IntelliJ, open 2024-Robot-Code.
  2. Open java/org/aceshigh176/frc2024/coprocessor/CoProcessorMain.java.
  3. Change the logsBaseDir string to a valid directory in Windows
final String logsBaseDir = "C:/nvme/frc/robotLogs/";
  1. Copy the logs from the co-processor into C:\nvme\frc\robotLogs
  2. Run CoProcessorMain

Connecting

On the data viewer (localhost:3000), enter the "historical" view. For Cloud Server IP/Host, enter "localhost:8001"

At this point, you should see logs on the left side. If you don't, check the network logs and the logs for CoProcessorMain to see what's going on.

Fetching new logs from the co-processor

  1. On the co-processor's data viewer ui (http://10.1.76.19:8001 in 2024), navigate to the "historical" view.
  2. On the left side, determine what recording you want to fetch, and hover over the "info" icon. It will give you a UUID.
  3. In a powershell window, execute the following:
# Navigate to logs directory
cd C:\nvme\frc\robotLogs

# Fetch the logs from the co-processor - swap out the UUID prefix to the one you got in the previous step
scp "[email protected]:/nvme/frc/robotLogs/930e4f0b-1c8c*" .