Skip to content
Browse files

updated Joustmania to raspian buster

  • Loading branch information...
adangert committed Jul 18, 2019
1 parent f4b229f commit a18754e53d69f56981d31142a5ec602137b83b65
Showing with 19 additions and 32 deletions.
  1. 0 .gitmodules
  2. +0 −1 psmoveapi
  3. +19 −31
No changes.
Submodule psmoveapi deleted from 99f1f9
@@ -1,20 +1,16 @@

setup() {
# Prevent apt from prompting us about restarting services.
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -y espeak

espeak "starting software upgrade"
#update OS
sudo cp -v conf/sources.list /etc/apt/sources.list || exit -1
sudo cp -v conf/apt.conf /etc/apt/apt.conf.d/10joustmania-conf || exit -1
#espeak doesn't work at the moment, figure out why
#espeak "starting software upgrade"
sudo apt-get update -y || exit -1
sudo apt-get upgrade -y || exit -1
sudo apt-get dist-upgrade -y || exit -1
cd /home/pi
espeak "Installing required software dependencies"
#espeak "Installing required software dependencies"
#TODO: remove pyaudio and dependencies
#install components
sudo apt-get install -y \
@@ -29,41 +25,39 @@ setup() {
alsa-utils alsa-tools libasound2-dev \
python-dbus-dev libdbus-glib-1-dev espeak || exit -1

espeak "Installing PS move A.P.I. software updates"
#espeak "Installing PS move A.P.I. software updates"
#install components for psmoveapi
sudo apt-get install -y \
build-essential \
libv4l-dev libopencv-dev \
libudev-dev libbluetooth-dev \
swig3.0 || exit -1

espeak "Installing software libraries"
#espeak "Installing software libraries"
# We install nearly all python deps in the virtualenv to avoid concflicts with system, except
# numpy and scipy because they take forever to build.
sudo apt-get install -y -t buster libasound2-dev libasound2 python3-scipy cmake || exit -1
sudo apt-get install -y libasound2-dev libasound2 python3-scipy cmake || exit -1

#install the python3 dev environment
sudo apt-get install -y python3-dev || exit -1
sudo python3 -m pip install --upgrade virtualenv || exit -1

espeak "installing virtual environment"
#espeak "installing virtual environment"
# Rebuilding this is pretty cheap, so just do it every time.
rm -rf $VENV
/usr/bin/python3 -m virtualenv --system-site-packages $VENV || exit -1
espeak "installing virtual environment dependencies"
#espeak "installing virtual environment dependencies"
$PYTHON -m pip install --ignore-installed psutil flask Flask-WTF pyalsaaudio pydub pygame pyaudio pyyaml dbus-python || exit -1

espeak "downloading PS move API"
#install psmoveapi
#espeak "downloading PS move API"
#install psmoveapi (currently adangert's for opencv 3 support)
rm -rf psmoveapi
git clone --recursive git://
git clone --recursive git://
cd psmoveapi

espeak "compiling PS move API components"
#espeak "compiling PS move API components"
mkdir build
cd build
# we definitely don't need java, opengj, csharp, etc
@@ -81,35 +75,29 @@ setup() {

#installs custom supervisor script for running joustmania on startup
sudo cp -r /home/pi/JoustMania/conf/supervisor/ /etc/

#sound card is not required anymore TODO: eventually delete
#makes sound card 1(usb audio) to be default output
#use aplay -l to check sound card number
#sudo cp /home/pi/JoustMania/asound.conf /etc/

#Use amixer to set sound output to 100%
amixer sset PCM,0 100%
sudo alsactl store

#This will disable on-board bluetooth
#This will disable on-board bluetooth with the --disable_internal_bt command line option
#This will allow only class one long range btdongles to connect to psmove controllers
sudo grep -qxF 'dtoverlay=pi3-disable-bt' /boot/config.txt || { echo "dtoverlay=pi3-disable-bt" | sudo tee -a /boot/config.txt; sudo rm -rf /var/lib/bluetooth/*; }
sudo systemctl disable hciuart || exit -1
if [ "$1" = "--disable_internal_bt" ]; then
sudo grep -qxF 'dtoverlay=pi3-disable-bt' /boot/config.txt || { echo "dtoverlay=pi3-disable-bt" | sudo tee -a /boot/config.txt; sudo rm -rf /var/lib/bluetooth/*; }
sudo systemctl disable hciuart || exit -1

uname2="$(stat --format '%U' '/home/pi/JoustMania/')"
uname3="$(stat --format '%U' '/home/pi/JoustMania/')"
if [ "${uname2}" = "root" ] || [ "${uname3}" = "root" ] ; then
sudo chown -R pi:pi /home/pi/JoustMania/
espeak "permisions updated, please wait after reboot for Joustmania to start"
#espeak "permisions updated, please wait after reboot for Joustmania to start"
echo "no permissions to update"

#Newest Kernel version breaks psmove controller support, need to downgrade to one that works.
sudo rpi-update 00bb2894c0a4349464c19ba62f62b8d9e17a1a9e

espeak "Joustmania successfully updated, now rebooting"
#espeak "Joustmania successfully updated, now rebooting"
# Pause a second before rebooting so we can see all the output from this script.
(sleep 1; sudo reboot) &

0 comments on commit a18754e

Please sign in to comment.
You can’t perform that action at this time.