rhasspy / rhasspy3

An open source voice assistant toolkit for many human languages
MIT License
295 stars 23 forks source link

satellite communication issue #14

Open yusinv opened 1 year ago

yusinv commented 1 year ago

it looks like some additional logic needed to handle scenario when base station sends tts result back to satellite and close connection.

ERROR:satellite_run:Unexpected error communicating with remote base station
Traceback (most recent call last):
  File "/home/pi/rhasspy3/bin/satellite_run.py", line 131, in main
    await async_write_event(mic_event, remote_proc.stdin)
  File "/home/pi/rhasspy3/rhasspy3/event.py", line 77, in async_write_event
    await writer.drain()
  File "/usr/lib/python3.9/asyncio/streams.py", line 387, in drain
    await self._protocol._drain_helper()
  File "/usr/lib/python3.9/asyncio/streams.py", line 197, in _drain_helper
    await waiter
BrokenPipeError

Simple code below will fix this. but im not sure that this is the right way to handle this

try
     await async_write_event(mic_event, remote_proc.stdin) 
except ..
ChrisB85 commented 12 months ago

I have just stucked with this. Each time base station i sending tts message to satellite it throws an exception. If I add try/except as suggested above then the satellite does not run wake word process anymore.