Simplify procedure without button management
This commit is contained in:
parent
6acb64112b
commit
94c1b3ffa6
67
README.md
67
README.md
@ -1,24 +1,47 @@
|
|||||||
This project contain files to transform raspbian on web radio player with one button to manage.
|
This project contain files to transform raspbian on web radio player with mpd
|
||||||
|
|
||||||
#Installation
|
#Installation from raspbian
|
||||||
- Start from raspbian jessie 8
|
1. Config post-install : configure tzdata locales network and force jack audio output
|
||||||
- Add a simple push button on GPIO number 24.
|
```console
|
||||||
- Install mpd `apt install mpd mpc`
|
root@raspberrypi:/home/pi# raspi-config
|
||||||
- Copy/Paste btn_track.sh script in $HOME
|
```
|
||||||
- Create mpc.service
|
2. Update, upgrade and install mpd
|
||||||
`sudo nano /etc/systemd/system/mpc.service`
|
```console
|
||||||
|
root@raspberrypi:/home/pi# apt update && apt upgrade -y && apt install mpc mpd && systemctl enable mpd
|
||||||
|
```
|
||||||
|
3. Add your radio link on new file:
|
||||||
|
```console
|
||||||
|
root@raspberrypi:/home/pi# nano /var/lib/mpd/playlists/radios.m3u
|
||||||
|
```
|
||||||
|
for exemple
|
||||||
|
```txt
|
||||||
|
#France Inter
|
||||||
|
https://chai5she.cdn.dvmr.fr/franceinter-midfi.mp3
|
||||||
|
#Sing-Sing
|
||||||
|
http://stream.sing-sing.org:8000/singsing128
|
||||||
|
```
|
||||||
|
4. Ajust sound volume (100%)<br/>
|
||||||
|
`alsamixer`
|
||||||
|
5. Create bash script who autoplay radios on boot
|
||||||
|
```console
|
||||||
|
pi@raspberrypi:~ $ nano /home/pi/autoplay.sh
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
#Tricks
|
if mpc status | awk 'NR==2' | grep playing; then
|
||||||
- To speedup boot time, try to disable dhcp at boot and configure a static IP for rasp
|
echo "mpc déja lancé, je ne fait que passer..."
|
||||||
`cat /etc/network/interfaces`
|
else
|
||||||
|
echo "chargement des radios"
|
||||||
|
mpc clear
|
||||||
> \#iface eth0 inet manual <br>
|
mpc load radios
|
||||||
> auto eth0 <br>
|
mpc play
|
||||||
> iface eth0 inet static <br>
|
fi
|
||||||
> address 192.168.1.30 <br>
|
```
|
||||||
> netmask 255.255.255.0 <br>
|
6. Add crontab
|
||||||
> network 192.168.1.0 <br>
|
```console
|
||||||
> broadcast 192.168.1.255 <br>
|
pi@raspberrypi:~ $ crontab -e
|
||||||
> gateway 192.168.1.254 <br>
|
```
|
||||||
> dns-nameservers 91.121.161.184 188.165.197.144
|
```bash
|
||||||
|
@reboot sh /home/pi/autoplay.sh &
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user