Skip to main content

HomeAssistant

HomeAssistant

https://www.home-assistant.io/installation/linux#docker-compose

services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /home/shaun/home-assistant/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

Frigate

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "115mb" # update for your cameras based on calculation above
    devices:
      - /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/shaun/frigate/config:/config
      - /home/shaun/frigate/storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "8971:8971"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
      #- "5000:5000" # Internal unauthenticated access. Expose carefully.
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

Coral Setup

https://coral.ai/docs/accelerator/get-started/#pycoral-on-linux

Edge TPU Runtime

echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install libedgetpu1-std

PyCoral Library

The docs would have asked you to use apt, but this fails on ubuntu 24.04 -

[sudo] password for shaun:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-pycoral : Depends: python3-tflite-runtime (= 2.5.0.post1) but it is not going to be installed
                   Depends: python3 (< 3.10) but 3.12.3-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

Coral supports only pthon <= 3.10 https://realpython.com/intro-to-pyenv/#why-not-use-system-python

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
curl https://pyenv.run | bash

You get this output, put the last 3 lines in ~/.bash_aliases

WARNING: seems you still have not added 'pyenv' to the load path.

Load pyenv automatically by adding
the following to ~/.bashrc:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Install python 3.9 -

pyenv install 3.9
pyenv global 3.9
python -V

Python 3.9.0

If python version does not switch, run eval "$(pyenv init -)" and try again. If this works you should add this line to your ~/.bash_aliases.

Last, install pycoral library now that we are on python 3.9 -

python3 -m pip install --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0