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!
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…
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
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 (3.52 KB)
Take a look at this great tutorial about GPIO: http://raspi.tv/rpi-gpio
In the advanced section there you can learn/read something about a Threaded call.
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…
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 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.
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.
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:
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.
Ok, here are the steps I took, I tried to describe as detailled as possible:
Hardware
Connect HifiBerry to P5 header using jumper cables to keep the GPIO pins exposed.
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
Install Volumio 1.55 to SD-Card using Win32DiskImager
Install HifiBerry driver via Volumio settings menu
sudo apt-get update
sudo apt-get install python-smbus i2c-tools
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 -> keep default option “N”
5.6 php.ini -> Keep the local version currently installed
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
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