ftctechnh / ftc_app

FTC Android Studio project to create FTC Robot Controller app.
761 stars 3.16k forks source link

Peer disconnected in the middle of running an OpMode (Auto or TeleOps) #645

Open technova12611 opened 6 years ago

technova12611 commented 6 years ago

We got this error a few times, it happened in Autonomous and TeleOps. All the sudden, the connection was lost. Restart robot seems still working. The following is from the Driver Station logcat.

11-18 18:28:14.398 14684 14775 V Robocol : {10837367 51.765} issuing peerDisconnected(): lastRecvPacket=2.037 s
11-18 18:28:14.399 14684 14775 E RobotCore: {10837367 51.766} java.lang.Throwable: Peer disconnected
11-18 18:28:14.400 14684 14775 E RobotCore: {10837367 51.767}   at com.qualcomm.ftcdriverstation.FtcDriverStationActivity.peerDisconnected(FtcDriverStationActivity.java:1187)
11-18 18:28:14.401 14684 14775 E RobotCore: {10837367 51.768}   at org.firstinspires.ftc.robotcore.internal.network.SendOnceRunnable.run(SendOnceRunnable.java:132)
11-18 18:28:14.402 14684 14775 E RobotCore: {10837367 51.768}   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
11-18 18:28:14.402 14684 14775 E RobotCore: {10837367 51.769}   at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:278)
11-18 18:28:14.403 14684 14775 E RobotCore: {10837367 51.770}   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:273)
11-18 18:28:14.404 14684 14775 E RobotCore: {10837367 51.770}   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
11-18 18:28:14.404 14684 14775 E RobotCore: {10837367 51.771}   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
11-18 18:28:14.405 14684 14775 E RobotCore: {10837367 51.772}   at java.lang.Thread.run(Thread.java:761)
11-18 18:28:14.405 14684 14775 V DriverStation: {10837367 51.772} robot controller disconnected
11-18 18:28:14.405 14684 14775 V DriverStation: {10837367 51.772} Assuming client disconnected

Robot controller side of logcat is below. Our RC and DS phone time are probably not synced up.

11-18 18:26:33.289 24669 24738 V Robocol : issuing peerDisconnected(): lastRecvPacket=2.003 s
11-18 18:26:33.289 24669 24738 V UpdateUI: Network: active, disconnected
11-18 18:26:33.290 24669 24738 I RobotCore: ******************** STOP - OPMODE /storage/emulated/0/FIRST/matchlogs/Match-0-Rover_Ruckus_Crater.txt ********************
11-18 18:26:33.294 24669 24738 I RobotCore: Lost connection while running op mode: Rover Ruckus Crater
gearsincorg commented 6 years ago

Need more info:

What Phone / Android OS are you using for RC and DS. What version of the FTC-SDK are you using? 4.X?

Are you doing any other phone wireless activities? eg: Debugging, WEB connect, WiFi connect?

Thanks.

technova12611 commented 6 years ago

Both of our RC and DS phones are Moto E4. I believe they are on Android SDK 26. We are using the latest FTC SDK 4.3. While this happened, we were on wireless ADB connect. Also, those two phones were connected on a 5ghz channel.

gearsincorg commented 6 years ago

There are reports of issues with the E4. One symptom is that the phones may disconnect if there is not telemetry traffic being displayed on the DS.

You may want to try adding one small telemetry message that repeats during init and play.