17

I've found that my Raspberry Pi2's HDMI port only works if there's something attached to it when the RPi initially boots. If it boots with nothing attached, and I later attach a monitor, nothing shows up on the monitor.

My application is headless, but occasionally I want to attach a monitor to do debugging, and in those cases having to reboot the RPi risks losing debugging information.

How do I configure the RPi to either keep the HDMI port "turned on" even when nothing's connected, or continuously poll the HDMI port and enable the driver when it finds something there?

Cerin
  • 2,271
  • 7
  • 31
  • 49

3 Answers3

9

To /boot/config.txt add:

hdmi_force_hotplug=1

You will have to reboot to make that effective (this applies to anything in config.txt), but the display should work now if you plug it in after boot. However, the resolution may not be set as correctly as it is when booted with the screen attached. To ensure that, set an explicit mode as explained here.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
7

Try

tvservice --explicit="DMT 35 HDMI"

This powers on HDMI explicitly with "DMT mode 35" which is 60 HZ at 1280x1024 pixels.

There is also tvservice --off if you've got enough.

For more information try both

tvservice --help and looking here for a tabular listing of modes.

flakeshake
  • 6,235
  • 1
  • 14
  • 33
0

For me, with an "ACER V233H" LCD Monitor connecting with a DVI to HDMI converter to My RPi3, I had to set a few variables in the /boot/config.txt to make the "HDMI Force Hotplug" work with "1024x768 XGA 60Hz":

hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16
hdmi_drive=1
Greenonline
  • 2,740
  • 4
  • 23
  • 36
vahid-dan
  • 101
  • 1