# My Second RPI Volumio project !!!

**URL:** <https://community.volumio.com/t/my-second-rpi-volumio-project/2488>\
**Category:** Diy Volumio Projects\
**Created:** [February 20, 2015, 6:02pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488 "2015-02-20T18:02:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [February 20, 2015, 6:02pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/1 "2015-02-20T18:02:23Z")

</div>

Dear All,  
I’m proud to share with you some pictures of my last -nearly finished - project.  
It is based on a RPI b+ with a PI DAC+ and an amplifier PI-AMP+ both from IQAUDIO.  
I add a 2x16 lcd display that displays :

- At startup a welcome message and the IP Adress from power on to end of boot.
- As soon as mpd start playing, the song , the artist, and time are displayed thanks to mpdlcd.
- The volume is displayed 3 seconds when it is changes and the display return to mpdlcd  
I add also add buttons :  
front face : previous  
next  
stop  
play - pause  
a rotary coder to set the volume  
back : a shtudown button  
a unused yet button (reboot or some info I don’t know, I’ll see later)  
Buttons are from a old remote 😃 and I bought some micro switch (\<2€ on ebay /100 shipping included 🕶 ).  
I wrote several python scripts to managed all that. A script unmute the amp after boot ( thank you Gordon). A other script check every 10 sec if mpdlcd is still alive because some tags (due to some tag software) hang it. … The only option is to retag all the song with this problem… But with the script it restart  
asap you change the song 😉  
The power supply is the one sold with the PI AMP+  
The stainless steel case is home designed, and realise in lasercut and sheetmetal bending.  
Now I’m looking for a nice button for the volume setting.  
I use a wifi dongle and the music is store a NAS (D-link).  
The sound : Great ! 😃 The amp drives 3 ways loudspeakers (old 3A 420). It’s very impressive how a 2x20w amp drive it!  
That it!  
 ![vuense2.JPG](https://community.volumio.com/uploads/default/original/2X/1/1af59754de6300110b80ade6acafe5a1628e7f01.jpeg)  
 ![volip.JPG](https://community.volumio.com/uploads/default/original/2X/4/4af32cff9fbd8dd813d5833658590739ba48c0b7.jpeg)  
 ![hag.JPG](https://community.volumio.com/uploads/default/original/2X/7/73efc9111fe3998d2e4b806c4151f844cb6d7b50.jpeg)  
 ![favs.JPG](https://community.volumio.com/uploads/default/original/2X/0/0ddf851e81c749a86effc2f02ea9a018f36066ec.jpeg)  
 ![facvol.JPG](https://community.volumio.com/uploads/default/original/2X/c/c7844cd556f42d5d39d47ca69a7449082307bf6a.jpeg)  
 ![bottom.JPG](https://community.volumio.com/uploads/default/original/2X/0/00df275c0d27ff3669b5fcfe9fd9cbefa1ee117d.jpeg)  
 ![back.JPG](https://community.volumio.com/uploads/default/original/2X/5/57b5ed124621a3e620107b02a48c7a73319e3567.jpeg)  
 ![ardr.JPG](https://community.volumio.com/uploads/default/original/2X/4/4e69ca3bb13e0af93b74ca4fc5280d6a498ada6e.jpeg)

---

<div class="post-metadata">

**Author:** ![gswg](https://community.volumio.com/letter_avatar_proxy/v4/letter/g/65b543/32.png) [@gswg](https://community.volumio.com/u/gswg)\
**Post date:** [February 20, 2015, 6:14pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/2 "2015-02-20T18:14:57Z")

</div>

Looks awesome - please share pictures of the speakers too - and yes the little Pi-AMP+ does bang out some beats!

[Gordon@iqaudio.com](mailto:Gordon@iqaudio.com)

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [February 20, 2015, 7:54pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/3 "2015-02-20T19:54:39Z")

</div>

As asked, a picture of the speakers !!!  
 ![3a 420.jpg](https://community.volumio.com/uploads/default/original/2X/a/a620c2c533b67192dfda7e3fd9798a245905e524.jpeg)

---

<div class="post-metadata">

**Author:** ![Buckler](https://community.volumio.com/user_avatar/community.volumio.com/buckler/32/106_2.png) [@Buckler](https://community.volumio.com/u/Buckler)\
**Post date:** [February 26, 2015, 7:10pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/4 "2015-02-26T19:10:44Z")

</div>

Hi,

Great project!  
Would be nice if you could share the code for the script, I see you have build some nice scripts for the LCD

Iam also working on a new project. Akind of stand-alone radioplayer (not really high-end) but there is some woodwork, painting etc involved. so that takes some time…

THNX

Harry

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [February 26, 2015, 8:23pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/5 "2015-02-26T20:23:43Z")

</div>

Hi!  
Of course I’ll share it, but this week end because I can’t do it before… Just want to precise that even if my scripts work, there is probably tons of things to remove / correcting… I am not a programmer and it took me a long time to find the good way to make it work 😉 .  
Now I want to add the following : a short press on “next” button jump to the next song, and a long press seek several seconds forward in the song. Both commands work separatly but I can’t achieve to detect properly the buton press duration. If you could help ! 😃  
Thank you

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [February 27, 2015, 8:13pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/6 "2015-02-27T20:13:17Z")

</div>

As promise, my scripts attached…  
To manage physical buttons and rotary encoder : button-rasp.py  
To display ip adress until mpd start and then launch mpdlcd and check every 10sec if it is alive and relaunch it if needed : monip.py  
To display Volume each time volume is change via rotary encoder, webui or any mpdclient.  
This scripts are far from being perfect. But they work! Feel free to improve/correct it and share . 😉

Edit : I update the script monip.py because the one I have post had a syntax error …  
Edit : March 2nd 2015 . Update script button-rasp.py to add seek when a long press on next and previous buttons  
[script-volumio.zip](https://community.volumio.com/uploads/short-url/5SDJKN8V06Bu2kRUqh2TKWBjjYG.zip) (3.52 KB)

---

<div class="post-metadata">

**Author:** ![Buckler](https://community.volumio.com/user_avatar/community.volumio.com/buckler/32/106_2.png) [@Buckler](https://community.volumio.com/u/Buckler)\
**Post date:** [March 2, 2015, 5:12am UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/7 "2015-03-02T05:12:50Z")

</div>

Bonjour,

Take a look at this great tutorial about GPIO: [http://raspi.tv/rpi-gpio](http://raspi.tv/rpi-gpio)  
In the advanced section there you can learn/read something about a Threaded call.

A nice example of a Threaded call with a “count” of the time a button is pressed can be found over here: [http://www.raspberrypi.org/learning/morse-code/worksheet/](http://www.raspberrypi.org/learning/morse-code/worksheet/)

By the way did you " kill" the Pi in your latest Hifi-project?

Harry

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [March 2, 2015, 7:44pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/8 "2015-03-02T19:44:19Z")

</div>

Hi!  
@ buckler : Thank you for the links. Thank to that I add the “seek” function when a long press is done on next or previous button. 😃 It is still not exactly what I want to do, because you have to maintain and release button to get the action. My exact feature is : short press : next song. Long press (\>2sec) seek by step 8sec as long as you maintain button. I’m working on that 😉 .  
I have updated my script above.  
Yes this the Rpi used in my last project that I have burned… 😲 I have already change it…

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [March 7, 2015, 5:14pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/9 "2015-03-07T17:14:51Z")

</div>

Hi!  
A new picture of my project with a nice volume knob ! Thank you Gordon(gswg) for it 😉  
Now, it’s nearly finished…  
 ![isoavbutton.JPG](https://community.volumio.com/uploads/default/original/2X/f/ff1f7bf0b110f21f909f9b2798f617593f407e49.jpeg)

---

<div class="post-metadata">

**Author:** ![getdown](https://community.volumio.com/letter_avatar_proxy/v4/letter/g/e0b2c6/32.png) [@getdown](https://community.volumio.com/u/getdown)\
**Post date:** [July 31, 2015, 9:13pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/10 "2015-07-31T21:13:32Z")

</div>

Hi Everybody,

I’m trying to install a lcd with the same pcf8475 controller than you and I have some issues.  
Could you explain how you’ve installed all the software part of your project please ?

I’ve searched on google and find lots of tutos but it’s still not working at all.

I’ve installed I2Ctools and trying the I2Cdetect -y 0 fonction but I have an error message saying the files or directory is not existing !

Please help me if you can because I dont see any solutions !

Thank’s a lot !

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [August 1, 2015, 9:34am UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/11 "2015-08-01T09:34:32Z")

</div>

Hi!  
In linux, commands are case sensitive.  
Are you sure to type `
i2cdetect -y 0
` ?

---

<div class="post-metadata">

**Author:** ![getdown](https://community.volumio.com/letter_avatar_proxy/v4/letter/g/e0b2c6/32.png) [@getdown](https://community.volumio.com/u/getdown)\
**Post date:** [August 1, 2015, 9:46am UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/12 "2015-08-01T09:46:50Z")

</div>

Thank’s for the answer, i’ve find the solution for i2cdetect issue, it’s been because i’m in 3.18 kernel so I’ve modified config.txt to activate i2c !

Now i have another problem, the pin of my backplat is different than the normal configuration. I’ve found a modified hd44780 driver with the right pin out conf but I dont know how to put the hd44780-i2c.c files in lcdproc.

In usr/lib i dont have any lcdproc folder to put the files in.

---

<div class="post-metadata">

**Author:** ![getdown](https://community.volumio.com/letter_avatar_proxy/v4/letter/g/e0b2c6/32.png) [@getdown](https://community.volumio.com/u/getdown)\
**Post date:** [August 10, 2015, 11:01pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/13 "2015-08-10T23:01:11Z")

</div>

balbuze,

I have the same I2c extender than you like you said here [lcd-i2c-problems-t2863.html](https://volumio.org/forum/lcd-i2c-problems-t2863.html)

but no way to use it with volumio ! Can you tell me how to fix this ? I’m french like you so you can send me a message in french if you want !

thank’s a lot !

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [August 11, 2015, 3:10pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/14 "2015-08-11T15:10:48Z")

</div>

@getdown  
As I’m off for some days, I can’t answer now… I’ll try next week 😉

---

<div class="post-metadata">

**Author:** ![DigitalToys](https://community.volumio.com/user_avatar/community.volumio.com/digitaltoys/32/216_2.png) [@DigitalToys](https://community.volumio.com/u/DigitalToys)\
**Post date:** [August 30, 2015, 1:20pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/15 "2015-08-30T13:20:49Z")

</div>

Hi balbuze,

tried to connect an i2c display using your scripts, but could not succeed so far. It would be great if you could give some more information on how you prepared the RPi, which packages needed to be installed and where and how your scripts get included in the whole thing…

Sorry, I am still a total noob, and after reading dozens of different tutorials in the last days, I am now even more confused, so an end-to-end description would be highly appreciated.

Cheers!

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [August 30, 2015, 3:16pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/16 "2015-08-30T15:16:52Z")

</div>

Hi,  
The RPI was a B+  
I did it several month ago, but in my notes I wrote :

```auto

sudo apt-get install python-smbus i2c-tools

sudo apt-get install lcdproc

sudo apt-get install python-mpd

sudo apt-get install python-pip

sudo pip install mpdlcd

wget http://sourceforge.net/projects/raspberry-gpio-python/files/raspbian-wheezy/python-rpi.gpio_0.5.9-1armhf.deb
(you 'll need to modify the version with the one available)
sudo dpkg -i python-rpi.gpio_0.5.8-1_armhf.deb

sudo update-rc.d LCDd defaults

sudo nano /etc/init.d/bootmisc.sh
```

In /etc/modules  
add  
i2c\_dev

my script are launch by adding the following in /etc/rc.local

```auto
python /home/pi/button-rasp.py &
python /home/pi/monip.py
python /home/pi/vol.py &
```

I have customised some files - see attached file. Remplace originals by it.  
I think there is other things to be done…  
[custom.zip](https://community.volumio.com/uploads/short-url/bWqCMtYanxhdv8TNdg5uR8YHwMm.zip) (12 KB)

---

<div class="post-metadata">

**Author:** ![DigitalToys](https://community.volumio.com/user_avatar/community.volumio.com/digitaltoys/32/216_2.png) [@DigitalToys](https://community.volumio.com/u/DigitalToys)\
**Post date:** [August 30, 2015, 8:45pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/17 "2015-08-30T20:45:11Z")

</div>

Hi balbuze,

thanks for your description. I followed all steps, but after everything is done, the display shows only one row of blocks and when trying to connect to mpdlcd, I get the well-known error message:

root@volumio:~# sudo mpdlcd --no-syslog  
WARNING mpdlcd Connection failed: [Errno 111] Connection refused  
WARNING mpdlcd Connection failed: [Errno 111] Connection refused  
WARNING mpdlcd Connection failed: [Errno 111] Connection refused  
ERROR mpdlcd Unable to connect to lcdproc localhost:13666.

After installing all files you described, the i2cdetect did not work at first, after adding

dtparam=i2c1=on  
dtparam=i2c\_arm=on

to the /boot/config.txt file, it is detected on port 0x27.

mpdlcd does not seem to run, so actually the same problem I ran into when trying to connect the LCD without the i2c interface.

Any ideas?

Cheers!

Edit: I will start over again tonight and do a detailled description of all steps I take, maybe this helps in troubleshooting. I’ll post a guide once I finally get this up and running.

---

<div class="post-metadata">

**Author:** ![DigitalToys](https://community.volumio.com/user_avatar/community.volumio.com/digitaltoys/32/216_2.png) [@DigitalToys](https://community.volumio.com/u/DigitalToys)\
**Post date:** [September 1, 2015, 6:11pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/18 "2015-09-01T18:11:57Z")

</div>

Ok, here are the steps I took, I tried to describe as detailled as possible:

Hardware

1. Connect HifiBerry to P5 header using jumper cables to keep the GPIO pins exposed.
2. Connect the I2C adapter on the display to following GPIO pins on the RPi:  
GND -\> Pin 6  
VCC -\> Pin 2  
SDA -\> Pin 3  
SCL -\> Pin 5

Software

1. Install Volumio 1.55 to SD-Card using Win32DiskImager
2. Install HifiBerry driver via Volumio settings menu
3. `
sudo apt-get update
`
4. `
sudo apt-get install python-smbus i2c-tools
`
5. `
sudo apt-get install lcdproc
` (following substeps taken from AndyPi’s tutorial)  
5.1 press “q” during PHP installation  
5.2 Perform automatic configuration upgrade -\> Yes  
5.3 php.ini -\> Keep the local version currently installed  
5.4 php-fpm.conf -\> keep default option “N”  
5.5 [www.conf](http://www.conf) -\> keep default option “N”  
5.6 php.ini -\> Keep the local version currently installed
6. `
sudo apt-get install python-mpd
`
7. `
sudo apt-get install python-pip
`
8. `
sudo pip install mpdlcd
`
9. `
wget http://sourceforge.net/projects/raspberry-gpio-python/files/raspbian-wheezy/python-rpi.gpio_0.5.11-1_armhf.deb
`
10. `
sudo dpkg -i python-rpi.gpio_0.5.11-1_armhf.deb
`
11. `
sudo update-rc.d LCDd defaults
`
12. `
sudo nano /etc/init.d/bootmisc.sh
`  
12.1 add `
su pi -c "mpdlcd --no-syslog &"
` before last colon.
13. `
sudo nano /etc/modules
`  
13.1 add `
i2c_dev
`
14. `
sudo nano /etc/rc.local
`  
14.1 add `python /home/pi/button-rasp.py &
		python /home/pi/monip.py
		python /home/pi/vol.py &`
15. add to /home/pi: `button-rasp.py	
		monip.py
		vol.py` as provided in your post.
16. replace the config files with the files you provided
17. `
sudo nano /boot/config.txt
`  
17.1 add `dtparam=i2c1=on
		dtparam=i2c_arm=on`
18. `
sudo reboot
`

During reboot, I already see the warning that mpdlcd connection failed because the connection is refused. Furthermore, there’s another error message: startpar: service(s) returned failure: rc.local… failed!

I checked the file but cannot see what’s wrong with it:

[code]#!/bin/sh -e

# 

# rc.local

# 

# This script is executed at the end of each multiuser runlevel.

# Make sure that the script will “exit 0” on success or any other

# value on error.

# 

# In order to enable or disable this script just change the execution

# bits.

# 

# By default this script does nothing.

/var/www/command/player\_wdog.sh startup & \> /dev/null 2\>&1  
python /home/pi/button-rasp.py &  
python /home/pi/monip.py  
python /home/pi/vol.py &  
exit 0[/code]

The display only shows blocks in the first row, trying to connect to mpdlcd results in the same “connection refused” message.

This is so weird. Exactly at the same point I get stuck when trying to connect the display without interface… what the hell am I doing wrong? 👿

---

<div class="post-metadata">

**Author:** ![balbuze](https://community.volumio.com/user_avatar/community.volumio.com/balbuze/32/30223_2.png) [@balbuze](https://community.volumio.com/u/balbuze)\
**Post date:** [September 1, 2015, 6:35pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/19 "2015-09-01T18:35:56Z")

</div>

Hello,  
I remember that I had a problem until I found a other driver for HD44780 because the one provide was not ok.  
The problem is that I don’t own anymore this project… ☹  
But I made a image of the SD. I’ll try to restore it and send you…  
edit : have you had a look here [https://www.raspberrypi.org/forums/viewtopic.php?f=35&t=63412](https://www.raspberrypi.org/forums/viewtopic.php?f=35&t=63412)

---

<div class="post-metadata">

**Author:** ![DigitalToys](https://community.volumio.com/user_avatar/community.volumio.com/digitaltoys/32/216_2.png) [@DigitalToys](https://community.volumio.com/u/DigitalToys)\
**Post date:** [September 1, 2015, 6:40pm UTC](https://community.volumio.com/t/my-second-rpi-volumio-project/2488/20 "2015-09-01T18:40:44Z")

</div>

That would be so cool! I am struggling with this for months now…

[Next page](https://community.volumio.com/t/my-second-rpi-volumio-project/2488.md?page=2)
