Page 1 of 1

RPi volumio 1.4 GPIO for python

PostPosted: Fri Jul 18 2014 19:14
by tobbes
Hello,

I try to build a small mpd-box with Raspberry Pi and Volumio.
A LCD is running (thanks to AndyPi) and I want to have some buttons to control mpd via mpc over GPIO.
Under older volumio versions it was running ...

Now my problem is, that I cannot install
Code: Select all
sudo apt-get install python-rpi.gpio
E: Unable to locate package python-rpi.gpio
E: Couldn't find any package by regex 'python-rpi.gpio'
 sudo apt-get install python-dev
The following packages have unmet dependencies:
 python-dev : Depends: python (= 2.7.3-4+deb7u1) but 2.7.5-5 is to be installed
              Depends: python2.7-dev (>= 2.7.3-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


How can I get GPIO running under volumio 1.4?

Thanks for help
Tobbes

RPi volumio 1.4 GPIO for python

PostPosted: Mon Jul 21 2014 11:22
by jawedsoft
Same problem with me too.....can some one please guide us..

regarsd,
Jawed

RPi volumio 1.4 GPIO for python

PostPosted: Mon Jul 21 2014 12:24
by balbuze
on raspberry add these line in your /etc/apt/sources.list
Code: Select all
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free r$
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

You have to do before installing most of package
:D

RPi volumio 1.4 GPIO for python

PostPosted: Sun Jul 27 2014 06:47
by esseki
Hi tobbes,

did balbuze 's solution work ?
If yes, don't forget to change your Post title to "[Solved] RPi volumio 1.4 GPIO for python" for others ;)
Thank you

[Solved] RPi volumio 1.4 GPIO for python

PostPosted: Mon Jul 28 2014 05:44
by tobbes
Hello,
I did it like this:
change in /etc/apt/sources.list wheezy to jessie
sudo apt-get update
sudo apt-get install python-dev
Unfortunately I could not install gpio, so I got the gpio*.deb from the web and did:
sudo dpkg - i gpio???.deb

change in /etc/apt/sources.list jessie to wheezy
sudo apt-get update

My python gpio scripts are running now.
But there is a problem with the "mpc consume off" parameter.
It seems that this parameter is not persistent.
I set it in /etc/rc.local
su pi -c "mpc clear &"
su pi -c "mpc consume off &"
su pi -c "mpc load 1_Favoriten.pls &"
su pi -c "mpc repeat 1_Favoriten.pls &"

but the playlist is always empty after a few tracks ...

Tobbes

RPi volumio 1.4 GPIO for python

PostPosted: Fri Aug 01 2014 20:05
by tavdog
YES that worked !

RPi volumio 1.4 GPIO for python

PostPosted: Thu Aug 21 2014 11:22
by cf99_vol
Hi,

you don't have to change something in the apt-get source file!

Just connect to your RPi change to root, download the latest RPi.GPIO from http://sourceforge.net/projects/raspber ... an-wheezy/ and install the file.

sudo su
wget http://sourceforge.net/projects/raspberry-gpio-python/files/raspbian-wheezy/python-rpi.gpio_0.5.6-1_armhf.deb
dpkg -i python-rpi.gpio_0.5.6-1_armhf.deb

[Solved] RPi volumio 1.4 GPIO for python

PostPosted: Thu Aug 21 2014 12:31
by michelangelo
tobbes wrote:Hello,
I did it like this:
change in /etc/apt/sources.list wheezy to jessie
sudo apt-get update
sudo apt-get install python-dev
Unfortunately I could not install gpio, so I got the gpio*.deb from the web and did:
sudo dpkg - i gpio???.deb

change in /etc/apt/sources.list jessie to wheezy
sudo apt-get update

My python gpio scripts are running now.
But there is a problem with the "mpc consume off" parameter.
It seems that this parameter is not persistent.
I set it in /etc/rc.local
su pi -c "mpc clear &"
su pi -c "mpc consume off &"
su pi -c "mpc load 1_Favoriten.pls &"
su pi -c "mpc repeat 1_Favoriten.pls &"

but the playlist is always empty after a few tracks ...

Tobbes


This is a bug of current MPD version... Unfortunately it has consume mode on by default... I'm recompiling next version, expect to see it in next volumio version...

RPi volumio 1.4 GPIO for python

PostPosted: Fri Oct 03 2014 18:24
by Mona
But there is a problem with the "mpc consume off" parameter.
It seems that this parameter is not persistent.

This is a bug of current MPD version...


My rc.local also turns consume mode off and I have noticed this as well. I restarted my Pi and ran the following as soon as I could SSH into it:

Code: Select all
while true; do mpc status; sleep 1; done


I can watch the status of the consume mode change from OFF to ON at almost exactly the same time every reboot. It coincides with this message:

Code: Select all
[   57.137029] bcm2835-cpufreq: switching to governor performance


By counting the number of seconds before consume mode turns back on, I was able to modify my rc.local to turn it back off at the appropriate time.

Code: Select all
(sleep 25; su -u pi mpc consume off) &


Kind of an ugly workaround, but it works!