Image processing with USB acceleration - all pi! ARCHIVED

Hope anyone can offer insight to my error here: all was working fine until I updated my hassbian venv to python 3.7 and then stretch>buster.
the error is mentioning a ‘broken pipe’ - I rolled back from 1.6 to 1.5 using HACS to see if that helped, and i got substantially more in the log.

2019-10-06 21:50:20 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_object image_processing took longer than the scheduled update interval 0:00:05
2019-10-06 21:50:21 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.kitchen_person_counter fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1244, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1290, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1239, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1065, in _send_output
    self.send(chunk)
  File "/usr/local/lib/python3.7/http/client.py", line 987, in send
    self.sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe

really looking forward to this supporting my presence detection at home. thanks @robmarkcole you always make top components!

Check home assistant issues on Github

problem solved by restarting the coral rest service :confused:

1 Like

@robmarkcole

Robin, I’ve been following your CV tutorials with great results - thanks for this!
Question - can I just install hassio (image on SD card) on RPI4 and add Coral to it over USB-C connection? Would this be possible?

Ros

We need to create a Hassio addon to support it, that is in the pipeline

@robmarkcole
I am volunteering for a beta of the Hassio addon. Please, PM if you need any help!

1 Like

me too! count on me as volunteer

My Coral is in the mail. Rob - we are ready for the hassio add-on beta)

I guess I better get started on it…!

3 Likes

Hi Louis, im on a NUC with proxmox and docker server running debian, where i have passed my usb port to, and where i have attached google coral.

do you have an updated version or can i just use this setup you have build here? i remember i saw somewhere you wrote about healthcheck for docker.

i will be grateful if you share :wink: running atm. noavx :frowning:
cheers

I did write a healthcheck in the Dockerfile; it just tries to solve an image every so often.

What I discovered is that even when the container is declared “unhealthy”, Docker didn’t automagically restart the container for me. I ended up adapting something I found that goes and looks for unhealthy containers and then restarts them. That seems to be working.

I will have to package that all up. I think I need to see what the latest is in regards to the flask server talking to the Coral stick; I think what I have hasn’t kept up with recent changes so I probably need to merge all that back together and make a pull request for @robmarkcole.

Likewise, the Home Assistant component. Since I last looked at all this, the DOODS thing has appeared as another alternative, and I’m wondering now what the “best” solution is to implement, in regards to adoption and going with the flow, such as it is…

oh didn’t notices that they release DOODS support for HA, DOODS is completely new to me, so could be an option :slight_smile:

Robin’s work here seems to be a nice way to do it, but didn’t managed to get it running with the TPU - only CPU and that is alot of load when you want to use all 4 camera’s each of 1 FPS :wink:

For anyone watching this thread but who doesn’t own a coral USB stick I have created a fork which doesn’t require the stick. It runs tensorflow-lite on a pi and allows object detection via a (quite basic currently) HA integration. My plan is to merge this with the stick approach, so that there will be a single integration for tensorflow-lite, with optional hardware accelleration using the stick. For anyone interested the repo is below, cheers

https://github.com/robmarkcole/HASS-tensorflow-lite-rest-server

The server is here

2 Likes

Hi all
is anyone running the coral on non pi hardware, e.g. linux box, synology etc? I am interested to hear how that experience is.
Cheers

Hi @robmarkcole,

I am currently running on PI3 but in case an Hass.IO add on is released I will move it to a linux box.
In other words…+1 for the add-on :slight_smile:

I’ve been running on an Intel i5-based system, Ubuntu 18.04 / Docker as before. It’s a fanless, SSD-only box with passive cooling: https://www.aliexpress.com/item/32814284342.html

Curiously, I switched over to DOODS about a month ago try with the home assistant component and I don’t seem to be having the problem with the Coral USB stick hanging. Of course, so many parts of the software stack talking to have changed, hard to say what accounts for the difference?

Getting error after hours of good results. Finally got this going, everything works great, it sees people, saves a picture. But after a few hours I get the error below on the “python3 coral-app.py” run. I restart it and all looks good till a few hours again and I get the error.
Any ideas on what I can do to fix this?

Exception happened during processing of request from ('192.168.0.163', 40694)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 665, in process_request
    t.start()
  File "/usr/lib/python3.7/threading.py", line 847, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

That is a new one, where/how are you running it?

wow you reply fast. I have the Coral stick running on a raspberry pi 3b running Raspbian Buster.

Can you create an issue on the repo plz. I did have an intermittent issue that was resolved by using a higher ampage power supply, as described in the docs