Home Assistant running on Google Coral Dev Board Mini & Dev Board

Hello, recently I got my hands on a Google Coral Dev Board Mini. I wanted to perform object detection with Frigate NVR using the Edge TPU but this left the Coral mostly idle and unused. So it left me wondering why not running HA and Frigate on the Coral?!

Turns out it’s possible and HA runs surprisingly well. I see very little difference in responsiveness comparing to my “beefier” RockPi4. The Dev Board Mini runs Mendel linux (Google’s modified Debian Buster) has a quad core CPU, 2GB of RAM, 8GB MMC, SD card, WiFi5, BT5.0 and a USB-C data port.

  1. HA supervised installs without issues, follow the Ubuntu/Debian setup instructions in the official HA doc.

  2. The only challenge was to get docker running. If you follow the official instructions then apt install will fail. So edit /etc/apt/sources.list.d/docker.list clear everything inside and replace with:

deb [arch=arm64] https://download.docker.com/linux/debian buster stable

  1. After docker is installed you’ll notice that it won’t start. The reason is that Google has trimmed down the kernel to a bare minimum and many dependencies are missing. You have to recompile the kernel. Most important things for docker are OVERLAY_FS, CGROUPS, APPARMOR, THIN_PROVISIONING, and some more. I won’t detail every steps here, you can read the instructions on https://coral.googlesource.com/docs/+/refs/heads/master/GettingStarted.md

Or you can simply download my ready kernel which supports docker, as well as most USB adapters and hubs like the ConBeeII.

linux-image-4.19.125-mtk_4-2_arm64.deb - Google Drive

  1. Once you got the new kernel copy it to the Dev Board Mini and install it with:

dpkg -i linux-image-4.19.125-mtk_4-2_arm64.deb

After reboot docker and HA should start without issues. You can install everything else in HA (HACS and Addons) as usual. Just make sure you don’t run out of space, the 8GB MMC isn’t much. I installed a fast SD card and moved the entire /usr to the SD card.

5 Likes

Is frigate using hardware acceleration for video decode on this? It seems quite a low end soc so software decode is probably not going to work well for more than one camera.

1 Like

Good question. Integrating my Wyze Cam v3 with RTSP firmware was straight forward, there is no lag (720p H264) and detection is almost instantaneous. But I haven’t asked myself if the Coral is using video hwaccel or not. As I see it does NOT use hwaccel, top shows average 30% CPU load.

I figured out that MTK drivers are included in the original kernel and VPUd service is running upon boot so theoretically it should work. In Frigate’s config I add hwaccel_arg h264_v4l2m2m but there was no video feed. As soon as I remove hwaccel_arg video works again. I also tried ffmpeg separately but same results.

I suspect some issues between v4l and the driver or perhaps I’m doing something wrong. Google didn’t bother to update the kernel (outdated 4.19.125), so that doesn’t help either. I will dig deeper into this issue and reply here.

@nlublovary, thanks for all of the great work, I was able to get my dev mini board up and running using the steps you outlined above, but I’m running into an issue when it comes to storage. Since there isn’t an easy way to add storage to the board outside of an SD card, I wanted to use a network share. However, it looks like nfs isn’t included in the compiled kernal you shared. I have limited experience in compiling a kernel and am lost on how to add it so that I can mount an NFS share.

Do you have any idea?

1 Like

Hi @ajatoledo , I will compile the NFS drivers for you, and will post the link here.

Tip: I’ve been using NFS too but the transfer speeds weren’t amazing and I couldn’t reliably access the NFS from my Windows PC and Android phone. So I switched to plain FTP (don’t need encryption on my home network) and permanently mount my NAS using CurlFTPFS. Less overhead and faster than NFS.
You can install it on the Mini with apt install -y curlftpfs then edit /etc/fstab and add curlftpfs#USERNAME:PASSWORD@IP /mnt fuse _netdev,nofail,automount,allow_other 0 0

PS: It’s not very complicated to compile a kernel for the Coral (or any ARM board), but it’s a tedious process, if you are keen to try then this will help Getting Started with Mendel Linux

Thanks for the quick reply. I was able to get CurlFTPFS set up and running based on the steps you outlined so thanks for that. Also, thanks for the link, I’ve always meant to learn more about compiling a kernel… so I guess this is a good chance.

You’re welcome. I recompiled the original Google kernel 4.19.125 with CONFIG_NFS_* = y so in theory NFS should work now linux-image-4.19.125-mtk_4-2_arm64-NFS.deb
I’m also trying to get a kernel 5.x with GPU decoding working on the Coral but this will need more time.

2 Likes

Hmm… I tried installing the kernel you shared, but I’m still getting an error indicating NFS is missing. However, I did look into CurlFTPFS since I don’t have any security concerns on my local network and it seems to be working well so maybe I don’t need NFS support.

Though again, I really I do appreciate your sharing the kernel… and if you do manage to get GPU decode support, by all means, please do share. I’d really appreciate it.

OMG Noel thank you so much for this.

Are you able to comment a bit further on the performance of HA and frigate on the dev board mini? Is the experience in the browser with HA smooth? What kind of limitations do you see when using the Coral dev board mini for HA?

Thanks!!

Hi mistamal,

The mini’s low-power CPU is not a beast but sufficient to run HA and Frigate NVR. Both HA and NVR run smoothly, the GUI feels zippy. If you don’t go crazy with many HACS and Addons then the mini runs stable. Processing power is not the issue, but truth be told, I experienced 2 limits:

  1. 2GB RAM
    It’s enough for a common HA and NVR setup, but you won’t be able to experiment with dozens of HACS and Addons without eventually hitting out of memory errors. I got a simple setup of 20 WiFi IoT (mostly Tasmotized devices and Shellys), 20 ZigBee and a ConbeeII dongle, couple of BLE sensors, 2 RTSP cams. I use very few Addons and even SSHd and Mosquitto run natively on the mini’s Debian, not as docker HA Addons. You can get by with 2GB RAM but I really wish it had 4GB.

  2. 8GB storage
    The onboard MMC is enough to boot the OS, HA, NVR but little else. First I used to have an SD card and booted from it but loading times were horrendous. So I kept all software on the MMC and connected a slow external 2.5" HDD to record video, logs, DB, backups, swap. It makes no sense to connect a fast SSD to the mini, because its USB port is limited to 2.0 speeds (despite being USB-C). The mini is not able to provide enough power to spin up most HDD so use a USB 2.0 hub with external power adapter and a USB-A to USB-C adapter if necessary.

Caveat:
Currently Google’s kernel 4.19.125 doesn’t provide GPU accelerated video decoding for ffmpeg (which Frigate relies on). So decoding is handled by the CPU. This will limit you to 2 x RTSP cameras at 720p at best. Also the mini comes without heatsinks, with 2 cams the board gets quite hot but not critical, anyway it helps to keep the temps at bay by adding heatsinks (or small fan if you don’t mind the noise). I removed the original plastic cover and put thermal glue to attach a tall heatsink onto the GPU, CPU, TPU, RAM, my setup ain’t pretty but it works 24/7 and its out of view on top of a shelf anyway.

Hope this helps.

1 Like

Hi @nlublovary - how did you reduce the resolution to 720p?

I’m frying to do this in Frigate but it doesn’t seem to work:

  4_Cam: # <------ Name the camera
    ffmpeg:
      inputs:
        - path: rtsp://user:[email protected]:554/live # <----- Update for your camera
          roles:
            - detect

    detect:
      width: 1280 # <---- update for your camera's resolution
      height: 720 # <---- update for your camera's resolution
      fps: 3

the camera still streams at the full 1920 x 1080 @20fps, and even setting detection to 3fps in Frigate brings my installation to its knees with 2 cameras.

Is there a setting that adjust the resolution of/in the camera itself?

@nlublovary. VERY interesting. What version of Mendel did you start off with? I have a full Coral Dev Board and would really like to try this out.

Hello everybody!, can help me somebody to expand my home or move usr to the sd card? seems i am not able to do it… i have google coral mini dev board and i wanna install HA and i have to migrate !,2 gb backup