6. Deploying Configuration Files onto the Control Hub. - CenterStage-23-24/CenterStage GitHub Wiki
Okay so now you are ready to deploy the configuration files onto the Control Hub to test your first programs, but the thing is that you need to configure the robot's hardware. There are two ways to do it.
- Manually go into the Driver Station and write the configs. (Normally the easier way at first, but it becomes tedious after a couple of times.)
- Go into Android Studio and create an XML file containing all your configs. (Normally harder to create, but it becomes really easy to maintain.)
On this page, we will figure out how to deploy the configs onto the Control Hub using the second method, and again there are two ways to do this method.
- Create the first config file on the Driver Station App and then update the configs in Android Studio
- Create the first config file directly in Android Studio, and upload it from there
First, you need to create a new config file inside the Driver Station App
Second, you need to go to the REV Hardware Client, and go into the Control Hub and then go into the Backup section and there would be an option to take a backup, and then you have the download that backup

Third, a zipped folder would've been downloaded under this path(C:\Users\user\AppData\Roaming\REV Hardware Client\plugins\RevHub\backups\Control Hub Name), so now you will need to extract the folder, and inside that folder you will find a XML file
The user and control hub names are the things that might be different

Main.xml is the config file and now the configs are saved
In between these 2 steps, you can update the XML file inside Android Studio by using the template found below:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<Robot type="FirstInspires-FTC">
<LynxUsbDevice name="Control Hub Portal" serialNumber="(embedded)" parentModuleAddress="173">
<LynxModule name="Expansion Hub" port="2">
<!--The attribute "name" should be changed to the name of the motor in the code-->
<goBILDA5202SeriesMotor name="EM0" port="0" />
<goBILDA5202SeriesMotor name="EM1" port="2" />
<goBILDA5202SeriesMotor name="EM2" port="3" />
<Servo name="ES0" port="0" />
<Servo name="ES1" port="2" />
<Servo name="ES2" port="4" />
<Servo name="ES3" port="5" />
<AnalogInput name="EAI1" port="0" />
<AnalogInput name="EAI2" port="2" />
<RevColorSensorV3 name="ECS1" port="0" bus="1" />
<RevColorSensorV3 name="ECS2" port="0" bus="2" />
</LynxModule>
<LynxModule name="Control Hub" port="173">
<!--The attribute "name" should be changed to the name of the motor in the code-->
<goBILDA5202SeriesMotor name="CM0" port="0" />
<goBILDA5202SeriesMotor name="CM1" port="1" />
<goBILDA5202SeriesMotor name="CM2" port="2" />
<goBILDA5202SeriesMotor name="CM3" port="3" />
<Servo name="CS0" port="0" />
<Servo name="CS1" port="1" />
<Servo name="CS2" port="2" />
<LynxEmbeddedIMU name="imu" port="0" bus="0" />
<REV_VL53L0X_RANGE_SENSOR name="CDS1" port="0" bus="1" />
<REV_VL53L0X_RANGE_SENSOR name="CDS2" port="0" bus="2" />
</LynxModule>
</LynxUsbDevice>
<Webcam name="Webcam 1" serialNumber="B1A51920" />
<!-- The serial number here will be different. To figure this out you need to go to the Driver Station app-->
</Robot>
Fourth, you will need to connect to the Control Hub with a USB-A to USB-C cable, and then you will see a Control Hub popup in File Explorer and you will need to open the Control Hub Folder. After that, you need to go into the FIRST folder and this is where you will drag and drop the XML file.

And that is it, you are done with uploading the files
First, you need to go into the Rev Hardware Client and connect to the driver station
First you need to go into Android Studio and create a new XML file.
Second, use the template below to fill the configs you have for your robot.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<Robot type="FirstInspires-FTC">
<LynxUsbDevice name="Control Hub Portal" serialNumber="(embedded)" parentModuleAddress="173">
<LynxModule name="Expansion Hub" port="2">
<!--The attribute "name" should be changed to the name of the motor in the code-->
<goBILDA5202SeriesMotor name="EM0" port="0" />
<goBILDA5202SeriesMotor name="EM1" port="2" />
<goBILDA5202SeriesMotor name="EM2" port="3" />
<Servo name="ES0" port="0" />
<Servo name="ES1" port="2" />
<Servo name="ES2" port="4" />
<Servo name="ES3" port="5" />
<AnalogInput name="EAI1" port="0" />
<AnalogInput name="EAI2" port="2" />
<RevColorSensorV3 name="ECS1" port="0" bus="1" />
<RevColorSensorV3 name="ECS2" port="0" bus="2" />
</LynxModule>
<LynxModule name="Control Hub" port="173">
<!--The attribute "name" should be changed to the name of the motor in the code-->
<goBILDA5202SeriesMotor name="CM0" port="0" />
<goBILDA5202SeriesMotor name="CM1" port="1" />
<goBILDA5202SeriesMotor name="CM2" port="2" />
<goBILDA5202SeriesMotor name="CM3" port="3" />
<Servo name="CS0" port="0" />
<Servo name="CS1" port="1" />
<Servo name="CS2" port="2" />
<LynxEmbeddedIMU name="imu" port="0" bus="0" />
<REV_VL53L0X_RANGE_SENSOR name="CDS1" port="0" bus="1" />
<REV_VL53L0X_RANGE_SENSOR name="CDS2" port="0" bus="2" />
</LynxModule>
</LynxUsbDevice>
<Webcam name="Webcam 1" serialNumber="B1A51920" />
<!-- The serial number here will be different. To figure this out you need to go to the Driver Station app-->
</Robot>
Third, you need to connect the control hub to your computer directly using a USB-A to USB-C cable, and then go into the folder that pops up. After that, you need to go into the FIRST folder and this is where you will drag and drop the XML file.
