woody007
Posts: 5
Joined: Sat Sep 27, 2014 9:20 pm

Internet radio

Sat Sep 27, 2014 9:31 pm

Hi everyone, i,m a noob and have just built a internet radio with touchscreen following the tutorial on adafruit. Everything works fine but need to know how I can get this to start up on boot up.
The way I have tried is to create a folder called bin which is stored in the pi section. I have then inputted a start up script as follows:-
#!/bin/bash
# Script to start our application
echo "Doing autorun script..."
sudo /home/pi/pi-radio python radioplayer.py &
Then I test it with the command /home/pi/bin/script_auto_run, but all I get is command not found or file doesn`t exist.
Can anyone point me in the right direction please

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: Internet radio

Sun Sep 28, 2014 5:49 am

Hello

I'm no expert but this looks like it could be a problem

Code: Select all

sudo /home/pi/pi-radio python radioplayer.py &
try...

Code: Select all

sudo python /home/pi/pi-radio/radioplayer.py &
Last edited by bullwinkle on Sun Sep 28, 2014 7:08 am, edited 1 time in total.

woody007
Posts: 5
Joined: Sat Sep 27, 2014 9:20 pm

Re: Internet radio

Sun Sep 28, 2014 7:01 am

Many thanks Bullwinkle, for your reply but still no luck.
I get the message sudo: /home/pi/pi-radio : command not found followed by python: cant open file radioplayer.py : [Errno 2] no such file or directory.

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: Internet radio

Sun Sep 28, 2014 7:11 am

hi
from the command line can you try.

Code: Select all

cd /home/pi/pi-radio
sudo python radioplayer.py &
does this work ?

woody007
Posts: 5
Joined: Sat Sep 27, 2014 9:20 pm

Re: Internet radio

Sun Sep 28, 2014 8:31 am

Yea that works fine, but really want it to boot up straight into the radio player on boot up.

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: Internet radio

Sun Sep 28, 2014 1:00 pm

If you put those 2 lines in the bottom of .rclocal (found in the /home/pi directory) you should be good to go...

I have a similar set up and it is working ok...

woody007
Posts: 5
Joined: Sat Sep 27, 2014 9:20 pm

Re: Internet radio

Sun Sep 28, 2014 3:36 pm

Looked for rc.local in directory but could not find it. Is it a file, folder or what. All files are shown, do I have to create it.
Sorry Bullwinkle but you seem to be the only one to help me.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Internet radio

Sun Sep 28, 2014 3:49 pm

woody007 wrote:Looked for rc.local in directory but could not find it. Is it a file, folder or what. All files are shown, do I have to create it.
The file is in /etc so it's '/etc/rc.local'

See also http://www.raspberrypi.org/documentatio ... c-local.md
It's actually the top hit when I google for rc.local :)

Gr.
Dirk.

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: Internet radio

Sun Sep 28, 2014 6:55 pm

my mistake, I was doing this from memory and should have checked. Sorry about that.
The file I meant to indicate is called .bashrc
located in /home/pi
(note it is a hidden file so to edit it use nano .bashrc)

woody007
Posts: 5
Joined: Sat Sep 27, 2014 9:20 pm

Re: Internet radio

Sun Sep 28, 2014 7:40 pm

Many thanks Bullwinkle. That works great. Now to work out how to auto login in. Again many thanks and also to Dirk who also replied to this post. I,ve still got a long way to go but now I know that there are guys out there willing to pass on there info to help others.

Return to “Beginners”