Skip to content

Commit

Permalink
Merge pull request #14 from MiczFlor/develop
Browse files Browse the repository at this point in the history
fetch develop
  • Loading branch information
princemaxwell authored Oct 27, 2020
2 parents 2bbdefd + c04bb05 commit 659c8a8
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 38 deletions.
2 changes: 2 additions & 0 deletions components/gpio_control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Up to now the following input devices are implemented:

* **TwoButtonControl**:
This Device uses two Buttons and implements a third action if both buttons are pressed together.

Many example files are located in `~/RPi-Jukebox-RFID/components/gpio_control/example_configs/`.
2 changes: 1 addition & 1 deletion components/gpio_control/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [[ $(id -u) != 0 ]]; then
fi

if [[ ! -f /home/pi/RPi-Jukebox-RFID/settings/gpio_settings.ini ]]; then
mkdir -p ~/.config/phoniebox && cp /example_configs/gpio_settings.ini /home/pi/RPi-Jukebox-RFID/settings/gpio_settings.ini
cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/gpio_settings.ini.sample /home/pi/RPi-Jukebox-RFID/settings/gpio_settings.ini
fi

echo 'disable old services: phoniebox-gpio-buttons and phoniebox-rotary-encoder'
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions scripts/inc.writeGlobalConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ fi
# 2. then|or read value from file
IDLETIMESHUTDOWN=`cat $PATHDATA/../settings/Idle_Time_Before_Shutdown`

##############################################
# Poweroff_Command
# 1. create a default if file does not exist
if [ ! -f $PATHDATA/../settings/Poweroff_Command ]; then
echo "sudo poweroff" > $PATHDATA/../settings/Poweroff_Command
chmod 777 $PATHDATA/../settings/Poweroff_Command
fi
# 2. then|or read value from file
POWEROFFCMD=`cat $PATHDATA/../settings/Poweroff_Command`

##############################################
# ShowCover
# 1. create a default if file does not exist
Expand Down Expand Up @@ -274,6 +284,7 @@ CMDSEEKBACK=`grep 'CMDSEEKBACK' $PATHDATA/../settings/rfid_trigger_play.conf|tai
# AUDIOVOLSTARTUP
# VOLCHANGEIDLE
# IDLETIMESHUTDOWN
# POWEROFFCMD
# SHOWCOVER
# MAILWLANIPYN
# MAILWLANIPADDR
Expand Down Expand Up @@ -305,6 +316,7 @@ echo "AUDIOVOLMINLIMIT=\"${AUDIOVOLMINLIMIT}\"" >> "${PATHDATA}/../settings/glob
echo "AUDIOVOLSTARTUP=\"${AUDIOVOLSTARTUP}\"" >> "${PATHDATA}/../settings/global.conf"
echo "VOLCHANGEIDLE=\"${VOLCHANGEIDLE}\"" >> "${PATHDATA}/../settings/global.conf"
echo "IDLETIMESHUTDOWN=\"${IDLETIMESHUTDOWN}\"" >> "${PATHDATA}/../settings/global.conf"
echo "POWEROFFCMD=\"${POWEROFFCMD}\"" >> "${PATHDATA}/../settings/global.conf"
echo "SHOWCOVER=\"${SHOWCOVER}\"" >> "${PATHDATA}/../settings/global.conf"
echo "READWLANIPYN=\"${READWLANIPYN}\"" >> "${PATHDATA}/../settings/global.conf"
echo "EDITION=\"${EDITION}\"" >> "${PATHDATA}/../settings/global.conf"
Expand Down
216 changes: 186 additions & 30 deletions scripts/installscripts/buster-install-default-with-autohotspot.sh

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ install_main() {
${apt_get} ${allow_downgrades} install raspberrypi-kernel-headers
fi

${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php7.3-common php7.3-cgi php7.3 at mpd mpc mpg123 git ffmpeg resolvconf spi-tools
${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php7.3-common php7.3-cgi php7.3 at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat

# restore backup of /etc/resolv.conf in case installation of resolvconf cleared it
sudo cp /etc/resolv.conf.orig /etc/resolv.conf
Expand Down Expand Up @@ -940,9 +940,8 @@ install_main() {
if [[ "${GPIOconfig}" == "YES" ]]; then
sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-GPIO.txt
sudo systemctl enable phoniebox-gpio-control.service
if [[ ! -f ~/.config/phoniebox/gpio_settings.ini ]]; then
mkdir -p ~/.config/phoniebox
cp "${jukebox_dir}"/components/gpio_control/example_configs/gpio_settings.ini ~/.config/phoniebox/gpio_settings.ini
if [[ ! -f "${jukebox_dir}"/settings/gpio_settings.ini ]]; then
cp "${jukebox_dir}"/misc/sampleconfigs/gpio_settings.ini.sample "${jukebox_dir}"/settings/gpio_settings.ini
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/installscripts/tests/test_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ verify_apt_packages(){
local packages="libspotify-dev samba
samba-common-bin gcc lighttpd php7.3-common php7.3-cgi php7.3 at mpd mpc mpg123 git ffmpeg
resolvconf spi-tools python3 python3-dev python3-pip python3-mutagen python3-gpiozero
python3-spidev"
python3-spidev netcat"
# TODO apt-transport-https checking only on RPi is currently a workaround
local packages_raspberrypi="apt-transport-https raspberrypi-kernel-headers"
local packages_spotify="mopidy mopidy-mpd mopidy-local mopidy-spotify libspotify12
Expand Down
4 changes: 2 additions & 2 deletions scripts/playout_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ case $COMMAND in
sleep 1
/usr/bin/mpg123 ${PATHDATA}/../shared/shutdownsound.mp3
sleep 3
sudo poweroff
${POWEROFFCMD}
;;
shutdownsilent)
# doesn't play a shutdown sound
Expand All @@ -237,7 +237,7 @@ case $COMMAND in
#remove shuffle mode if active
SHUFFLE_STATUS=$(echo -e status\\nclose | nc -w 1 localhost 6600 | grep -o -P '(?<=random: ).*')
if [ "$SHUFFLE_STATUS" == 1 ] ; then mpc random off; fi
sudo poweroff
${POWEROFFCMD}
;;
shutdownafter)
# remove shutdown times if existent
Expand Down

0 comments on commit 659c8a8

Please sign in to comment.