Coral TPU not detected by HA blue for Frigate

Hi,

I added a Coral TPU (USB) to my HA blue, but it’s not detected by HA and Frigate will not start, if I add CPU as a detector everything works fine, so I know my Frigate is working fine but off course uses too many resources so want to move to a Coral as a detector, any idea what I’m missing here?

detectors:
coral:
type: edgetpu
device: usb

Do I need to add separate drivers for this? If I read the release notes of the OS version, I see this, so seems it should work?

Google Coral PCIe AI Accelerator Support

@ryddler enabled the driver for Google Coral PCIe TPU devices. This allows to use Google Coral Mini PCIe Accelerator or M.2 Accelerator on all boards supporting PCIe.

That’s all Folks! Now go out and update!

Version information

System Health

version: core-2021.8.2
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.6
os_name: Linux
os_version: 5.10.53
arch: aarch64
timezone: Europe/Brussels

GitHub API: ok
Github API Calls Remaining: 4196
Installed Version: 1.13.2
Stage: running
Available Repositories: 909
Installed Repositories: 40

logged_in: true
subscription_expiration: 26 augustus 2021 02:00
relayer_connected: true
remote_enabled: true
remote_connected: true
alexa_enabled: false
google_enabled: true
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 6.2
update_channel: stable
supervisor_version: supervisor-2021.06.8
docker_version: 20.10.6
disk_total: 113.9 GB
disk_used: 12.4 GB
healthy: true
supported: true
board: odroid-n2
supervisor_api: ok
version_api: ok
installed_addons: Samba share (9.5.1), Visual Studio Code (3.6.1), deCONZ (6.9.0), Samba Backup (4.5.0), Assistant Relay (0.7.4), ADB - Android Debug Bridge (0.8.0), Tautulli (2.3.0), Node-RED (9.2.1), Mosquitto broker (6.0.1), File editor (5.3.3), MariaDB (2.4.0), Eufy Home Assistant MQTT Bridge (1.21.0), Frigate NVR (1.13)

Thanks in advance!

Make sure the format is correct in frigate.yml-

detectors:
  coral:
    type: edgetpu
    device: usb

Also, try to use the USB 3.0 port on the top left position. Then, restart HA.

1 Like

Thanks for the quick reply @ardysusilo I think the code is fine, but the port options will be something I’m going to try later, have to wait now because the wife is cleaning the first floor and if a go true this now I probably don’t need Frigate anymore :slight_smile:

image

Thanks!

1 Like

Sure! I’m also using HA Blue with USB Coral. Try changing the port to the top left. If it is still not recognized, try HA restart, or HA host reboot.

Note based on my experience:

  1. Top left - BEST (inference speed 10-12ms)
  2. Top right- disconnected every few hours or so (due to power deficiency)
  3. Bottom- not recognized

Also, don’t forget to turn ON Watchdog function in Frigate addon.

1 Like

OK connected the TPU on the first port on the top (next of power socket)

Still got this error and also no TPU mentioned in the supervisor hardware section

  • Starting nginx nginx
    …done.
    frigate.app INFO : Creating directory: /tmp/cache
    Starting migrations
    peewee_migrate INFO : Starting migrations
    There is nothing to migrate
    peewee_migrate INFO : There is nothing to migrate
    frigate.mqtt INFO : MQTT connected
    detector.coral INFO : Starting detection process: 41
    frigate.edgetpu INFO : Attempting to load TPU as usb
    frigate.app INFO : Camera processor started for wasruimte: 44
    Process detector:coral:
    frigate.edgetpu INFO : No EdgeTPU detected.

Watchdog is enabled

Does the USB accelerator lights up? Try reboot HA host.

There is a white light on the TPU…
Rebooted host and rebooted HA, both does not seem to work

Output stating the Frigate add-on

  • Starting nginx nginx
    …done.
    frigate.app INFO : Creating directory: /tmp/cache
    Starting migrations
    peewee_migrate INFO : Starting migrations
    There is nothing to migrate
    peewee_migrate INFO : There is nothing to migrate
    frigate.mqtt INFO : MQTT connected
    detector.coral INFO : Starting detection process: 42
    frigate.edgetpu INFO : Attempting to load TPU as usb
    frigate.app INFO : Camera processor started for wasruimte: 45
    frigate.app INFO : Camera processor started for dressing: 46
    frigate.edgetpu INFO : No EdgeTPU detected.
    Process detector:coral:
    Traceback (most recent call last):
    File “/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py”, line 152, in load_delegate
    delegate = Delegate(library, options)
    File “/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py”, line 111, in init
    raise ValueError(capture.message)
    ValueError
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
    File “/usr/lib/python3.8/multiprocessing/process.py”, line 315, in _bootstrap
    self.run()
    File “/usr/lib/python3.8/multiprocessing/process.py”, line 108, in run
    self._target(*self._args, **self._kwargs)
    File “/opt/frigate/frigate/edgetpu.py”, line 124, in run_detector
    object_detector = LocalObjectDetector(tf_device=tf_device, num_threads=num_threads)
    File “/opt/frigate/frigate/edgetpu.py”, line 63, in init
    edge_tpu_delegate = load_delegate(‘libedgetpu.so.1.0’, device_config)
    File “/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py”, line 154, in load_delegate
    raise ValueError(‘Failed to load delegate from {}\n{}’.format(
    ValueError: Failed to load delegate from libedgetpu.so.1.0
    frigate.app INFO : Camera processor started for keuken: 49
    frigate.app INFO : Capture process started for wasruimte: 50
    frigate.app INFO : Capture process started for dressing: 51
    frigate.app INFO : Capture process started for keuken: 55
    frigate.watchdog INFO : Detection appears to have stopped. Exiting frigate…
    frigate.app INFO : Stopping…
    frigate.events INFO : Exiting event processor…
    frigate.record INFO : Exiting recording maintenance…
    frigate.object_processing INFO : Exiting object processor…
    frigate.watchdog INFO : Exiting watchdog…
    frigate.events INFO : Exiting event cleanup…

At first, I also had problems getting HA Blue to recognize the USB. Maybe try once again but the disable protection mode. If still not recognized, try another port.

Can you see the stick in your supervisor hardware panel?
I can only see my Conbee2 here?

Hmm, I don’t in my supervisor panel. Here is the screenshot-

OK so that’s seems to be normal then, still not clear why HA can’t see the TPU

Thanks for your support!

Have you tried disabling protection mode?

Yep, also does not work :frowning:

Okay. I suggest you post your problem here-

Maybe others have also experienced the same problem with you and know how to solve it.

Will do thanks for your time and support!

1 Like

Any luck with this? I have the m.2 stick in a case and plugged in via USB. HA Blue hasn’t seen it yet.

Did you happen to get anything from your question on that thread? I’m having the same issue and also posted there. Not sure how to further diagnose the issue.

Ran into this while setting up mine just now. Worked after I disabled protection mode under Settings/Add-ons/Frigate

1 Like

Hello,

tell me how did you get it to work? I have an odroid m2+, same as HA blue, but can’t get the TPU to work. Not even with an external USB hub.

Thanks

Hello,

any tips on how to get the Coral USB working?

Even frigates without protection mode does not recognize the TPU?

Thanks