Reply
Thread Tools
combatdoc's Avatar
Posts: 204 | Thanked: 29 times | Joined on May 2008
#1
I spend a lot of time remote logged into the n810 via VNC or SSH (generally because I want to try something I read here and its in another room). Unfortunately, sometimes I go to log in and the device has auto-locked because it went idle. Then I have to go into the other room just to move the slider to unlock it. I am aware of the display setting, but I tend to forget to turn auto-lock back on, and the auto-lock applet for the light meter has a memory leak according to the thread.


Anyway, the short version:
Is there a way to pass a command via SSH or VNC to Unlock the tablet instead of using the slider switch on top?
__________________
Doc, 68W3P, AAS, NREMT-P
Far From Perfect
Mobile Version (Under Dev, Please Comment)
Nokia n810 Diablo
(After many years of Palm and Windows PDAs)
"So Shut Up, Live, Travel, Adventure, Bless, And Don't Be Sorry." - Jack Kerouac
 
Posts: 5 | Thanked: 9 times | Joined on May 2008 @ Minneapolis
#2
If you have python installed you could try:

Code:
#!/usr/bin/env python
import dbus

def main():
	bus = dbus.SystemBus()
	tklock = bus.get_object('com.nokia.mce','/com/nokia/mce/request')
	tklock.req_tklock_mode_change(dbus.String("unlocked"))

if __name__ == "__main__":
	main()
Save to /unlock.py and chmod a+x it.

Currently I can't test it as I haven't got the n810's USB networking up on my XP machine, but the script is able to lock the device through xterm when i change the dbus.String to "lock".

BTW this is a direct rip from emjays's sliderotate.py available here.
 

The Following 3 Users Say Thank You to superfisch For This Useful Post:
combatdoc's Avatar
Posts: 204 | Thanked: 29 times | Joined on May 2008
#3
That worked like a charm. Now if I knew how to write python I'd build a switch..lol

Thanks alot. This is gonna save me a lot of inconvienence.
__________________
Doc, 68W3P, AAS, NREMT-P
Far From Perfect
Mobile Version (Under Dev, Please Comment)
Nokia n810 Diablo
(After many years of Palm and Windows PDAs)
"So Shut Up, Live, Travel, Adventure, Bless, And Don't Be Sorry." - Jack Kerouac
 
Posts: 5 | Thanked: 9 times | Joined on May 2008 @ Minneapolis
#4
I'm glad that this worked for you. I actually saw your post yesterday and I had been looking for the same thing. I kept meaning to get around to checking that python script as it looks like there are all kinds of goodies inside and I could use a good reason to start learning another language.

I like this better:

Code:
/usr/bin/dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"unlocked"

Last edited by superfisch; 2008-06-04 at 04:44. Reason: code
 

The Following 3 Users Say Thank You to superfisch For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#5
Me too; I Python...


Not sure what you mean, build a switch?

I'd just use dbus-send and use ssh to send that command forth, but if you use the python version, just put it in a file somewhere, and launch that file via ssh...

Should be able to script that locally (with Windows/Putty, NT/Cygwin/openssh, or UNI X/openssh...) and put an icon somewhere handy on the desktop/menu.
 
combatdoc's Avatar
Posts: 204 | Thanked: 29 times | Joined on May 2008
#6
Well, thanks for all the help. I like the dbus version as well.

An icon was really unecessary since I needed it from the commandline via SSH and with the dbus version its easier for my to build a quick script to lock/unlock it.

BTW what is the command to lock it? Neither "locked" nor "lock" work.
__________________
Doc, 68W3P, AAS, NREMT-P
Far From Perfect
Mobile Version (Under Dev, Please Comment)
Nokia n810 Diablo
(After many years of Palm and Windows PDAs)
"So Shut Up, Live, Travel, Adventure, Bless, And Don't Be Sorry." - Jack Kerouac
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#7
For the code lock method:

To unlock remotely:
Code:
run-standalone.sh /usr/bin/dbus-send --print-reply --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_close string:'com.nokia.mce' string:'/com/nokia/mce/request' string:'com.nokia.mce.request' string:'devlock_callback' uint32:'0'
To lock:
Code:
run-standalone.sh /usr/bin/dbus-send --print-reply --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:'com.nokia.mce' string:'/com/nokia/mce/request' string:'com.nokia.mce.request' string:'devlock_callback' uint32:'3'
You don't wanna know how I came up with that...
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 8 | Thanked: 2 times | Joined on May 2009
#8
I haven't tried the lock..but that's ok..
I needed the unlock and it works!!!

SWEET!!!

-dkenny

now if I could be remote debugging using eric4 working..but this is a different issue
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:39.