It seems like there are issues calling hub = hardwareMap.get(ExpansionHubEx.class, "Expansion Hub 2"); when things aren't "ready". Specifically we receive errors that the device is missing.
OpModeType: LinearOpMode
When call is made: top of runOpMode()
SDK: 5.2
RevExtensions2: 1.2
Scenario1
If we have just deployed code and we connect the hardware back.
Scenario2
Something causes the Robot Controller to reboot.
Scenario3
You disconnect the USB and connect it again.
Resolution
To fix these issues we terminate the Robot Controller app, disconnect the USB, restart the robot hardware. Start the Robot Controller app and wait for it to be completely up (error showing missing hardware), turn on the robot hardware, connect the USB.
Potential Fix
We noticed that in SDK 5.3 there are some fixes to for the external USB Web Cam. Perhaps if we upgrade to the newer version of the SDK it will resolve this?
We also saw references to calling RevExtensions2 init(), but they suggest that you no longer need to do this.