Page 1 of 1

Using a TV as Display

Posted: Fri Apr 08, 2016 6:08 am
by girish_kumar
Hi,

I have connected my RPi to my HD TV through a HDMI cable and I have keyboard & mouse connected to RPi.

Because of this I need to sit very close to TV to work

So I use SSH (using putty) to login to the RPi and to do programming from my study desk This option does NOT work whenever there is some graphics as putty terminal does not support graphics.

So one option to solve this problem is use VNC sever.

However when I run a graphics program from putty I would like the output (graphics screen) to appear on my TV.

Is there a way to do this - by setting some environment variable like DISPLAY etc ? I would like to see the graphics output of TV and putty terminal for programming. I had done this in Linux terminals by setting the DISPLAY variable, here that does not seems to work - Can you help me

Regards
Girish

Re: Using a TV as Display

Posted: Fri Apr 08, 2016 7:09 am
by MarkHaysHarris777
There are so many ways to do this (with and without the TV) that I am inclined to recommend (and attempt to influence you) to try using (controlling) your RPI remotely with only VNC over SSH... just get the TV out of the 'picture' pun intended.

I am assuming you have another computer workstation (whatever) like an iMac, or something similar (gnu+linux) or, god forbid, windows... ?

My Raspberry PIs (my three primary PIs B+ 2B and 3B) are running headless... meaning no keyboard, no monitor, and no mouse... tightvncserver is running on all three, and I access all three from my iMac (large flat panel LED monitor similar to your HDMI TV) using port forwarding --- that is, I connect to the tightvncservers on the PIs from the iMac over an SSH tunnel (very fast, encrypted, and most importantly concurrent... that is, all of my PIs are up on the iMac at the same time (I just mouse into the one I want) Again, none of my PIs are ever actually connected to a real monitor except for the first thirty minutes just to get them setup. From then on its vnc over ssh (and yes, this even works over my openvpn server to locations 'out there' when I take my show on the road... I have all of my RPIs with me 'virtually' via openvpn and vnc over ssh.

There is a problem here (I am loath to point out) and that is that the VNC instuctions for the RPI on this site are wrong, and I might add, also incomplete. In other words, following the instructions will leave you frustrated. There are on-line tutorials explaining how to get this accomplished, and I am in the process of writing up one of my own for this site, should they wish to use it.

I am using my PI 3B now, displayed on an iMac secondary flat panel, using vnc over ssh... and the PI is sitting out on the desk looking dashing in its Black Ice Zebra case from C4Labs... and the only wires attached to it is the power cord. (true story)

Re: Using a TV as Display

Posted: Fri Apr 08, 2016 7:14 am
by Cancelor
Have a look here, it will be the same for Rasbian. http://askubuntu.com/questions/47642/ho ... pc-via-ssh

Re: Using a TV as Display

Posted: Fri Apr 08, 2016 9:44 am
by tvjon
girish_kumar wrote:...
However when I run a graphics program from putty I would like the output (graphics screen) to appear on my TV.
...
Is there a way to do this.. Can you help me

Regards
Girish
Yes.

In my case I use 2 displays connected to Rpi, but in your case, you can just pretend there's a second display, & output to HDMI only when you wish to display graphics or video output.

You achieve this by enabling Rpi's very useful DPI mode. Read:

viewtopic.php?f=91&t=94424&sid=b9557b66 ... 1142031329

for more information.

In your case, you don't need to buy any extra hardware. You simply edit

/boot/config.txt

to contain these 3 lines:

dtoverlay=vga666
enable_dpi_lcd=1
display_default_lcd=1


The requisite VGA666 overlay will already be present in /boot/overlays

Now, when you reboot, as you have elected to use your non-existent VGA display as the primary screen, there will be no screen output from HDMI, so you will SSH into your Rpi as you do at present.

A quick test to show you this is all working is, via your SSH machine:

omxplayer --display 5 some-videofile.mp4

& your HDMI connected Tv will show the video.

(you can uise the BigBuckBunny.h264 file provided in the "hello_video" examples folder in Raspbian if you don't have a video file handy)


When I started to use 2 displays, I programatically entered the display number (0 for the default HDMI, 1 for the DPI connected display), into my test ptrograms, but later the Foundation provided a useful environment variable:

VC_DISPLAY=relevant-display-# your-application-name

to allow your graphics application to divert video output to a specific display device. Strangely, this variable mysteriously isn't working at the moment. I'll investigate...
It won't affect what you want to achieve, as it's just a convenience.

HTH

Re: Using a TV as Display

Posted: Sat Apr 09, 2016 8:48 am
by DougieLawson
Have a look at x11vnc that will mirror your RPi desktop to a VNC session (some programs that write directly to a framebuffer may not work).

Or use the TV and gain some distance from your RPi with a wireless keyboard/mouse.

Re: Using a TV as Display

Posted: Sun Apr 10, 2016 2:36 am
by girish_kumar
Thanks a lot for all your response, it was really useful

Re: Using a TV as Display

Posted: Sun Apr 10, 2016 1:40 pm
by darkbibble
I use a Logitech wireless keyboard and mouse, the Logitech unifying dongle works great with the pi