Google Assistant Webserver in a Docker container

yes, thats working on HassOS for me
before i thougth i just need to use /config
but it was actually /mnt/data/supervisor/homeassistant
so /share will be /mnt/data/supervisor/share
so /config/test will be /mnt/data/supervisor/homeassistant/test

and so on

1 Like

thanks for the response. @capstan1 just constuct the mount points knowing the root of hassio is /mnt/data/supervisor/

So I did this and was able to deploy it. The container started but is constantly restarting.
The logs only say: standard_init_linux.go:207: exec user process caused "exec format error"

sorry, cant help with that :slight_smile:

So, I’ve been trying to set this up within the last days.
I created a dummy soundcard with modprobe snd-dummy on my raspberry pi 3b+

Then I entered the following configuration, but it always fails with

standard_init_linux.go:207: exec user process caused "exec format error"

For env I tried armhf, armv7, arm7hf but I always get the same errors and the container restarts immediately.

Anyone has any idea what wents wrong here?

Hi, since some days the broadcast is not working: when I put this URL in browser

http://containerip:5000/broadcast_message?message=Hello

I receive

{"status": "OK"}

but nothing is spoken

Also getting this error and constant restarts of the container: standard_init_linux.go:207: exec user process caused "exec format error"

I was trying to run this on my raspberry pi - but I think it automatically pulled the wrong version (not for arm) - what can I do?

No one with any idea on how to get this running on Hass.io on a Raspberry Pi 3B+?

Get the arm version: https://hub.docker.com/r/andbobsyouruncle/armhf-google-assistant-webserver

When I follow the guide it automatically Downloads the wrong version. What do I have to do so that it uses the right version? And is this version still based on the Google Assistant libraries?

Also: while andbobsyouruncle’s version works, it doesn’t support playing media like this one does.

Ah fair enough, I didn’t really look at the actual topic, I just assumed this was about ABYO’s version. Should read the actual original post next time :wink:

Same here. I stopped it, deleted my access token and restarted, then re-authenticated, and it acts like it’s working, but no broadcasts. Messages do seem to work, though, for instance “message/?message=Turn on the pond pump” does turn on the pond pump, and it shows in my activity. When I try and broadcast, it just shows “Broadcast”

Nothing we can do, I guess?

Mine seems to be compounded with too many changes/variables. My wife initially set them up using a GSuite account, and I set this up using s GSuite account, but she changed to a gmail account so her calendar would work. While troubleshotting, I realized I couldn’t broadcast even when trying myself, or from my phone, and I was now in my own “home.” And you can’t invite GSuite accounts to your home, so I had to switch to a Gmail account. But even after all that, it doesn’t work. It returns OK, but the dashboard says 100% errors when I look on Google.

Thanks so much for doing this! It picks up right where assistant-relay leaves off, creating a real device that shows up in the app and allows AV casting. Awesome!

Edit: Sigh, spoke too soon. All I’m trying to do is be able to programatically play CNN via YouTube TV on my nVidia Shield running Android TV, something that’s as simple as saying “watch CNN” to a nearby Google Home. That seems to be completely impossible, no matter what I technique I use. In this case, it’ll start some random CNN clip from YouTube, but won’t start YouTube TV at all.

Edit2: This seems to work well for me to automatically launch a specific live channel:

- service: androidtv.adb_command
  data:
    entity_id: media_player.nvidia_shield
    command: 'am start -a android.intent.action.VIEW -d watch/fKMp_KEoAh4 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity'

The string in -d watch/fKMp_KEoAh4 came from the URL when I navigate to the channel in a browser.

And… I forgot to set the address, even after reading through the instructions multiples times and this not being the first time…

I’m running this on a RPi (using dummy mic) by taking the original version of AndBobsYourUncle’s google assistant weberver on github as reference.

These’s something needs to modify before First Run

FROM multiarch/debian-debootstrap:armhf-stretch

  • Insert codes under RUN pip3 install --upgrade pip

COPY requirements.txt /tmp
ADD .asoundrc /root/
WORKDIR /tmp
RUN pip3 install -r requirements.txt

  • Add a new file requirements.txt in the same directory of the Dockerfile.
    Write this inside the requirements.txt:
    (maybe pyasn1 error is not necessary to fix. I’m not sure.)

pyasn1<0.5.0,>=0.4.1

  • Put/Copy .asoundrc you made in Setup - Prerequisite in the same directory of the Dockerfile.
  • Build using Docker: (replace <your_name> with anything you want)

$ docker build -t <your_name>/ga-webserver .

(It may takes a few minutes to build. These might be a [WARNING] of apt-utils, but it’s fine.)

  • Back to First Run step
  • Change robwolff3/ga-webserver to <your_name>/ga-webserver in “Docker Run” command or “Docker Compose”.
  • Remember to set the address of your device. ( It takes me 3 times to get a working address.)

I think that’s all. Hoping I’m not forget anything. :stuck_out_tongue:

I’m noob to docker so I’m not upload the files to Docker Hub, and sorry for my poor English.:zipper_mouth_face:

3 Likes

Here is my Dockerfile for RPi.

FROM multiarch/debian-debootstrap:armhf-stretch

# Install packages
RUN apt-get update
RUN apt-get install -y jq tzdata python3 python3-dev python3-pip \
        python3-six python3-pyasn1 libportaudio2 alsa-utils \
        portaudio19-dev libffi-dev libssl-dev libmpg123-dev
RUN pip3 install --upgrade pip
COPY requirements.txt /tmp
ADD .asoundrc /root/
WORKDIR /tmp
RUN pip3 install -r requirements.txt
RUN pip3 install --upgrade six
RUN pip3 install --upgrade google-assistant-library google-auth \
        requests_oauthlib cherrypy flask flask-jsonpify flask-restful \
        grpcio google-assistant-grpc google-auth-oauthlib \
        setuptools wheel google-assistant-sdk[samples] pyopenssl
#RUN apt-get remove -y --purge python3-pip python3-dev
RUN apt-get clean -y
RUN rm -rf /var/lib/apt/lists/*

# Copy data
COPY run.sh /
COPY *.py /

RUN chmod a+x /run.sh

ENTRYPOINT [ "/run.sh" ]

Docker Run should be like this:

$ docker run -d --name=gawebserver \
    --restart on-failure \
    -v /home/$USER/docker/config/gawebserver/config:/config \
    -v /home/$USER/docker/config/gawebserver/assistant:/root/.config/google-assistant-library/assistant \
    -p 9324:9324 \
    -p 5000:5000 \
    -e CLIENT_SECRET=client_secret.json \
    -e DEVICE_MODEL_ID=device_model_id \
    -e PROJECT_ID=project_id \
    -e PYTHONIOENCODING=utf-8 \
    --device /dev/snd:/dev/snd:rwm \
    **<your_name>**/ga-webserver

Docker Compose:

version: "3.7"
services:
  gawebserver:
    container_name: gawebserver
    image: **<your_name>**/ga-webserver
    restart: on-failure
    volumes:
      - /home/$USER/docker/config/gawebserver/config:/config
      - /home/$USER/docker/config/gawebserver/assistant:/root/.config/google-assistant-library/assistant
    ports:
      - 9324:9324
      - 5000:5000
    environment:
      - CLIENT_SECRET=client_secret.json
      - DEVICE_MODEL_ID=device_model_id
      - PROJECT_ID=project_id
    devices:
      - "/dev/snd:/dev/snd:rwm"

Can someone tell me if it’s possible to use this solution on a Synology NAS, without a USB soundcard? I tried the dummy generation but it does not seem to work. Should some file be generated in /dev/snd automatically using the command?