Raspberry Pi as a HA Voice Assist CHAPTER 4 satellite

I have some raspberry pi 3b and 4b leftover. I was planning to use this as Ropieee or Volumio, but now I think I can use these as satellite, but not sure which microphone to get.

  1. Can I use this satellite code as Docker image? It’s easier to manage since I have Portainer installed on HA and already manage multiple Pi satellites.
  2. Do you have any recommendation about microphone? I’m thinking about getting USB Microphone.
  3. Or, can I install this script on Android device that I have root access, and use its capability, speaker and microphone?

Q1 is answered clearly in the homeassistant-satellite instructions (which I gave a link to). The other 2 have been discussed in other threads, and I would rather keep this discussion on topic.

Thank you for this guide, it was super helpful and I was able to get my voice assistant working!

1 Like

first off thanks for the guide…i am getting this error when try to run the script run for the satellite

AssertionError: Pipeline failed to run

any idea?

No idea. I am not a developer who wrote these programs; and even if I was, the error message you quote doesn’t contain any detail to help work out where it is coming from.

Are you even using a Raspberry Pi with Raspberry Pi OS ?
Did you restart Home Assistant after installing the add-ons there ?

Please give us more clues to make it easier to help you.

Another user reported a problem in a different thread that turned out to be caused by him using the same terminal session for both step 1 and step 2.

It doesn’t hurt to repeat that we want both wyoming-openwakeword and homeassistant-satellite to be running at the same time.

I am running my test RasPi headless and using the Remmina program on my main ubuntu linux PC to open a remote terminal session - and so my simple way around this was to open two terminal sessions at the same time. I am sure there are other/better ways to do this, but I’m no linux GOD. It also means that I can swap between the two terminal sessions to watch any output, error messages, etc., and of course it’s easy to copy and paste into a terminal session :wink:

This is an absolutely fantastic resource, thanks so much!!

Solved this using alsamixer to select the specific interface and lower the volume

I’ve managed to get everything working apart from I can’t adjust the playback volume of the voice assistant when she responds… The buttons on the s330 conference device don’t seem to function and I’ve tried various amixer commands but nothing seems to alter the volume. Does anything need to be set within the satellite configuration for this??

1 Like

I’m having the same volume issue. Did you find a solution?

Good day to you Don, thank you so much for taking the time to create these tutorials. I was actually working on youre rhasppy tutorial you made in jan when I was googling some issues im having with my Respeaker 4-mic hat and stumbled acorss this new tutorial.

Im curious as to youre motivation to move from rhasppy and to be using HA voice now? better response, easier integration or other factors?

Im a hobby coder/ tinkerer and the end game is to have my own AI language model running the voice assisstant, but thats a fair ways away still.

So I’m curious(as I’m just starting to create the satellite with my pi zero I bought for your Rhasspy tutorial) the reasons you choose to swap over before I carry on with the Rhasspy guide. I have a dedicated desktop with Debian running HA after I got tired of fighting my Hyper-V VM for usb-passthrough, so I have lots of CPU power to crunch the data. I also already have a PI 3B as well.

Would it be better to use the 3B and be able to do a bit more processing on the satellite side to reduce the delays of the recognition or stick to pumping the signals to the PC?
Any thoughts in the direction I should take it for best efficiency is most appreciated.

1 Like

Thanks for this thread. I am going to try this on saturday. I have RPI3b and a jabre usb speaker/micro phone laying around. I manged to get the Whisper/Piper/OpenWakeword via docker on unraid where I run Home assistant. I order a Mstack ATOM ESP32 but it won’t get here from china until late december.
SO I will use the hardware I have laying around to setup and test my voice assistant.

I am still using Rhasspy 2.11 for my voice assistant. It does what I want, and my partner and I are used to porcupines foibles.

I see HA Voice Assist as the next step, both because it is effectively the next version of Rhasspy by Mike, and because it is designed to be closely integrated with Home Assistant (which is all I am using Rhasspy for).

However … currently HA Voice Assist is only installed on the test RasPi in my study, and there are a couple of aspects I am not happy with - most notably I have a 15 second delay between me stopping talking and Whisper processing the audio.

I have seen comments that the 15 second selay may be caused by the Virtual Machine that HA is running in - but I have not found the settings which were mentioned.
To be honest it has been some time since i looked at it last (I seem always to distract myself with other projects), and hopefully this wrinkle has already been worked out … or the December HA update may offer improvements.

Consequently I am not in a good position to recommend either way. At least with RasPi it is so easy to swap SD cards to change OS/applications.

thats great news, thank you for the response. since I have 2 pi’s I think I’ll try with both and see which works better for my setup. Have a great day

I am going to use a pi 3, what speaker and microphone do you recommend?

Great plan since you already have the units. I would love to hear your results.

Recommend ? I recommend that you wait until there is a better option on the market. :frowning_face:

I am not aware of anything with comparable sound quality to google or amazon devices … which is not chained to a proprietary cloud platform. Conference speakers are reported to be good, but expensive, and assume there will be no background noise.

I personally am hoping that Nabu Casa will leverage its ESPHome expertise to produce a ESP32-S3 based unit which can use some AI to do local wakeword detection, with a 3D printable case that channels the audio in and out to best effect. :crossed_fingers:

For my latest voice satellite unit I followed advice to just use a USB microphone and a basic speaker (I am not trying to play music, so quality isn’t a big issue) - and it is working fine. Most importantly they are cheap and easily reusable (unlike some of the mic cards I have bought previously).

Hey Don,

Sorry to highjack this response. I was on another thread on rhasspy where youre chiming in on good usb mic for rhasppy and I noticed that you mentioned you have both respeaker 2 mic and the 4 mic hats being used. I am struggling getting this 4 mic hat to work. Ive been following the rhasspy tutorial you wrote and im always stuck at the test mic and speakers part before I move on with guide. I can not get it to take a recording.

Ive been diving into the seed forums and hintaks github “issues” and a few other places ive stumbled across on google searches without success. Hence why i was starting to search for recommendations for another, but it would be a waste of money to not get this hat working. Im sure I oculd repurpose it for something else since i did have it working on my windows when I first bought it, but I did specifically buy it(before I seen your guide) for AI assistant usage.

Any tips you could give or do you recall any struggles getting that thing to work in the beginning? Maybe an older rasp OS version? Ive only tried bullseye and now trying bookworm.

thanks ahead of time for anything you cantoss my way :slight_smile:

I do like the reSpeaker 4-mic HAT on a RasPi 3A, particularly because of the patterns you can make with the LEDs to give feedback. The down sides are that all of the reSpeaker-type boards + RasPi are too expensive to deploy everywhere; and the driver does not make use of all the mics (and probably never will).

The reason I put emphasis on testing the audio in and out is because i also had problems with that :frowning: Now, can I remember what my problem was and how I resolved it ? …


Looking back on my initial notes … the 4-mic HAT uses a different sound chip, so instructions for your card (ReSpeaker 4-Mic Array for Raspberry Pi | Seeed Studio Wiki).

HinTak was updating the driver for different Raspi OS versions, and I haven’t touched anything on mine since i got it working (uname -r returns 5.10.103-v7+) … so wondering if the reSpeaker driver is a bit behind the latest RasPi OS’s kernel ?

Which RasPi OS are you using ? the 32-bit Lite version ?

I tested using headphones, for which the aplay -L entry was

plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions

to test with 2 channels (left and right)

$ speaker-test -c2 -Dplughw:CARD=Headphones,DEV=0

To test microphone, arecord -L included

$ arecord -L
plughw:CARD=seeed4micvoicec,DEV=0
    seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
    Hardware device with all software conversions

I did note:
The reSpeaker 4-mic HAT appears to only allow recording of all 4 microphones (-channels 4) and -format of “S32_LE” with other options giving errors.

$ arecord -Dac108 -fS32_LE -r16000 -c4 hello.wav
Recording WAVE 'hello.wav' : Signed 32 bit Little Endian, Rate 16000 Hz, Channels 4 
^C

Whatever the microphones hear after entering the command and until you press will be saved to file “test.wav”.

Playing the test.wav file to check the recording requires an extra step for the 4-mic HAT because the recording is in S32-LE format but aplay works with S16_LE but not S32_LE :frowning: I installed and ran sox to convert formats

sudo apt-get install sox
sox -v8 hello.wav -c2 -b16 stereo.wav
aplay -Dhw:1 stereo.wav

Well, that does seem sufficiently different from the 2-mic reSpeaker :frowning_face: I hope that this is the hints that you were missing.


Current Rhasspy configuration for this satellite is:

{
    "home_assistant": {
        "access_token": "eyJ0eXAi ... ma_XmCZf2SenOU",
        "url": "http://192.168.1.98:8123/"
    },
    "intent": {
        "system": "hermes"
    },
    "microphone": {
        "arecord": {
            "device": "plughw:CARD=seeed4micvoicec,DEV=0",
            "udp_audio_port": "12203"
        },
        "system": "arecord"
    },
    "mqtt": {
        "enabled": "true",
        "host": "192.168.1.98",
        "password": "password",
        "port": "1883",
        "site_id": "sat-1",
        "username": "rhasspy"
    },
    "sounds": {
        "aplay": {
            "device": "plughw:CARD=Headphones,DEV=0",
            "volume": "0.8"
        },
        "system": "aplay"
    },
    "speech_to_text": {
        "system": "hermes"
    },
    "text_to_speech": {
        "system": "hermes"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "porcupine_raspberry-pi.ppn",
            "sensitivity": "0.3",
            "udp_audio": "12203"
        },
        "system": "porcupine"
    }
}

You sir are a life saver. I did go through the Seeed Studio wiki when it first arrived but again that was for windows just to test it out. But the goal was eventually for it to be a mic for the smart home. I did find that Hintaks repo is still being updated and the latest is setting up the kernel to a 6.1.x version in his install script.

I was installing 64bit right of the bat for the 3B but after the initial seed 64bit install didnt work and I learned that hintaks was 32bit I grabbed the 32bit versions of the OS. dont need 64bit anyways if rhasspy is the only ting its being used for. IF Hintaks updated version doesnt seem to work with your tips I will just go older versions that I can find to put on it,

Its a shame Seeed let this product go, it seemed like it would have made a good dent in the assistant market these days. lol the bit the bullet too soon.

Again thank you for taking to time to share your tips and tricks with me… and the rest of the community involvement from what Ive seen.

One last thing I forgot to mention as I was reading over your reply again. probably wont relay to your current setup but I guess there was an issue with the channels on the 4mic hat getting jumbled around on reboots and uses, and someone made a tweak to 2 of the driver files to correct this. Here is the github thread that has the link for the adjusted files. just in case you were unaware or decide to use that mic in another setup someday and run into that issue…

[Bug]: reference channels shifts (disordered) over multiple recordings · Issue #309 · respeaker/seeed-voicecard (github.com)

I’m getting SSL certificate errors when I try to run. Is there a way to disable checking? (Sorry about formatting I don’t have much experience posting code)

Blockquote
ERROR:main:Unknown exception in the main thread
Traceback (most recent call last):
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1112, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1145, in _create_connection_transport
await waiter
File “/usr/local/lib/python3.11/asyncio/sslproto.py”, line 575, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.11/asyncio/sslproto.py”, line 557, in _do_handshake
self._sslobj.do_handshake()
File “/usr/local/lib/python3.11/ssl.py”, line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for ‘192.168.1.168’. (_ssl.c:1002)

BlockquoteThe above exception was the direct cause of the following exception:

Blockquote Traceback (most recent call last):
File “/home/admin/homeassistant-satellite/homeassistant_satellite/main.py”, line 234, in main
async with HAConnection(
File “/home/admin/homeassistant-satellite/homeassistant_satellite/ha_connection.py”, line 51, in aenter
self.__websocket = await self._websocket_context.aenter()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/client.py”, line 1141, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/client.py”, line 779, in _ws_connect
resp = await self.request(
^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/client.py”, line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 1206, in _create_direct_connection
raise last_exc
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/admin/homeassistant-satellite/.venv/lib/python3.11/site-packages/aiohttp/connector.py”, line 982, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 192.168.1.168:8123 ssl:True [SSLCertVerificationError: (1, “[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for ‘192.168.1.168’. (_ssl.c:1002)”)]
Recording raw data ‘stdin’ : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x758a4710>

I’ve had a quick look and don’t see anywhere in Voice Assist or the RasPi Homeassistant-satellite you could have turned SSL on.

Are you using https: to access your Home Assistant server at https://192.168.1.168:8123 ?
Are you using Docker on your homeassistant-satellite ?