As we’ve been working with the new FTC Android technology and speaking with other teams, we have been learning some tips and tricks to keep everything running smoothly. Many times it doesn’t work because we are limited by the technology, but hopefully we can pass on some of what we have learned to help other teams.
In this post we’ll talk about App Versioning.
Problem: The Driver Station phone connects to the Robot Controller fine. They are able to communicate, but when an OpMode is started, the Robot Controller just says it is running StopRobot. No matter what is done, none of the OpModes work.
Solution: Make sure the Driver Station app on the driver station phone matches the Robot Controller version compiled with any custom OpModes.
Details: A few weeks ago, our team could not get our custom OpMode to run no matter what we did. We were able to see our custom OpMode in the OpMode list on the Driver Station, but when we selected it and tried to run it, the Robot Controller always said it was running the StopRobot OpMode. We discovered that we had updated the Robot Controller code through GitHub and compiled our custom OpMode with this new code, but did not download the new Driver Station app from the Google Play store. Once we updated the Driver Station app, our custom OpMode was able to run successfully.
Note that the opposite could also cause the same issue. If the latest Driver Station app is downloaded from the Google Play store, but the Robot Controller code is not updated from GitHub, the OpModes will not run. If you found that the Driver Station app was accidentally updated, but you aren’t comfortable updating the Robot Controller code (or can’t because you are at a competition and don’t have wifi), it is possible to downgrade your Driver Station app because the matching Driver Station app is included in the GitHub code.
To downgrade the Driver Station app, follow these instructions:
- Delete the current Driver Station app from the phone by long-pressing on the app and tapping the red X that appears on the upper right corner of the icon. Tap “Ok” when prompted for a confirmation.
- Plug the Driver Station phone into the computer.
- Find the Driver Station app in the Robot Controller code downloaded from GitHub. In the version tagged ‘15.11.04.001’, it is found in the ‘doc/apk‘ folder and is named ‘FtcDriverStation-release.apk‘. Note the location of this file and save it.
- Open a command window. On Windows you can do this by doing a search for an application and typing ‘cmd’. A black window should appear with a prompt for you to type a command. On a Mac, open the Terminal app found in Applications/Utilities.
- Changed directories to the location of the Driver Station app you saved in step 3 above by typing ‘cd <your-ftc-app-directory>/doc/apk‘. Note that you will want to replace ‘<your-ftc-app-directory>‘ with the location of your code.
- Type in the command ‘adb install FtcDriverStation-release.apk‘. You should see the computer respond with a few lines reporting the status of the install and end with ‘Success’.
After completing these steps, you should have the right Driver Station app corresponding to your custom OpMode code and be able to run your OpMode successfully.
Note that some Android phones automatically update apps when connected to wifi. This should be turned off for all FTC phones to make sure the Driver Station app and Robot Controller apps are not updated without your knowledge so as to not lose valuable time trying to figure out why your OpMode won’t run.