wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.05k stars 612 forks source link

Add Upload Support for Persistent Tables #6959

Open scarmain opened 1 month ago

scarmain commented 1 month ago

Is your feature request related to a problem? Please describe. If a team needs to upload the NT preference tables, there is no easy way to do this. Our team had the NT persistent table drop twice during the season (once in January, once before a match at a district. Thankfully, I downloaded a copy of the preferences, typed in the important values, and we were ok in the match). This would also be needed if a team needs to swap Rios.

Describe the solution you'd like Currently there is a webserver where you can download the current preferences table (http://10.28.32.2:5810/nt/persistent.json). Could this webserver be expanded to have a basic homepage (with just the download and upload link), and a POST handler to allow a new file to be uploaded? Then, after upload, you probably have to reset NT to process the values.

Describe alternatives you've considered The current recommended way to do this is to SSH into the rio, SCP out the networktables.json file, then SCP it into another Rio where needed. This does NOT work when on the competition field in case your table drops, the SSH port is blocked, so there is no way to recover before a match.

Additional context We had the table drop once in '22 also, but I thought it was part of a Rio swap. We had issues trying to recover it, as the table was missing, so entries couldn't load, and the code constantly crashed, so you couldn't get into NT enough to put in new values... I haven't seen that recently. We never had issues with preferences in '23.

I think the issues this season were 2 dashboards connected to the Rio at the same time with preference editing enabled, and the dashboards get confused on value propagation and reset the value back to the default. We never seriously investigated this, as it only happened to be an issue twice, once in Jan, once at end of March, and we have done tons of practice and offseasons since (going to our third offseason this weekend).

PeterJohnson commented 1 month ago

Depends on #4719.