Making an SD Card Backup at a Competition
When the robot's code is modified during a competition, we back up the new code on an SD card.
Reimaging the Card
This should happen before the start of qualifying matches and before the start of playoff matches.
On a Tators laptop:
- Use balenaEtcher to re-image the SD card. To find the SD card image on Windows:
- Right click on the "roboRIO Imaging Tool" icon and select "Open file location" from the pop-up menu.
- Browse to the "FRC Images" > "SD Images" directory in the same location as the "roboRIO_ImagingTool" application.
- Use roboRIO Team Number Setter to set our team number (
2122) on the SD card. See https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/roborio-team-number-setter/index.html
Updating Code on an SD Card
This should happen every time a commit is made to the event branch for that day.
On a mobile phone:
- Make sure the hotspot is enabled and allows external devices to join.
On a Tators laptop:
- Join the hotspot.
- Open a terminal window.
git checkout [branch that has code changes]git pull- Leave the terminal window open. You will use it again below.
Back on the mobile phone:
- You may disable the hotspot.
With roboRIO device:
- Make sure the roboRIO is unplugged from its power source.
- Connect a USB cable between Tators laptop and roboRIO.
- Insert an imaged SD card.
- Plug the roboRIO back into its power source.
- To check if the USB connection is working,
ping 172.22.11.2. The response should show packets being transmitted rather than a request timeout.
On the laptop:
- In Visual Studio Code, deploy the robot code by choosing the "WPILib:Deploy robot code" menu item (Ctrl+Shift+P) or clicking the WPILib icon in the top, right corner.
- Watch the progress of the deployment in the driver’s station dashboard.
- When deployment is done, unplug the roboRIO from its power source.
- Remove the SD card.
- In the terminal window,
git log --max-count 1(shows the current commit hash, after the word "commit" on the first line of output)
With SD card:
- With a small piece of tape and a Sharpie, label the card with the first 4 characters of the commit hash of the code changes and the date/time the backup was made.