maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   ANSWERED: VNC Server with Screen Off (x11) (https://talk.maemo.org/showthread.php?t=46484)

mail_e36 2010-03-04 15:30

ANSWERED: VNC Server with Screen Off (x11)
 
For those who use the VNC Server, you know that turning the screen off blanks out the VNC session on your remote computer (x11 session).

So if the N900's screen is off (but the phone is on, in standby) you can SSH to it, but cannot have a working VNC session to it. Does anyone know how to enable the VNC even if the screen is off?

ANSWER

This can be resolved by connecting via SSH and typing

dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:unlocked

The above will turn on the N900 screen, the below will turn the screen off...

dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:locked

mail_e36 2010-03-05 14:57

Re: VNC Server with Screen Off (x11)
 
I'm sure someone out there uses a VNC server on the N900...

SubCore 2010-03-05 15:02

Re: VNC Server with Screen Off (x11)
 
the first thing i do when using x11vnc is to disable the screensaver.

the fact that x11vnc cannot reactivate the screen on user input (through the vnc session) can probably be considered as a bug (and it has been reported already, see here).

it is beta quality, after all :)
and it didn't get pass the QA for extras because of this.

sdstrowes 2010-05-27 21:48

Re: VNC Server with Screen Off (x11)
 
Would love if tapping the VNC window prompted the N900 to wake up in the same way tapping the screen (when the keyboard is open) does.

I can hear the N900 vibrate when I click the VNC viewer on my laptop, so I know it's receiving the touch/click events. But it doesn't wake up :)

AndiThebest 2010-05-27 22:03

Re: VNC Server with Screen Off (x11)
 
Quote:

dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:unlocked
See this thread: http://talk.maemo.org/showthread.php?p=595359

sdstrowes 2010-05-27 22:14

Re: VNC Server with Screen Off (x11)
 
Ah, thanks! Also, this post in the same thread mentions the screen brightness app, which seems to work as well.

9000 2010-05-28 02:25

Re: VNC Server with Screen Off (x11)
 
Quote:

Originally Posted by AndiThebest (Post 684174)

Thank you for the nice script made. I've learn a lot.

For x11vnc server, vanadium (http://talk.maemo.org/member.php?u=37697) has given another solution which utilize an option in x11vnc to make the screen stays on:

Code:

#!/bin/bash
dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:unlocked

x11vnc -timeout 20 -bg -grabkbd -cursor X

(Save it as, say startvnc.sh in N900 and make it executable)

line 2 (dbus-send) unlocks the phone as AndiThebest recommended
line 3 starts x11vnc
Options:
- times out in 20 seconds if vnc connection hasnt begun
- bg will start the vnc in the background
- grabkbd will lock the keyboard (will also not let the phone blank out!!!)
- cursor X will show a cursor
By vanadium, SOURCE REF: http://talk.maemo.org/showpost.php?p...0&postcount=14

One more thing I'd like to note is that you might want to lock the screen immediate after closing vnc. So you'd like to make the following script to close the screen immediately via ssh:

Code:

#!/bin/bash
dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:locked

(Save it as, say lock.sh and make it executable)

Thanks AndiThebest and vanadium. I'd have to do it the hard way had they not given these wonderful advices. Now I can put the N900 somewhere and control it remotely over wifi without even get near to it.

Note from mine: Remember to close the vnc afterward. One day I left the office in haste without closing the vnc and the keyboard stay locked by the vnc server which I must hard reboot to get it back. That was silly of me. XD

Magik 2010-07-05 09:06

Re: VNC Server with Screen Off (x11)
 
Hello.
First of all: thanks for useful posts :D

Ok so I made a file named "vnc". Then I pasted first script to it. Next I put that file into /user/bin(to launch it from any folder?) . I made it executable by this command:
Code:

chmod u+x vnc
When i type "vnc" it says "Permission Denied".
When i type"sudo vnc" it prints "sh: vnc: not found"

I don't know much about shell scripts so help would be nice ;)

dannym 2010-07-08 20:11

Re: VNC Server with Screen Off (x11)
 
Quote:

Originally Posted by Magik (Post 741022)
Code:

chmod u+x vnc
When i type "vnc" it says "Permission Denied".
When i type"sudo vnc" it prints "sh: vnc: not found"

Make sure you don't store it in ~/MyDocs since usually that is a FAT partition which doesn't have UNIX permission bits (not being a UNIX filesystem). Try for example ~ directly.

When calling, do
./vnc
to make it find it in the current working directory. Usually, the current working directory is NOT searched for executables automatically because people would inadvertenly start stuff when they do seemingly harmless commands like "ls", "cp", ...

If in doubt, try the full path:
/home/user/vnc

gbuergisser 2010-09-10 09:16

Re: VNC Server with Screen Off (x11)
 
My approach is a bit low tech but works fine: When I press the F8 key the VNC client (vncviewer on Fedora) show a popup menu where I can "Send F8". Doing this wakes up the N900 and brings up the volume control, just as if I had pressed the volume control keys on the device itself.


All times are GMT. The time now is 01:14.

vBulletin® Version 3.8.8