Skip to content

Commit

Permalink
another attempt at fixing respeakerCoreV2 mraa issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Apr 8, 2023
1 parent 4240412 commit 0ae9cfd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ fi
systemctl is-active -q hermesledcontrol && systemctl stop hermesledcontrol

apt-get update
# mraa needs to be installed before venv creation that inherits system packages
apt-get install -y git mosquitto mosquitto-clients portaudio19-dev python3-numpy python-mraa libmraa1
apt-get install -y git mosquitto mosquitto-clients portaudio19-dev python3-numpy

FVENV=${USERDIR}'/HermesLedControl/'${VENV}

Expand Down
16 changes: 15 additions & 1 deletion installers/respeakerCoreV2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@ echo "############## Please run this script with sudo #######################"
USER=$1
FVENV=$2

PYTHON=$(command -v python3.9)
if [[ -z "$PYTHON" ]]; then
PYTHON=$(command -v python3.8)
if [[ -z "$PYTHON" ]]; then
PYTHON=$(command -v python3.7)
if [[ -z "$PYTHON" ]]; then
echo "Please make sure to have python 3.7 at least"
exit
fi
fi
fi

sudo -u ${USER} bash <<EOF
source ${FVENV}/bin/activate
pip3 uninstall -y gpiozero
pip3 uninstall -y RPi.GPIO
pip3 --no-cache-dir install numpy
EOF

# mraa is installed directly in install.sh before venv creation
apt-get install -y python-mraa libmraa1
cp -R /usr/lib/"${PYTHON}"/dist-packages/python-mraa "${FVENV}"/lib/"${PYTHON}"/site-packages/
chown "${USER}" "${FVENV}"/lib/"${PYTHON}"/site-packages/python-mraa

echo "############################## All done! ##############################"
echo "################################ Enjoy! ###############################"

0 comments on commit 0ae9cfd

Please sign in to comment.