AOU:initialisation du projet

This commit is contained in:
oantoine 2016-08-15 22:32:44 +02:00
commit d9fef1e417
5 changed files with 85 additions and 0 deletions

13
LICENSE Normal file
View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

9
README Normal file
View File

@ -0,0 +1,9 @@
This project contain files to transform raspbian on web radio player with one button to manage.
#Installation
- Start from raspbian jessie 8
- Add a simple push button on GPIO number 24.
- Install mpd `apt install mpd mpc`
- Copy/Paste btn_track.sh script in $HOME
- Create mpc.service
`sudo nano /etc/systemd/system/mpc.service`

40
btn_track.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
#Set GPIO ID with push button
GPIO_ID="24"
#Initialize GPIO
echo $GPIO_ID > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio$GPIO_ID/direction
#Start MPC
mpc clear
mpc load radios
mpc repeat on
mpc play
printf "MPC started"
i=0
echo "Loop"
while true
do
echo "Until"
until /bin/grep 1 /sys/class/gpio/gpio$GPIO_ID/value >> /dev/null
do
/bin/sleep .1
done
echo "End until"
i=$((i+1))
if [ $i -ge 30 ]
then
sudo systemctl poweroff
echo "Shutdown..."
break
fi
echo "Next Track"
/usr/bin/mpc next
done
echo "End loop"

11
mpc.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Mpc service
Requires=mpd.service
[Service]
Type=simple
User=pi
ExecStart=/bin/sh /home/pi/btn_track.sh
[Install]
WantedBy=multi-user.target

12
radios.m3u Normal file
View File

@ -0,0 +1,12 @@
#Inter
http://audio.scdn.arkena.com/11008/franceinter-midfi128.mp3
#Culture
#http://audio.scdn.arkena.com/11010/franceculture-midfi128.mp3
#FIP
#http://stream.dnm.radiofrance.fr/fip1-high.mp3
#sing sing
http://stream.sing-sing.org:8000/singsing128
#RTL
#http://streaming.radio.rtl.fr/rtl-1-44-96
#Paradise Radio
http://stream-uk1.radioparadise.com/mp3-192