Closed bslatyer closed 2 years ago
I need you to try this first. When your Shield is turned off, open terminal in Config UI X and run this commands:
adb -s deviceip shell "getprop ro.product.model"
Does it output something like SHIELD Android TV
, or error: device 'deviceip' not found
.
Just tried the command: adb -s x.x.x.x:5555 shell "getprop ro.product.model"
and it failed with error: device 'x.x.x.x:5555' not found
I have the same issue exactly with Sharp Android TV, after a while from switching off the TV, that what I get [homebridge-adb] Sharp - Device disconnected? Trying to reconnect. WOL and WOW are on in TV settings, while the Android TV is connected via Ethernet, I checked my router and the TV is connected to the network, but somehow it got disconnected from the plugin. I added the following to startup script:
apt-get update
apt-get install -y android-tools-adb android-tools-fastboot
adb connect xxx.xxx.x.xxx,
it helps when I restart the container, but does not help reconnecting back the plugin to the TV.
I run adb -s deviceip shell "getprop ro.product.model" and I got error: device 'x.x.x.x:5555' not found. It only reconnect after switching on the TV.
Thank you for the report. Seems like the ADB connection to the device got disconnected completely after the device is OFF, and later on after the device is ON when the plug-ins is trying to established ADB connection to the device, it got rejected.
I have a possible work around, but to make sure can someone help me to debug this step below:
Thank you Sir for your reply. In fact once the device is turned on, it reconnect directly by itself, and it take a while around 20 minutes after device is switched off to disconnect from device, and that is the mystery for me, as wow and wol are on, also the device is still connected to the router, thus I don't know why it disconnect from the adb plugin in Homebridge. Of course once the device is on all the other command run ‘adb -s deviceip shell "getprop ro.product.model"’ and ‘adb connect ipaddress’ works perfectly.
Hi @dwaan, I had a similar workaround to your one that I'm currently using. It seems to work fine as long as I don't close the application or reboot the host system.
Is this going to be fixed in a future update?
I did an update to the plugins yesterday. I think one of the main problem is that the plugins doesn't have timeout when running ADB command. In most case it will result in very slow error output (in some case will took few minutes) when the device is disconnected (turned off). Since the ADB commands are running in serial, once one command failed to execute which usually took minutes to fail, the rest need to wait until it finish. I updated the plugins so that every ADB command will have a timeout (1 second by default).
Since the plugins won't be able to turn on the device with ADB command once the device is turned off, as suggested, I added WOL feature. Once the device is turned on by WOL, the plugins will then hopefully be able to connect using ADB. With that I hope it can resolve this issue.
Hi dwaan, I solved the problem by sideloading wakelock v3 to ensure that the device won't disconnect from the LAN. I went back to adb plugin version 1.4.12, which now is working fine and more stable. Plugins starting from version 1.5 have one common problem which is the playback sensor whenever I set to none and restart the container or the homebridge, it will auto go back to yes. As for the latest version 1.5.3 wol is working fine but with one problem which is once it on the device, the device will then auto shut off, and have to on it three times exactly for the device to remain on, and that will happen again with every restart to the container or the homebridge. As if the adb connection will stabilize after three times turning on the device. Also the opposite will happen if I on the device manually, then off it from homebridge, it will take three times to off the device to remain off. BTW adb connect command works fine after each restart. Thank you for all your efforts.
Describe the bug The Homebridge-ADB plugin does not want to connect to the device at all and has to be manually connected by me every time.
Expected behavior The Homebridge-ADB plugin is meant to connect to the device via ADB without having to manually connect it myself
Log output
[17/02/2022, 10:22:59] [HomebridgeADB] Nvidia Shield - Device disconnected? Trying to reconnect.
Device (please complete the following information):
Additional context
Ubuntu 20.04.3 LTS
Homebridge v1.4.0
Android Debug Bridge version 1.0.41 (Version 32.0.0-8006631)