Skip to content

Commit

Permalink
improve clock sync
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 2, 2024
1 parent ed94ebc commit 3ab5f44
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# Update package list and install necessary tools
echo "Updating base system..."
apt-get update
apt-get install -y --no-install-recommends jq git unzip curl build-essential
apt-get install -y --no-install-recommends jq git unzip curl build-essential fake-hwclock
# what else can be removed to make the system even lighter?
apt purge -y rfkill cups ppp

Expand Down
6 changes: 6 additions & 0 deletions build_raspOVOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ pip3 install ovos-audio-transformer-plugin-ggwave
#echo "Installing OVOS Spotifyd..."
#bash /mounted-github-repo/tuning/setup_spotify.sh

echo "Adding ntp sync signal..."
# emit "system.clock.synced" to the bus
mkdir -p /etc/systemd/system/systemd-timesyncd.service.d/
cp -v /mounted-github-repo/services/ovos-clock-sync.service /etc/systemd/system/systemd-timesyncd.service.d/ovos-clock-sync.conf
cp -v /mounted-github-repo/services/ovos-clock-sync /usr/libexec/ovos-clock-sync

echo "Installing Balena wifi plugin..."
pip3 install ovos-PHAL-plugin-balena-wifi ovos-PHAL-plugin-wifi-setup

Expand Down
10 changes: 10 additions & 0 deletions services/ovos-clock-sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import time

from ovos_bus_client.message import Message
from ovos_bus_client.util import get_mycroft_bus

bus = get_mycroft_bus()
bus.connected_event.wait()
bus.emit(Message("system.clock.synced"))
time.sleep(1)
bus.close()
2 changes: 2 additions & 0 deletions services/ovos-clock-sync.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
ExecStartPost=%h/.venvs/ovos/bin/python /usr/libexec/ovos-clock-sync

0 comments on commit 3ab5f44

Please sign in to comment.