Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Programming in Linux _ bash scripts at startup

Posted by: adg0013 Aug 1 2013, 11:38 AM

I have been following multiple tutorials in an attempt to build a stand alone Pandora internet radio player using the Raspberry Pi. The Pi is running Wheezy, the latest distribution of Raspbian. All the tutorial are nearly identical when it comes to making pianobar and your bash script start at boot. Pianobar is the command line Pandora player and the bash script takes care of the button presses for next song, new station, volume up/down, pause/play, and shutdown/menu. I can get pianobar to start on boot, but the problem is the script: the buttons won't work. I have tried to solve this on my own for nearly an entire day and a half now, but am getting discouraged so I finally decided to ask others for help. I will post links for the tutorials and my code below. As of right now, I have pianobar and bash /home/pi/.config/pianobar/scripts/ added to the end of the ~/.bashrc file. I have tried adding the two lines to the /etc/rc.local file as well as the /etc/bashrc file. Nothing seems to work! One final thing: this is supposed to start playing music from Pandora by just applying power. Like I said before the music will work but the buttons will not. However, if I ssh into it and type ~/.bashrc and then quit pianobar, the buttons work!?

Here is the script:

gpio -g mode 22 in

if [ $(gpio -g read 22) = 1 ]
sudo python /home/pi/.config/pianobar/scripts/
bash /home/pi/.config/pianobar/scripts/


" "

Powered by Invision Power Board (
© Invision Power Services (