dwaan / homebridge-adb

Homebridge script to control remote ADB enabled Android device
MIT License
75 stars 14 forks source link

ADB reconnect at interval #17

Closed Clickbaitcake closed 3 years ago

Clickbaitcake commented 3 years ago

I am running this wonderful integration to control my Nvidia Shield. The issue is, if the Shield restarts the ADB control no longer works until I run the abd connect 191.168.2 command from the terminal on my Homebridge.

I think this is a security feature of the Shield.

Could functionality be added that checks for connectivity to the target android device by running adb devices and then runing the adb connect command if its not in the list?

adb devices gives the following info:

pi@homebridge:/var/lib/homebridge $ adb devices
List of devices attached
192.168.0.2:5555       device
dwaan commented 3 years ago

The script actually have “adb connect” in the beginning of each connection. As, I tested this script with my Nvidia shield also. Still trying to figure out what’s the best way to avoid this connection problem.

Clickbaitcake commented 3 years ago

Okay thanks, it seems like the issue happens when the Shield is turned off, it looses connection. I think we could check the list of devices and run connect command if not connected adb devices is the command for this.

Can the Pi run adb devices at intervals and then run a adb connect if there are no attached devices?

dwaan commented 3 years ago

Please check the new version. The plugins now will try to do adb connect when home app request it's status, so hopefully it will fix this kind of problem.