1

I have a raspberry pi with a lcd screen attached witch is mirroring the raspberry pi's display. I want to show a pygame window on it. When I run: python main1.py on the ripi terminal the pygame window pops up perfectly on the ripi display.

However I am running my raspberry pi remotely from my windows machine using putty ssh. When I run python main1.py on there it comes up it return pygame.error: Unable to open a console terminal. From what I have read online it is trying to show the pygame display on my ssh putty window. I do not want this I want to have it show on my raspberry pi screen.

Is there a setting in putty or something in my script i can change to do this?

Thank You :)

asked Apr 24, 2018 at 17:35

2 Answers 2

2

I found this thread. I tested the solution between two of my personal computers, both running Linux.

To find out the value of $DISPLAY, use a keyboard hooked directly to the pi. Then in the terminal type echo $DISPLAY The value will probably be :0.0

Then once you ssh into the pi, type export DISPLAY=:0.0 (but replace the :0.0 with whatever value the echo $DISPLAY turned up). Also, if you don't have a keyboard, it's probably worth just assuming your display variable is :0.0 above.

Also make sure you have X forwarding enabled in your /etc/ssh/sshd_config

answered Apr 24, 2018 at 17:59
1

I had to edit /etc/lightdm/lightdm.conf to allow TCP connections as well as using export DISPLAY=:0

answered May 15, 2024 at 10:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.