Automated Log Uploader
Manually retrieving USB drives from the RoboRIO is tedious. MARSLib introduces the LogUploader, an asynchronous daemon thread that quietly runs in the background. If it detects a tethered internet connection, it automatically pushes all new AdvantageKit .wpilog files directly to your team's GitHub repository!
1. Dedicated Log Repository
Do not upload logs directly into your main robot code repository! Telemetry logs are massive binary files and will quickly bloat your Git history. Create a brand new, empty repository solely for telemetry.
2. Configuration
To point the uploader toward your team's new repository, you must modify the static configuration fields inside LogUploader.java.
// Inside com/marslib/util/LogUploader.javapublic final class LogUploader {private static final String GITHUB_OWNER = "YourTeamOrganization";private static final String GITHUB_REPO = "Your-Log-Repo";private static final int COOLDOWN_SECONDS = 10;}3. Personal Access Token
The RoboRIO needs permission to upload directly to your team's GitHub organization.
- Navigate to: Settings → Developer Settings → Personal Access Tokens.
- Generate a new token with Read & Write access to Contents.
- Copy the exact token string (it will start with
github_pat_).
Robot Security
Never hardcode your PAT into Java! The LogUploader explicitly reads the token from a local text file that is ignored by Git.
4. Deploying the PAT
You must place your token inside the RoboRIO's deploy directory. Create a new file locally in your project:
src/main/deploy/github_pat.txtPaste the github_pat_... string directly into this file. The next time you deploy, the LogUploader will find it there automatically!
5. Execution
The system is completely automatic. It checks the DriverStation.isFMSAttached() flag to ensure it never uploads during real matches. During practice, whenever the robot is disabled and tethered, it will quietly push the logs to GitHub!
📖 Further Reading & External Resources
- FRC Log Replay and Simulation - Mechanical Advantage's definitive 2024 Championship presentation on the why behind the IO-Layer abstraction.
- AdvantageKit Architecture - The core repository governing deterministic replay loops on the RIO.
- AdvantageScope Documentation - Visualizing 3D logs natively in real-time.