Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed formatting warnings #872

Merged
merged 25 commits into from
Apr 11, 2020
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
543fcd8
save used git commit hash to version file (see #828)
s-martin Mar 4, 2020
7d69c9d
added first idea
s-martin Mar 4, 2020
13346f9
Get rid of debconf: falling back to frontend: Readline messages while…
Mar 10, 2020
88c599e
Adapt for stretch dockerfile
Mar 10, 2020
35eee1a
Merge remote-tracking branch 'upstream/develop' into develop
Groovylein Mar 10, 2020
a5b11e4
Added functions for logging
Groovylein Mar 11, 2020
d23974b
Enable Logging during the installation
Groovylein Mar 11, 2020
050f620
Added config file information into logging
Groovylein Mar 11, 2020
d7b06c1
Updated comments
Groovylein Mar 11, 2020
286343b
Merge branch 'develop' into improve_version
s-martin Mar 20, 2020
8be7297
Merge branch 'develop' into improve_version
s-martin Mar 22, 2020
616985d
Merge branch 'improve_version' of https://github.com/s-martin/RPi-Juk…
s-martin Mar 22, 2020
18352dc
Merge branch 'develop' into improve_version
s-martin Mar 22, 2020
2c47b7b
fixed flake8 warnings
s-martin Mar 22, 2020
f53becd
read current commit from Github
s-martin Mar 22, 2020
f3187fd
Merge pull request #856 from Groovylein/develop
MiczFlor Mar 23, 2020
53ecb53
Merge pull request #831 from s-martin/improve_version
MiczFlor Mar 23, 2020
988b017
Consolidate install scripts (#871)
fredg02 Mar 30, 2020
39ff5bc
Add info about pkg installation (#879)
s-martin Mar 30, 2020
9f18c21
added missing sudo
s-martin Mar 30, 2020
f7ccaf2
Update Detect rfidoff function in gpio-buttons.py (#869)
MalteHST Apr 6, 2020
4f72dc8
add empty header context to spotify requests, fixes title and cover d…
lovethisshit Apr 6, 2020
0027f43
Add info how to post logging info (#882)
s-martin Apr 6, 2020
814572c
fixed flake8 warnings
s-martin Mar 22, 2020
0e43f37
Merge branch 'develop' of https://github.com/s-martin/RPi-Jukebox-RFI…
s-martin Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
@@ -28,6 +28,8 @@ i.e. `I would have expected that this command would magically fix itself when it
### Further information that might help

<!--
Please post here the output of 'tail -n 500 /var/log/syslog' or 'journalctl -u mopidy' ( Spotify edition only)

i.e. `find logfiles at https://paste.ubuntu.com/p/cRS7qM8ZmP/`
-->

6 changes: 6 additions & 0 deletions components/smart-home-automation/MQTT-protocol/README.md
Original file line number Diff line number Diff line change
@@ -109,6 +109,12 @@ Sending empty payload to `phoniebox/cmd/help` will be responded by a list of all

# Installation

Install missing python packages for MQTT:

~~~
sudo pip3 install paho-mqtt
~~~

All relevant files can be found in the folder:

~~~
8 changes: 4 additions & 4 deletions htdocs/inc.viewFolderTree.php
Original file line number Diff line number Diff line change
@@ -117,18 +117,18 @@
// this is for loading spotify informations!
$track = file_get_contents($subfolder."/spotify.txt");
$url = "https://open.spotify.com/oembed/?url=".trim($track)."&format=json";

$context = stream_context_create(array());

if (!file_exists($check1)) {
$str = file_get_contents($url);
$str = file_get_contents($url, false, $context);
$json = json_decode($str, true);

$cover = $json['thumbnail_url'];
$coverdl = file_get_contents($cover);
file_put_contents($check1, $coverdl);
}

if (!file_exists($check2)) {
$str = file_get_contents($url);
$str = file_get_contents($url, false, $context);
$json = json_decode($str, true);

$title = $json['title'];
66 changes: 46 additions & 20 deletions misc/sampleconfigs/gpio-buttons.py.sample
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ from time import sleep
# I have not yet had the time to test is, so I placed it in the misc folder.
# If anybody has ideas or tests or experience regarding this solution, please create pull requests or contact me.


# This function takes a holding time (fractional seconds), a channel, a GPIO state and an action reference (function).
# It checks if the GPIO is in the state since the function was called. If the state
# changes it return False. If the time is over the function returns True.
@@ -41,39 +42,59 @@ def checkGpioStaysInState(holdingTime, gpioChannel, gpioHoldingState):
while(holdingTime >= (time.perf_counter() - startTime)):
# Return if state does not match holding state
if(gpioHoldingState != GPIO.input(gpioChannel)):
return False
return False
# Else: Wait
return True


# Actions that call other processes of the phoniebox (Channel Parameter needed by RPi.GPIO)
def shutdown_action(channel):
check_call("./scripts/playout_controls.sh -c=shutdown", shell=True)


def vol0_action(channel):
check_call("./scripts/playout_controls.sh -c=mute", shell=True)


def volD_action(channel):
check_call("./scripts/playout_controls.sh -c=volumedown", shell=True)


def volU_action(channel):
check_call("./scripts/playout_controls.sh -c=volumeup", shell=True)


def next_action(channel):
check_call("./scripts/playout_controls.sh -c=playernext", shell=True)


def prev_action(channel):
check_call("./scripts/playout_controls.sh -c=playerprev", shell=True)


def halt_action(channel):
check_call("./scripts/playout_controls.sh -c=playerpause", shell=True)


def recordstart_action(channel):
check_call("./scripts/playout_controls.sh -c=recordstart", shell=True)


def recordstop_action(channel):
check_call("./scripts/playout_controls.sh -c=recordstop", shell=True)


def recordplaylatest_action(channel):
check_call("./scripts/playout_controls.sh -c=recordplaylatest", shell=True)
def rfidoff_action():
def rfidoff_action(channel):
check_call("./scripts/playout_controls.sh -c=playerpauseforce", shell=True)


# Handlers that handle special behavior of the push of a button
# When the shutdown button was held for more than 2 seconds LED flashed and afterwards
# When the shutdown button was held for more than 2 seconds LED flashed and afterwards
def shutdown_handler(channel):
# Detect holding of button
if True == checkGpioStaysInState(shutdownHoldTime, btn_shut, GPIO.LOW):
if checkGpioStaysInState(shutdownHoldTime, btn_shut, GPIO.LOW) is True:
# Blink LED
for x in range(0, 10):
GPIO.output(led_power, x & 1)
@@ -82,7 +103,8 @@ def shutdown_handler(channel):
GPIO.output(led_power, GPIO.HIGH)
# Shutdown afterwards
shutdown_action(channel)



# When the Volume Down button was held for more than 0.3 seconds every 0.3 seconds he will lower t$
def volU_handler(channel):
# Rise volume as requested
@@ -91,6 +113,7 @@ def volU_handler(channel):
while checkGpioStaysInState(volumeHoldTime, btn_volU, GPIO.LOW):
volU_action(channel)


# When the Volume Up button was held for more than 0.3 seconds every 0.3 seconds he will call a ra$
def volD_handler(channel):
# Rise volume as requested
@@ -99,6 +122,7 @@ def volD_handler(channel):
while checkGpioStaysInState(volumeHoldTime, btn_volD, GPIO.LOW):
volD_action(channel)


# Define the used pins of the raspberry board
btn_shut = 3
btn_vol0 = 13
@@ -108,28 +132,29 @@ btn_next = 26
btn_prev = 20
btn_halt = 21
led_power = 12
#reco =
#play =
# btn_rfidoff =
# reco =
# play =

# Set GPIO numbering to BCM instead of board numbering
GPIO.setmode(GPIO.BCM)
# Bounce tolerance time for buttons
bouncetime = 500
volumeHoldTime = 0.3 # Seconds
shutdownHoldTime = 2 # Seconds
volumeHoldTime = 0.3 # Seconds
shutdownHoldTime = 2 # Seconds
PledBlinkTime = 0.3 # Seconds

# Set up GPIO pins and the power led
GPIO.setup(btn_shut , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_vol0 , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_volU , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_volD , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_next , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_prev , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_halt , GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(btn_rfidoff, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(led_power , GPIO.OUT)
# btn_rfidoff = Button(12,pull_up=True)
GPIO.setup(btn_shut, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_vol0, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_volU, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_volD, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_next, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_prev, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_halt, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# GPIO.setup(btn_rfidoff, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(led_power, GPIO.OUT)


# Set standard events for the buttons. Callback functions define the actions of the events (THey are defined above)
GPIO.add_event_detect(btn_shut, GPIO.FALLING, callback=shutdown_handler, bouncetime=bouncetime)
@@ -139,10 +164,11 @@ GPIO.add_event_detect(btn_volD, GPIO.FALLING, callback=volD_handler, bouncetime=
GPIO.add_event_detect(btn_next, GPIO.FALLING, callback=next_action, bouncetime=bouncetime)
GPIO.add_event_detect(btn_prev, GPIO.FALLING, callback=prev_action, bouncetime=bouncetime)
GPIO.add_event_detect(btn_halt, GPIO.FALLING, callback=halt_action, bouncetime=bouncetime)
#GPIO.add_event_detect(btn_rfidoff, GPIO.FALLING, callback=rfidoff_action, bouncetime=bouncetime)
#reco.when_pressed = recordstart_action
#reco.when_released = recordstop_action
#play.when_pressed = recordplaylatest_action
#GPIO.add_event_detect(btn_rfidoff, GPIO.FALLING, callback=rfidoff_action, bouncetime=bouncetime)


# Switch on power led after boot to indicate state "on" for phoniebox
GPIO.output(led_power, GPIO.HIGH)
66 changes: 61 additions & 5 deletions scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
@@ -7,6 +7,44 @@
PATHDATA="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GIT_BRANCH=${GIT_BRANCH:-master}

LOGDIR=${PATHDATA}/logfiles
DATE=$(date +"%Y%m%d")
DATETIME=$(date +"%Y%m%d_%H%M%S")

SCRIPTNAME="$(basename $0)"
JOB="${SCRIPTNAME}"

# Setup logger functions
# Input from http://www.ludovicocaldara.net/dba/bash-tips-5-output-logfile/
function Log_Open() {
[[ -d ${LOGDIR} ]] || mkdir -p ${LOGDIR}
PIPE=${LOGDIR}/${JOB}_${DATETIME}.pipe
mkfifo -m 700 ${PIPE}
LOGFILE=${LOGDIR}/${JOB}_${DATETIME}.log
exec 3>&1
tee ${LOGFILE} <${PIPE} >&3 &
TEEPID=$!
exec 1>${PIPE} 2>&1
PIPE_OPENED=1
}

function Log_Close() {
if [ ${PIPE_OPENED} ] ; then
exec 1<&3
sleep 0.2
ps --pid ${TEEPID} >/dev/null
if [ $? -eq 0 ] ; then
# a wait ${TEEPID} whould be better but some
# commands leave file descriptors open
sleep 1
kill ${TEEPID}
fi
rm ${PIPE}
unset PIPE_OPENED
fi
}


clear
echo "#####################################################
# ___ __ ______ _ __________ ____ __ _ _ #
@@ -139,6 +177,9 @@ echo "#####################################################
# check if we find the version number
if [ -f /home/pi/RPi-Jukebox-RFID/settings/version ]; then
echo "The version of your installation is: $(cat RPi-Jukebox-RFID/settings/version)"

# get the current short commit hash of the repo
CURRENT_REMOTE_COMMIT="$(git ls-remote https://github.com/MiczFlor/RPi-Jukebox-RFID.git ${GIT_BRANCH} | cut -c1-7)"
fi
echo "IMPORTANT: you can use the existing content and configuration files for your new install."
echo "Whatever you chose to keep will be moved to the new install."
@@ -456,6 +497,14 @@ case "$response" in
;;
esac

# Start logging here
Log_Open

# Add conffile into logfile for better debugging
echo "################################################"
grep -v -e "SPOTI" -e "WIFIpass" "${PATHDATA}/PhonieboxInstall.conf"
echo "################################################"

#####################################################
# INSTALLATION

@@ -507,6 +556,10 @@ git clone https://github.com/MiczFlor/RPi-Jukebox-RFID.git --branch "${GIT_BRANC
# check, which branch was cloned
git --work-tree=/home/pi/RPi-Jukebox-RFID --git-dir=/home/pi/RPi-Jukebox-RFID/.git status | head -2

# add git commit hash to version file
COMMIT_NO="$(git describe --always)"
sudo sed -i 's/%GIT_COMMIT%/'"$COMMIT_NO"'/' /home/pi/RPi-Jukebox-RFID/settings/version

# Install required spotify packages
if [ $SPOTinstall == "YES" ]
then
@@ -811,9 +864,6 @@ mkdir /home/pi/RPi-Jukebox-RFID/playlists
sudo chown -R pi:www-data /home/pi/RPi-Jukebox-RFID/playlists
sudo chmod -R 775 /home/pi/RPi-Jukebox-RFID/playlists

sudo chown -R pi:www-data /home/pi/RPi-Jukebox-RFID/playlists
sudo chmod -R 775 /home/pi/RPi-Jukebox-RFID/playlists

# make sure the shared folder is accessible by the web server
sudo chown -R pi:www-data /home/pi/RPi-Jukebox-RFID/shared
sudo chmod -R 775 /home/pi/RPi-Jukebox-RFID/shared
@@ -864,7 +914,8 @@ echo "

echo "If you are using an USB RFID reader, connect it to your RPi."
echo "(In case your RFID reader required soldering, consult the manual.)"
read -r -p "Have you connected your USB Reader? [Y/n] " response
# Use -e to display response of user in the logfile
read -e -r -p "Have you connected your USB Reader? [Y/n] " response
case "$response" in
[nN][oO]|[nN])
;;
@@ -882,11 +933,16 @@ echo "Find more information and documentation on the github account:"
echo "https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/"

echo "Reboot is needed to activate all settings"
read -r -p "Would you like to reboot now? [Y/n] " response
# Use -e to display response of user in the logfile
read -e -r -p "Would you like to reboot now? [Y/n] " response
case "$response" in
[nN][oO]|[nN])
# Close logging
Log_Close
;;
*)
# Close logging
Log_Close
sudo shutdown -r now
;;
esac
173 changes: 151 additions & 22 deletions scripts/installscripts/stretch-install-default.sh
Original file line number Diff line number Diff line change
@@ -277,6 +277,79 @@ echo "Your iFace is called'$AUDIOiFace'"
echo "Hit ENTER to proceed to the next step."
read -r INPUT

#####################################################
# Configure spotify

clear

echo "#####################################################
#
# OPTIONAL: INCLUDE SPOTIFY SUPPORT
#
# Spotify uses Mopidy for audio output and must
# be configured. Do it now, or never.
# (Note: To add this later, you must re-install phoniebox)
"
read -r -p "Do you want to install Mopidy? [Y/n] " response
case "$response" in
[nN][oO]|[nN])
SPOTinstall=NO
echo "You don't want spotify support."
echo "Hit ENTER to proceed to the next step."
read -r INPUT
;;
*)
SPOTinstall=YES
clear
echo "This was a great decision! Mopidy will be set up."
echo "#####################################################
#
# CONFIGURE MOPIDY
#
# Requires spotify username, password, client_id and client_secret
# to get connection to Spotify.
#
# (Note: You need a device with browser to generate ID and SECRET)
#
# Please go to this website:
# https://www.mopidy.com/authenticate/
# and follow the instructions.
#
# Your credential will appear on the site below the login button.
# Please note your client_id and client_secret!
#
"
echo ""
echo "Type your Spotify username:"
read -r INPUT
SPOTIuser="$INPUT"
echo ""
echo "Type your Spotify password:"
read -r INPUT
SPOTIpass="$INPUT"
echo ""
echo "Type your client_id:"
read -r INPUT
SPOTIclientid="$INPUT"
echo ""
echo "Type your client_secret:"
read -r INPUT
SPOTIclientsecret="$INPUT"
echo ""
echo "Hit ENTER to proceed to the next step."
read -r INPUT
;;
esac
# append variables to config file
{
echo "SPOTinstall=\"$SPOTinstall\"";
echo "SPOTIuser=\"$SPOTIuser\"";
echo "SPOTIpass=\"$SPOTIpass\"";
echo "SPOTIclientid=\"$SPOTIclientid\"";
echo "SPOTIclientsecret=\"$SPOTIclientsecret\""
} >> "${PATHDATA}/PhonieboxInstall.conf"

if [ $SPOTinstall == "NO" ]; then
#####################################################
# Configure MPD

@@ -307,6 +380,7 @@ case "$response" in
esac
# append variables to config file
echo "MPDconfig=\"$MPDconfig\"" >> "${PATHDATA}/PhonieboxInstall.conf"
fi

#####################################################
# Folder path for audio files
@@ -382,7 +456,7 @@ esac
# (this might look stupid so far, but makes sense once
# the option to install from config file is introduced.)
# shellcheck source=scripts/installscripts/tests/ShellCheck/PhonieboxInstall.conf
. "$PATHDATA/PhonieboxInstall.conf"
. "${PATHDATA}/PhonieboxInstall.conf"

# power management of wifi: switch off to avoid disconnecting
sudo iwconfig wlan0 power off
@@ -397,6 +471,30 @@ sudo apt-get --yes --force-yes install python3-dev python3-pip python3-mutagen p

# use python3.5 as default
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
# Install required spotify packages
if [ $SPOTinstall == "YES" ]
then
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/stretch.list
sudo apt-get update
sudo apt-get --yes --force-yes install mopidy
sudo apt-get --yes --force-yes install libspotify12 python-cffi python-ply python-pycparser python-spotify
sudo apt-get --yes --force-yes install libspotify12 python3-cffi python3-ply python3-pycparser
sudo python3 -m pip install spotify
sudo rm -rf /usr/lib/python2.7/dist-packages/mopidy_spotify*
sudo rm -rf /usr/lib/python2.7/dist-packages/Mopidy_Spotify-*
cd || exit
sudo rm -rf mopidy-spotify
git clone -b fix/web_api_playlists --single-branch https://github.com/princemaxwell/mopidy-spotify.git
cd mopidy-spotify || exit
sudo python setup.py install
cd || exit
# should be removed, if Mopidy-Iris can be installed normally
# pylast >= 3.0.0 removed the python2 support
sudo pip install pylast==2.4.0
sudo pip install Mopidy-Iris
fi

# Get github code
cd /home/pi/ || exit
git clone https://github.com/MiczFlor/RPi-Jukebox-RFID.git --branch "${GIT_BRANCH}"
@@ -412,7 +510,7 @@ git fetch
sudo pip install -r requirements.txt
sudo pip3 install -r /home/pi/RPi-Jukebox-RFID/components/rfid-reader/PN532/requirements.txt

# actually, for the time being most of the requirements are run here.
# actually, for the time being most of the requirements are run here (again).
# the requirements.txt version seems to throw errors. Help if you can to fix this:

sudo pip install "evdev == 0.7.0"
@@ -534,18 +632,45 @@ sudo systemctl enable phoniebox-gpio-buttons
cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/startupsound.mp3.sample /home/pi/RPi-Jukebox-RFID/shared/startupsound.mp3
cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/shutdownsound.mp3.sample /home/pi/RPi-Jukebox-RFID/shared/shutdownsound.mp3

# MPD configuration
# -rw-r----- 1 mpd audio 14043 Jul 17 20:16 /etc/mpd.conf
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/mpd.conf.sample /etc/mpd.conf
# Change vars to match install config
sudo sed -i 's/%AUDIOiFace%/'"$AUDIOiFace"'/' /etc/mpd.conf
# for $DIRaudioFolders using | as alternate regex delimiter because of the folder path slash
sudo sed -i 's|%DIRaudioFolders%|'"$DIRaudioFolders"'|' /etc/mpd.conf
echo "classic" > /home/pi/RPi-Jukebox-RFID/settings/edition
sudo chown mpd:audio /etc/mpd.conf
sudo chmod 640 /etc/mpd.conf
# update mpc / mpd DB
mpc update
if [ $SPOTinstall == "NO" ]
then
# MPD configuration
# -rw-r----- 1 mpd audio 14043 Jul 17 20:16 /etc/mpd.conf
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/mpd.conf.sample /etc/mpd.conf
# Change vars to match install config
sudo sed -i 's/%AUDIOiFace%/'"$AUDIOiFace"'/' /etc/mpd.conf
# for $DIRaudioFolders using | as alternate regex delimiter because of the folder path slash
sudo sed -i 's|%DIRaudioFolders%|'"$DIRaudioFolders"'|' /etc/mpd.conf
echo "classic" > /home/pi/RPi-Jukebox-RFID/settings/edition
sudo chown mpd:audio /etc/mpd.conf
sudo chmod 640 /etc/mpd.conf
# update mpc / mpd DB
mpc update
fi

if [ $SPOTinstall == "YES" ]
then
sudo systemctl disable mpd
sudo systemctl enable mopidy
# Install Config Files
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/locale.gen.sample /etc/locale.gen
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/locale.sample /etc/default/locale
sudo locale-gen
sudo mkdir /home/pi/.config
sudo mkdir /home/pi/.config/mopidy
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/mopidy-etc.sample /etc/mopidy/mopidy.conf
sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/mopidy.sample ~/.config/mopidy/mopidy.conf
echo "plusSpotify" > /home/pi/RPi-Jukebox-RFID/settings/edition
# Change vars to match install config
sudo sed -i 's/%spotify_username%/'"$SPOTIuser"'/' /etc/mopidy/mopidy.conf
sudo sed -i 's/%spotify_password%/'"$SPOTIpass"'/' /etc/mopidy/mopidy.conf
sudo sed -i 's/%spotify_client_id%/'"$SPOTIclientid"'/' /etc/mopidy/mopidy.conf
sudo sed -i 's/%spotify_client_secret%/'"$SPOTIclientsecret"'/' /etc/mopidy/mopidy.conf
sudo sed -i 's/%spotify_username%/'"$SPOTIuser"'/' ~/.config/mopidy/mopidy.conf
sudo sed -i 's/%spotify_password%/'"$SPOTIpass"'/' ~/.config/mopidy/mopidy.conf
sudo sed -i 's/%spotify_client_id%/'"$SPOTIclientid"'/' ~/.config/mopidy/mopidy.conf
sudo sed -i 's/%spotify_client_secret%/'"$SPOTIclientsecret"'/' ~/.config/mopidy/mopidy.conf
fi

###############################
# WiFi settings (SSID password)
@@ -577,7 +702,6 @@ then
sudo sed -i 's/%WIFIcountryCode%/'"$WIFIcountryCode"'/' /etc/wpa_supplicant/wpa_supplicant.conf
sudo chown root:netdev /etc/wpa_supplicant/wpa_supplicant.conf
sudo chmod 664 /etc/wpa_supplicant/wpa_supplicant.conf

fi

# start DHCP
@@ -716,21 +840,26 @@ echo
echo "DONE. Let the sounds begin."
echo "Find more information and documentation on the github account:"
echo "https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/"
echo ""

#####################################################

read -r -p "Reboot now? [Y/n] " response
case "$response" in
[nN][oO]|[nN])
echo "You have to reboot manually!"
;;
*)
sudo reboot
;;
esac

# notes for things to do

# Soundcard
# PCM is currently set
# This needs to be done for mpd and in settings folder



#Ask if Spotify config
#If Spotify
#Ask for user
#Ask for password

#Ask ssh password

# get existing install
870 changes: 0 additions & 870 deletions scripts/installscripts/stretch-install-spotify.sh

This file was deleted.

2 changes: 1 addition & 1 deletion settings/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0rc8
2.0 %GIT_COMMIT%