Skip to content

Commit

Permalink
🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 25, 2024
1 parent 80283d3 commit 97f74dd
Show file tree
Hide file tree
Showing 15 changed files with 329 additions and 14 deletions.
34 changes: 30 additions & 4 deletions build_raspOVOS.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash
# Exit on error
# If something goes wrong just stop.
# it allows the user to see issues at once rather than having
# scroll back and figure out what went wrong.
set -e

# Update package list and install necessary tools
echo "Updating base system..."
apt-get update
apt-get install -y --no-install-recommends git curl i2c-tools swig libssl-dev libfann-dev portaudio19-dev libpulse-dev
apt-get install -y --no-install-recommends git curl i2c-tools swig libssl-dev libfann-dev portaudio19-dev libpulse-dev build-essential python3-dev python3-pip

# setup ovos-i2csound
echo "Installing ovos-i2csound..."
git clone https://github.com/OpenVoiceOS/ovos-i2csound /tmp/ovos-i2csound

mkdir /etc/OpenVoiceOS
Expand All @@ -19,19 +26,38 @@ chmod +x /usr/libexec/ovos-i2csound
systemctl enable i2csound.service

# Create virtual environment for ovos
echo_green "Creating virtual environment..."
echo "Creating virtual environment..."
mkdir -p ~/.venvs
python3 -m venv ~/.venvs/ovos

# Activate the virtual environment
source ~/.venvs/ovos/bin/activate

# install OVOS in venv
echo_green "Installing OVOS..."
pip3 install sdnotify, tflite_runtime
echo "Installing OVOS..."
pip3 install sdnotify tflite_runtime
pip3 install ovos-core[lgpl,mycroft,plugins,skills-audio,skills-essential,skills-internet,skills-media]
pip3 install ovos-dinkum-listener[extras,linux,onnx]
pip3 install ovos-phal[extras,linux,mk1]


# copy system scripts over
cp -v /mounted-github-repo/ovos.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-skills.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-messagebus.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-audio.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-dinkum-listener.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-phal.service /home/pi/.config/systemd/user/
cp -v /mounted-github-repo/ovos-admin-phal.service /etc/systemd/system/

systemctl --user enable ovos
systemctl --user enable ovos-messagebus
systemctl --user enable ovos-dinkum-listener
systemctl --user enable ovos-audio
systemctl --user enable ovos-skills
systemctl --user enable ovos-phal
systemctl enable ovos-admin-phal

systemctl --user daemon-reload
systemctl daemon-reload
#chown -v pi:pi /home/pi/README.md
18 changes: 18 additions & 0 deletions ovos-admin-phal.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=OVOS ADMIN PHAL
PartOf=ovos.service
After=ovos.service
After=ovos-messagebus.service

[Service]
Type=notify
#User=ovos
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-admin-phal
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service
17 changes: 17 additions & 0 deletions ovos-audio.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=OVOS Audio
PartOf=ovos.service
After=ovos.service
After=ovos-messagebus.service

[Service]
Type=notify
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-audio
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service
18 changes: 18 additions & 0 deletions ovos-dinkum-listener.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=OVOS Dinkum Listener
PartOf=ovos.service
After=ovos.service
After=ovos-messagebus.service

[Service]
Type=notify
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-listener
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service

16 changes: 16 additions & 0 deletions ovos-messagebus.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=OVOS Messagebus
PartOf=ovos.service
After=ovos.service

[Service]
Type=notify
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-messagebus
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service
18 changes: 18 additions & 0 deletions ovos-phal.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=OVOS PHAL
PartOf=ovos.service
After=ovos.service
After=ovos-messagebus.service

[Service]
Type=notify
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-phal
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service

18 changes: 18 additions & 0 deletions ovos-skills.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=OVOS Skills
PartOf=ovos.service
After=ovos.service
After=ovos-messagebus.service

[Service]
Type=notify
ExecStart=/home/pi/.venvs/ovos/bin/python /usr/libexec/ovos-systemd-skills
TimeoutStartSec=10m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4

[Install]
WantedBy=ovos.service

33 changes: 33 additions & 0 deletions ovos-systemd-admin-phal
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
##########################################################################
# ovos-systemd-admin-phal.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from ovos_PHAL.admin import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of admin PHAL service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the admin PHAL service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
33 changes: 33 additions & 0 deletions ovos-systemd-audio
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
##########################################################################
# ovos-systemd_audio.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from ovos_audio.__main__ import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of OVOS Audio service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the OVOS Audio service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
19 changes: 19 additions & 0 deletions ovos-systemd-dinkum-listener
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3

import sdnotify
from ovos_dinkum_listener.__main__ import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of Mycroft Voice service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the Mycroft Voice service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
33 changes: 33 additions & 0 deletions ovos-systemd-messagebus
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
##########################################################################
# ovos-systemd_messagebus.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from ovos_messagebus.__main__ import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of OVOS Messagebus service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the OVOS Messagebus service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
33 changes: 33 additions & 0 deletions ovos-systemd-phal
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
##########################################################################
# ovos-systemd_enclosure.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from ovos_PHAL.__main__ import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of OVOS PHAL service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the OVOS PHAL service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
33 changes: 33 additions & 0 deletions ovos-systemd-skills
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
##########################################################################
# ovos-systemd_skills.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from ovos_core.__main__ import main

n = sdnotify.SystemdNotifier()


def notify_ready():
n.notify('READY=1')
print('Startup of OVOS Skills service complete')


def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the OVOS Skills service')


main(ready_hook=notify_ready, stopping_hook=notify_stopping)
10 changes: 10 additions & 0 deletions ovos.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=OVOS A.I. Software stack.

[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes

[Install]
WantedBy=default.target
10 changes: 0 additions & 10 deletions scenario.yaml

This file was deleted.

0 comments on commit 97f74dd

Please sign in to comment.