Open vitalized opened 6 months ago
I would say you are blocking the satellite loop and causing a timeout in the ping-pong between the satellite and home assistant. By your timestamps, the scripts run for more than 5s.
I'll try to test something after I finish reinstalling everything with python 3.12 (which is loooooooong).
Not sure if this helps, but I have tried changing the _PONG_TIMEOUT
and _PING_SEND_DELAY
in the satellite.py file
/home/satellite1/wyoming-satellite/wyoming_satellite/satellite.py
_PONG_TIMEOUT: Final = 30
_PING_SEND_DELAY: Final = 30
_WAKE_INFO_TIMEOUT: Final = 2
Not sure if this helps, but I have tried changing the
_PONG_TIMEOUT
and_PING_SEND_DELAY
in the satellite.py file /home/satellite1/wyoming-satellite/wyoming_satellite/satellite.py
Didn't resolve?
I was able to replicate the behaviour if I block the detect
script.
However, I noticed what you really want is maybe the detection
script. And this one seem to not cause disconnection issue when blocked.
What I had in mind didn't work to solve it. You would need to change your script to something like a non blocking fire and forget.
Thank you so much for testing it and getting back to me. I kind of understand what you mean, but as you can see, I'm not really much of a coder. Can you explain what you mean by "You would need to change your script to something like a non blocking fire and forget.", or point me in the direction of info on how to make it a non-blocking script?
As a side note, what I'd really like is for the LED blinking to loop forever while the audio playback is happening (C-3PO is talking), then have a script to stop the LED blinking when the audio playback stops. Is this possible?
I have tried using a third script using the --tts-played-command
, but I can't get it to interact with the done.sh LED blinking script to stop the loop.
Hi all, The satellite keeps disconnecting and reconnecting to the server after almost every voice command. It's linked to using two Python scripts that control a servo (for R2-D2) and an LED (for C3-PO), which are used in the
--detect-command
and--tts-stop-command
--detect-command '/home/satellite1/wyoming-satellite/awake.sh' --tts-stop-command '/home/satellite1/wyoming-satellite/done.sh'
Here's the log from:
journalctl -u wyoming-satellite.service -f
These are the two lines below to look at: Mar 13 16:08:34 satellite1 run[2876]: INFO:root:Disconnected from server Mar 13 16:08:34 satellite1 run[2876]: INFO:root:Connected to serverawake.sh
done.sh
Here's the wyoming-satellite.service config:
Removing these two lines below from the config fixes the issue, so I assume there's something wrong with the scripts?!?! --detect-command '/home/satellite1/wyoming-satellite/awake.sh' --tts-stop-command '/home/satellite1/wyoming-satellite/done.sh'
Thanks in advance for any help.