dwaan / homebridge-adb

Homebridge script to control remote ADB enabled Android device
MIT License
76 stars 15 forks source link

Connection fail log entries #58

Closed jensJeb closed 2 years ago

jensJeb commented 3 years ago

Hey dwaan, great plug-in!

Is your feature request related to a problem? Please describe. Some TVs go into a deep sleep mode and disconnect from wifi some time after turning them off. Homebridge-adb then tries to connect to them anyway every 5 seconds, which is fine and how it's supposed to work. However every failed attempt gets a log entry which completely spams the log file and looks like this:

[15/08/2021, 10:24:35] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:24:42] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:24:47] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:24:52] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:24:57] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:25:02] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect. [15/08/2021, 10:25:07] [HomebridgeADB] Nebula - Device disconnected? Trying to reconnect.

Describe the solution you'd like Stop logging the failed connection attempts after three fails in a row. Unless a user decides to "display more debug messages".

Describe alternatives you've considered Preventing smart TVs from going into deep sleep mode would be an even better approach. However I have no idea if that's possible with adb.

dwaan commented 2 years ago

Newer version dump less log. The suggestion of preventing device to go into deep sleep can’t be done using adb, how ever some android app are able to achieve this by making the device always connected to network.