JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Turn screen on and off at will

Sun Mar 23, 2014 7:56 pm

I want to use my pi to play videos when they are sent a signal over a network (The signal sending part is sorted).

So my first question is how can I play full screen videos using python?

I also need the screen to be blank when it's not playing a video, how can I achieve this?

JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Re: Turn screen on and off at will

Tue Mar 25, 2014 5:59 pm

Any suggestions?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Turn screen on and off at will

Tue Mar 25, 2014 6:01 pm

HDMI or composite??

Richard S.

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Turn screen on and off at will

Tue Mar 25, 2014 6:09 pm

Does the screen need to be powered down or can it just be black?

Dave.
Apple say... Monkey do !!

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Turn screen on and off at will

Tue Mar 25, 2014 6:18 pm

This script works for me:

https://github.com/iinnovations/iicontr ... /screen.sh

Pass one of the three arguments.

Colin
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Turn screen on and off at will

Tue Mar 25, 2014 6:37 pm

iinnovations wrote:This script works for me:

https://github.com/iinnovations/iicontr ... /screen.sh

Pass one of the three arguments.

Colin
How would you implement that in Python?

Dave.
Apple say... Monkey do !!

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Turn screen on and off at will

Tue Mar 25, 2014 8:14 pm

Probably something like this:

https://github.com/iinnovations/iicontr ... /screen.py

Although I just tested this, I did so on a remote headless box, so YMMV.

Colin
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Re: Turn screen on and off at will

Tue Mar 25, 2014 9:03 pm

Thanks for the responses. I'm talking about HDMI here.

With regard to it going black rather than off, I in fact need it to go black, rather than off, because otherwise I'll get the 'NO SIGNAL' message, which is something I'm trying to avoid.

I have tried a command something like tvservice -p or something, and that did what I wanted it to, except I had no idea how to turn it back on again :P

---EDIT---
Having had a look at the scripts, I'll try them out tomorrow. Thank you :)

User avatar
simonmcc
Posts: 179
Joined: Mon Aug 19, 2013 10:07 pm

Re: Turn screen on and off at will

Wed Mar 26, 2014 12:39 pm

if you just want the screen to go blank, not HDMI off then xscreensaver is your friend.

Install the xscreensaver package, and then use

Code: Select all

xscreensaver-command -activate
and

Code: Select all

xscreensaver-command -deactivate 
they will blank and unblank the screen. You should run xscreensaver-demo to set the defaults (just set it to off and then you're in control)
simonmcc.blogspot.com/search/label/pi

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Turn screen on and off at will

Thu Mar 27, 2014 4:40 pm

Or just display a black .bmp or .jpg fullscreen...
note: I may or may not know what I'm talking about...

Return to “Python”