How to re-enable HDMI on headless setup?

I set my Rpi5 up headless and disabled HDMI, connecting only via SSH.

I can’t connect with SSH now and would like to enable HDMI, to troubleshoot, I can edit the boot files offline, but what to do restore HDMI?

Here the config.txt

#-------Display---------
# Max allocated framebuffers: Set to "0" in headless mode to reduce memory usage
# - Defaults to "2" on RPi4 and "1" on earlier RPi models
max_framebuffers=0

# If you get no picture, set the following to "1" to apply most compatible HDMI settings.
hdmi_safe=1

# Uncomment to adjust the HDMI signal strength if you have interferences, blanking, or no display.
# - Ranges from "0" to "11", use values above "7" only if required, e.g. with very long HDMI cable.
# - Default on first RPi1 A/B is "2", else "5", on RPi4 this setting is ignored.
#config_hdmi_boost=5

# Uncomment if HDMI display is not detected and composite is being outputted.
hdmi_force_hotplug=1

# Uncomment to disable HDMI even if plugged, e.g. to force composite output.
#hdmi_ignore_hotplug=1

# Uncomment to force a console size. By default it will be display's size minus overscan.
#framebuffer_width=1280
#framebuffer_height=720

# Uncomment to enable SDTV/composite output on RPi4. This has no effect on previous RPi models.
#enable_tvout=1
# SDTV mode
#sdtv_mode=0

# Uncomment to force a specific HDMI mode (this will force VGA).
#hdmi_group=1
#hdmi_mode=1

# Uncomment to force an HDMI mode rather than DVI. This enables HDMI audio in DMT modes.
#hdmi_drive=2

# Set "hdmi_blanking=1" to allow the display going into standby after 10 minutes without input.
# With default value "0", the display shows a blank screen instead, but will not go into standby.
# NB: Some legacy OpenMAX applications (OMXPlayer) cannot wake screens from real standby.
hdmi_blanking=1

# Set to "1" if your display has a black border of unused pixels visible.
disable_overscan=1

# Uncomment the following to adjust overscan.
# Use positive numbers if console goes off screen, and negative if there is too much border.
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# Rotation
#display_hdmi_rotate=0
#lcd_rotate=0

#-------RPi camera module-------
#start_x=1
#disable_camera_led=1

#-------GPU memory splits-------
gpu_mem_256=16
gpu_mem_512=16
gpu_mem_1024=16

I understand no point in editing the dietpi.txt as it’s only read once on first setup.

Is there a way to enable HDMI on the next boot?

Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the following files on first partition of the SDcard from external system:

  • In config.txt, set “hdmi_ignore_hotplug=0” and comment/remove the “max_framebuffers=0” line.
  • In dietpi.txt, set “AUTO_SETUP_HEADLESS=0”.
1 Like

Thank you, that did it and I was then able to solve the boot issue and get up and running again.

1 Like