Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install in Homebridge official docker container? #104

Open
SawkeeReemo opened this issue Jan 29, 2024 · 16 comments
Open

How to install in Homebridge official docker container? #104

SawkeeReemo opened this issue Jan 29, 2024 · 16 comments
Labels
good first issue Good for newcomers

Comments

@SawkeeReemo
Copy link

SawkeeReemo commented Jan 29, 2024

I followed the instructions here, but I can't get this to work in the official Homebridge container. I was able to install this in the non-official homebridge container, but I want to stay on the official version. Anyone know how to do this?

Specifically trying to control an NVIDIA Shield Pro 2019.

@SawkeeReemo SawkeeReemo added the bug Something isn't working label Jan 29, 2024
@dwaan
Copy link
Owner

dwaan commented Jan 29, 2024

Can you give further explanation on which steps you’ve done? Or on which steps you unable to process, log output, or any other information. I can’t help without any further explanation.

I’ve been using HomeBridge official container as my main server, and everything works fine.

FYI, this is not a bug, more suitable for good first issue or help wanted label.

@dwaan dwaan added good first issue Good for newcomers and removed bug Something isn't working labels Feb 5, 2024
@SawkeeReemo
Copy link
Author

SawkeeReemo commented Mar 7, 2024

Sorry for the lag in response, been insane over here for a few months. I just built a new Linux server running Ubuntu LTS 22.04 on a Beelink EQ12. But I moved my Homebridge docker container config folder over to it from my NAS. Then I pulled the official Homebridge image using the same docker compose file. Everything else works perfectly, but I still cannot get ADB to work for my NVIDIA Shield Pro.

I followed all of the instructions here, my Shield is in developer mode, and I followed the Debian based install instructions. The IP address for my Shield is correct in the config, I’ve been able to successfully add ADB to HomeKit (running on a child bridge). But it never asks me to pair it on the Shield, and the logs say it cannot connect.

logs: https://hastebin.com/share/jomafujuga.vbnet

I tried to run adb connect, but it says it can’t connect. No idea what else to do from here. Any ideas? And thanks!

@SawkeeReemo
Copy link
Author

Weirdly… before when I ran ADB connect it said “failed to authenticate.” Now it says “already connected.” But the logs still say the same error you see in the logs I linked to above. “Unrecognized Accessory.” I even tried renaming the device just in case there was some sort of conflict. Still nothing.

@dwaan
Copy link
Owner

dwaan commented Mar 7, 2024

So right now in your Shield, there’s no popup confirmation to allow adb connection first time your run the plugin? If yes, try do disable developer mode, wait few seconds, and then reenable the developer mode. After that restart the plugin or the whole HomeBridge just to make sure. Most of the time it will popup again.

@SawkeeReemo
Copy link
Author

Ok. I’ll even give the Shield a full power cycle before I re-enable. But also it’s 2:45am here, so I won’t be able to give it a shot until later this morning. I will report back what I find though.

One last thing: I just remembered that I’m running the Projectivy launcher instead of the stock launcher for my Shield. Not sure if that makes a difference, but I will try to disable that as well.

@SawkeeReemo
Copy link
Author

SawkeeReemo commented Mar 8, 2024

Unfortunately, it still does not work. I disabled my custom launcher, turned off dev mode, did a full shut down on the shield to make sure it was fully off and cleared. I restarted the Shield, activated dev mode, restarted the adb plugin child bridge, and nothing happened. I tried deleting it from HomeKit and re-adding it. Restarting Homebridge itself. Pretty much everything I can think of.

Though a long time ago, I actually had this working for a short time. But I had to rebuild Homebridge due to a crash, ever since then, I could never get adb to work again. I'm going to try completely uninstalling the adb plugin, and see if I can hunt down the issue. ... did that... twice. Still doesn't work.

When I run adb devices inside the container, it shows the correct IP:port, but it says unauthorized. Can't figure out how to get the Shield to pop up the authorization.

Here's my ADB version info from inside the homebridge container:

Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb

@dwaan
Copy link
Owner

dwaan commented Mar 8, 2024

When adb said unauthorized, it means that you haven’t give the adb permission to make a connection to the Android, the plugins won’t work if it still unauthorized. If the android didn’t show the adb debugging permission pop up, the only way to make it reappear is just to disable and enable the developer mode, until the pop up reappear, it will need several try. You don’t need to restart your android device, although you might need to restart the plugin every time you do that, and also it doesn’t matter if you use different launcher.

@SawkeeReemo
Copy link
Author

Ok. I will try doing specifically that. Do I need to toggle the network debugging on and off as well?

@Mr-Bridge-0
Copy link

I have the identical problem, any luck on getting this to work?

@SawkeeReemo
Copy link
Author

I have the identical problem, any luck on getting this to work?

Not yet. I don’t have a lot of time to mess with this stuff when it becomes so problematic. Unfortunately other things have had to take precedence. …but it annoys me literally every single time I have to wait for that trash NVIDIA app to load on my iPhone just to pause a show. 😅 I asked about this in the Homebridge GitHub as well… no one has really been that helpful over there other than to say “try not running this is docker.” Which… fine… but then it’s so much more painful to manage. Docker makes things easier until you run into an obscure issue like this, and you’re not a programmer.

@SawkeeReemo
Copy link
Author

Checking in on this… anyone ever figure out how to get this working?

@dwaan
Copy link
Owner

dwaan commented Sep 17, 2024

Yes. This is non issue for the plugin, even when I’m using HomeBridge inside docker container. You just need to make sure the ADB connection is authorized. There’s no other way.

To make sure the plugin will run, the only thing that you need to do already explained in Prerequisite section of readme.

@SawkeeReemo
Copy link
Author

Here’s what I’ve done:

I jumped into the Homebridge shell, then I nuke the adbkey file inside of ~/.android. I added adb connect device_ip:5555 to the startup.sh script, and relaunched the Homebridge container.

When I jumped back into the shell to run adb connect again, now it says “already connected.” So I think great! I’m able to add the adb child bridge to my HomeKit, and I can even see the NVIDIA Shield and the playback motion sensor. …but they don’t do anything. Tapping the power button does nothing, I can’t control anything and they just say “off” the whole time while the Shield is on.

So there HAS to be something missing from all this. The Shield never asked me to re-auth after I deleted the adbkey file, etc. No idea what to do from here. This is as far as I can ever get, and if you look around, there are tons of people that can’t get it to work either.

So if it’s working for you, we need to know how you did that. There’s got to be something missing in all these steps. (It’s 3am here now and I’m sick of fighting with this, so I’m gonna go to sleep. But tomorrow I may build a whole new Homebridge container with nothing in it but this and see what happens.)

@dwaan
Copy link
Owner

dwaan commented Sep 21, 2024

No missing steps. The step is mostly installing adb inside the docker container. And make sure the docker network is exposed to the router, which varied depends on your docker setting.

So, before you jump into the HomeBridge docker installation, you need to make sure adb run properly inside the HomeBridge docker. For example, when you run adb -s your-device-ip shell "getprop ro.product.model" inside the docker container terminal, it will display the device information. Additionally, you can turn on debug output in homebridge-adb config to better understand the problem.

There’s also a list of adb commands to play around inside faq.md to see if adb works properly.

@SawkeeReemo
Copy link
Author

SawkeeReemo commented Sep 21, 2024

When I run that command I see the same thing:

error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

Yet it never asks me to authorize anything on the Shield. Dev mode toggled on and off 500 times, restarted and power cycled the Shield more times than I can count. I never get the prompt. Do I just need to factory reset my Shield and start over? Because if so, I'm probably going to drop this as I don't have time to set this all back up again. I even tried setting the ADB logins to never expire and cleared all previous entries from the dev menu... still never pops up.

So I ran adb kill-server and then ran adb connect 192.168.1.192:5555 And I get this response immediately:

* daemon not running; starting now at tcp:5037
* daemon started successfully
failed to authenticate to 192.168.1.192:5555

And nothing pops up on my Shield.

Homebridge is on my host network, not a docker network, there's no firewall turned on... Static IPs all around... No clue what else I could possibly do at this point.

@dwaan
Copy link
Owner

dwaan commented Sep 22, 2024

Make sure network/remote debug setting is on in your shield if there’s an option for that. Additionally, you can try to plug usb cable from your shield to your computer and the run adb tcpip 5555 from computer terminal to activate remote debugging for adb. You can read all those to steps in the readme.md.

If all of this steps still can’t connect the adb to your device, I suggest to use other HomeBridge plugin like https://www.npmjs.com/package/homebridge-androidtv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants