PDA

View Full Version : Way to [remote] Software unlock?


combatdoc
05-31-2008, 10:10 PM
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?

superfisch
06-03-2008, 09:44 PM
If you have python installed you could try:

#!/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 (http://www.internettablettalk.com/forums/member.php?u=14747) sliderotate.py available here (http://sliderotate.garage.maemo.org/).

combatdoc
06-03-2008, 10:29 PM
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.

superfisch
06-03-2008, 10:59 PM
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:

/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"

Benson
06-04-2008, 12:24 PM
Me too; I :mad: 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
06-13-2008, 02:27 AM
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.

qwerty12
04-26-2009, 03:22 AM
For the code lock method:

To unlock remotely:
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:
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...

dkenny
04-29-2010, 06:28 PM
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