ConradG13
Posts: 51
Joined: Thu Feb 25, 2016 1:41 am

Re: Need some help!- project!- IMPORTANT!

Sun Apr 17, 2016 3:29 am

Yeah, I figured out how to start at boot but, the script isn't working. That's is what I'm trying to figure out right now.
People who say times instead of multiply shouldn't be around.

ConradG13
Posts: 51
Joined: Thu Feb 25, 2016 1:41 am

Re: Need some help!- project!- IMPORTANT!

Sun Apr 17, 2016 3:32 am

Now the only error I am receiving is

Code: Select all

[email protected]:~ $ /etc/init.d/radio
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=1
  File "/home/pi/radio.py", line 10
    [email protected]:~$ /etc/init.d/radio
    ^
IndentationError: expected an indented block
People who say times instead of multiply shouldn't be around.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Need some help!- project!- IMPORTANT!

Sun Apr 17, 2016 4:37 am

ConradG13 wrote:Now the only error I am receiving is

Code: Select all

[email protected]:~ $ /etc/init.d/radio
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=1
  File "/home/pi/radio.py", line 10
    [email protected]:~$ /etc/init.d/radio
    ^
IndentationError: expected an indented block
I'm curious if the following runs at the command line:

mplayer -playlist http://bbc.co.uk/radio/listen/live/r6.asx

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Need some help!- project!- IMPORTANT!

Sun Apr 17, 2016 5:06 am

As far as I can tell your code radio.py contains the lines:

Code: Select all

    if GPIO.input(23)==1:
[email protected]:~ $ /etc/init.d/radio
Which is not valid Python.

Firstly Python expects white space indentation after an "if"

Secondly you have pasted your command prompt into the code "[email protected]:~ $ /etc/init.d/radio"

Thirdly even without that you cannot just run a command from Python like that. You need to do it as described here:
http://fastml.com/how-to-run-external-p ... ir-output/
Memory in C++ is a leaky abstraction .

Return to “General discussion”