Thanh117
Posts: 1
Joined: Wed Jan 25, 2017 6:56 pm

Run Python program at startup

Tue Jan 31, 2017 1:27 pm

Hi,

I am totally new to this forum so I apologize for my stupid questions and newbie mind.

I recently made a project of a garage door opener. I connected my Pi to my garage door using apache and a PHP page by following a tutorial online. I just followed the steps in the tutorial so I'm not familiar yet with the words used but I know my way around a little bit. Since I'm not using a monitor and I have to carry the Pi around (it will not be permanently on my garage operator, this project is a small step of a bigger project), I can't see when the Pi is booted or not or when it is ready to work. I have to plug the Pi, go to my PHP webpage and press the buttons until something works (I push a LED turn on button). Then I know that my Pi is ready to work. I was thinking maybe I can add an LED that lights up when the Pi has done booting instead of always pushing my LED turn on button.

Is there a way to run do something that runs the LED turn on button just to tell me that if I had a monitor connected, I would see the desktop of the Pi?

I did some research online and all I could find was making the Pi run a program instead of booting and that's not what I want. I just want an indication that the Pi is on the desktop even though I don't have a monitor to see it.

Thank you

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Run Python program at startup

Tue Jan 31, 2017 5:40 pm

If I understand you, you want some sort of indicator that the pi is running.

Of course the Pi has a red LED which indicates that it has power, but I suppose that doesn't mean that it is up and running.
You could change the behaviour of the green LED to indicate that the Pi is running, for example make it flash like a heartbeat. Add this to /etc/rc.local

Code: Select all

echo heartbeat > /sys/class/leds/led0/trigger

Return to “Beginners”