Q:

Raspberry loosing HDMI output after a period of time

This is a follow up question to:
Change output to HDMI after tv has turned off
This solution works partially. I can turn off the TV and turn it on again and get the screen back on my TV. However this does not work in the following case:
Turn on both devices.
Let the raspberry stay on the login screen. (Don't log in)
Turn off the TV.
Wait a few hours.
Turn on the TV.
Now the screen is just black. It does not say "No input" as it would when nothing was connected, but the screen stays black, no matter how much I type on the keyboard.
Now, considering that it seems like the TV is receiving something, or that it can at least sense the presence of a device, then the first solution obviously worked. But again, no joy over prolonged periods of time.
Is there a way to fix THIS? :)

A:

Perhaps the console blanking is kicking in.
I tried several suggested methods, but the one that worked for me was to edit /etc/rc.local and add a setterm -blank 0 command:
setterm -blank 0

So the file looks like this afterwards:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# turn off console blanking
setterm -blank 0

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

exit 0

(entire file here to show exactly where I put it)
Essentially, the setterm -blank 0 command sets the terminal blanking period to 0 seconds (off), disabling the blanking which usually occurs.  rc.local is executed at the end of the boot process with root privileges so it affects all the physical consoles (the TV & HDMI outputs here)

