I have a raspberry pi 3 running an LED program on startup, so that when I plug it in, it can run my light program right away, without any input from a keyboard/mouse. Everything works as designed when the pi is plugged into my TV via HDMI, however, does not when it is unplugged from the TV.

When not connected to my TV, the program will start up for about 5-10 seconds, but then the lights stop changing as designed. My program is started on boot by a command being placed in /etc/rc.local.

I've tried other startup methods but have gotten the same result. I've also tried changing the pi's configuration to force output through the HDMI port using the hdmi_force_hotplug=1.

Any help or ideas would be greatly appreciated as this is very frustrating and have run out of ideas!!!! Thank you

  • I would start by creating a log for the program so you have a means of tracing what it is actually doing. You might want to include some details about it beyond the fact that it controls LEDs. Many debuggers have a command line or TUI interface that can be easily used over ssh, and attached to a running process (presuming it is still running -- do you know? This is the kind of thing a simple log would help with...), but debuggers are language specific and of course your program is written in __________.
    – goldilocks
    Oct 4, 2016 at 15:03
  • Right, that's my next step. I'm going to write output to a file when it's not plugged into HDMI to see whether it's still running but not sending output to the LED's, or whether the program is stopped. Oh and it's a Python program. Thank you
    – Will N
    Oct 4, 2016 at 15:28
  • I'm not a python user, but a quick net search implies it's native debugger can't be attached to a running process, unfortunately. There may be some tools you can use with a C debugger attached to the interpreter, but that is probably a very steep learning curve...
    – goldilocks
    Oct 4, 2016 at 15:31
  • ...Also it sounds like you do not have a means of remote access to the machine. Debugger aside, you could make life much easier for yourself in this case if you have another computer and set that up. The half hour or so it might take you to get the hang of ssh will be quickly saved in plugging and unplugging power and peripherals (keyboard, monitor), rebooting, checking the logs, etc.
    – goldilocks
    Oct 4, 2016 at 15:36

1 Answer 1


I finally figured it out!!! After toying around some more, it turns out that once the pi realizes it's not plugged into HDMI, it switches its audio source to the headphone jack which was messing up the output through the GPIO pins. After changing the configurations of the pi to force audio out the HDMI, it now completely works without being plugged into my TV!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.