Docker HA and adb container....Anyone have this setup?


Recommended Posts

1 hour ago, Avico said:

 could please explain  how you set up your sorccu/adb docker on the qnap?what is requied from the android device side?(mibox)

Hopefully u manage to make it work anyway

Might be worth noting that you have posted your qnap question on the Unraid forum. Nobody on this thread mentioned qnap.

Link to comment
  • 2 months later...
Hi
 
I'm trying to setup up the same docker for the same HA android TV support. @mkono87 did you succeed?  I found this video but I've no idea how to run the shell command:
 
 
I have the container setup and it runs 24/7 butnfor some reason after a day or two all the devices disconnect and throw and error in HA. so I haven't done much with it lately but I plan to finally attack it some day. Il check out that video when I get home.

Sent from my Mi 9T using Tapatalk

Link to comment
1 hour ago, mkono87 said:

I have the container setup and it runs 24/7 butnfor some reason after a day or two all the devices disconnect and throw and error in HA. so I haven't done much with it lately but I plan to finally attack it some day. Il check out that video when I get home.

Sent from my Mi 9T using Tapatalk
 

Thanks - would you mind sharing your docker settings please?

 

I ended up installing Hassio in a VM today and I managed to connect to my Android TVs using the hassio adb server, but I need to work out how to trace the states

  • Like 1
Link to comment
Thanks - would you mind sharing your docker settings please?  

I ended up installing Hassio in a VM today and I managed to connect to my Android TVs using the hassio adb server, but I need to work out how to trace the states

 

when I get home if I remeber I can sure dig up something for you. Mind you adb and HA is no longer on unraid but using the same containers.  

 

 

edit... check this out.

 

 https://gist.github.com/mcfrojd/9e6875e1db5c089b1e3ddeb7dba0f304

 

 

 

 

Link to comment
  • 3 months later...

Just thought I'd share in case anyone else lands here like I did.

 

I'm traveling for work and not at home, so there was only so much I could do, but based on my limited success, I can shed some light on getting the docker container config set up on unRAID along with the sh command that seems to be a point of confusion in this thread.

 

Thanks to the video posted by @DZMM, I was able to figure this out fairly easily.

 

image.thumb.png.9f7b427091214bfbb833a23556c2ef65.png

 

I had also initially created the setup.sh script in the /config folder using notepad++, as this is how I frequently do it for Home Assistant, but there were formatting and permission issues (the latter was warned in the video) so I just recreated the file using vi from the container's terminal and presto.

 

image.png.1cade828ac371cf870e0b6df80170b89.png

 

ADB isn't enabled on my TV at home, which is the limitation I mentioned earlier so I get the "No route to host" error, but I'm fairly confident this will work when I get it enabled.

 

Good luck!

  • Like 1
Link to comment

@anderbak thanks for this as I didn't know how to run the script command.  It's still not working for me though which is weird as it keeps saying it can't find startup.sh.  If I don't do chmod +x startup.sh it says 'permission denied', so it knows it's there.  Any idea what's going wrong??  Thanks

 

docker run -d --name='adb' --net='br0.55' --ip='192.168.50.19' --cpuset-cpus='1,7,8,17,23,24' --log-opt max-size='50m' --log-opt max-file='3' --privileged=true -e TZ="Europe/London" -e HOST_OS="Unraid" -v '/mnt/user/appdata/dockers/adb/':'/config':'rw' 'sorccu/adb' sh -c "/config/startup.sh & adb -a -P 5037 server nodaemon"
#!/bin/sh

sleep 5

DEVICES="192.168.30.30"

echo "Connecting to devices."
for device in $DEVICES; do
   adb connect $device
done
echo "Done."

while true; do
  for device in $DEVICES; do
    adb connect $device (anglebracket) /dev/null 2(anglebracket)&1
  done
  sleep 60
done

 

Link to comment

@DZMM 

That's the same permission issue I ran into when creating the setup.sh file using notepad++ and putting it in adb's appdata folder.

 

Start by opening the adb container's console.

image.png.353d64b57cd72ba9230c4fff15b5f646.png

Check your permissions by typing

ls -alh /config

image.png.ffc0b41952843036df1aac9678183fb6.png

I corrected mine using

chmod 777 /config/startup.sh

and

chown root:root /config/startup.sh

I also noticed in your post the same formatting errors that I had from c/p with notepad++. Your issue may just be c/p to your post, but verify you don't have the two "(anglebracket)" in your script.

 

 image.png.dbcf56c4e55b3de0bf2e27f82354b8d7.png

 

If you're not familiar with vi, it's unintuitive at first.
After typing

vi /config/startup.sh

move your cursor to an area where you need to make a change. Hit "i" on your keyboard. Make the necessary changes. Hit the "esc" key when you're done making changes. Type ":wq" to write the changes and close the file. Restart adb.

Edited by anderbak
  • Thanks 1
Link to comment
  • 1 month later...
  • 9 months later...

I was having the same issues as mentioned in this post - I know its a bit old now but I've only recently become a user of UnRAID.

I re-packaged the sorccu container with a script which will connect to the androidtv/firetv devices automatically and attempt to keep them connected. Its nothing fancy but it works for me.

 

Its here if it will help anyone else with these issues: https://hub.docker.com/r/barnybbb/adb-hass-androidtv

 

Thanks,

 

Barny.

Link to comment
  • 2 weeks later...
On 12/24/2020 at 4:48 PM, Barny said:

I was having the same issues as mentioned in this post - I know its a bit old now but I've only recently become a user of UnRAID.

I re-packaged the sorccu container with a script which will connect to the androidtv/firetv devices automatically and attempt to keep them connected. Its nothing fancy but it works for me.

 

Its here if it will help anyone else with these issues: https://hub.docker.com/r/barnybbb/adb-hass-androidtv

 

Thanks,

 

Barny.

Thanks a lot Barny for sharing this.

You should make a template and publish it in unraid community apps so more people will find it

Link to comment
On 1/3/2021 at 9:35 AM, L0rdRaiden said:

Thanks a lot Barny for sharing this.

You should make a template and publish it in unraid community apps so more people will find it

I needed this today too and found that it wasn't a template so I created one for it.

 

 

 

If Barny ever decides to spin up a container template repo for CA and would prefer to take this over I'd gladly hand it over, but for now I wanted to get this out to more people who may need it :)

Edited by CorneliousJD
  • Thanks 1
Link to comment
  • 5 months later...

@CorneliousJD thanks for converting this to a template and helping people out with it. This was a little Christmas project of mine which I promptly got distracted from with that pesky thing called "work" for the last 5 months...

I'm finally back to playing with my unraid/hass/firetv integrations (when time permits!).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.