maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Way to [remote] Software unlock? (https://talk.maemo.org/showthread.php?t=20599)

combatdoc 2008-06-01 02:10

Way to [remote] Software unlock?
 
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 2008-06-04 01:44

Re: Way to Software unlock?
 
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.

combatdoc 2008-06-04 02:29

Re: Way to Software unlock?
 
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 2008-06-04 02:59

Re: Way to Software unlock?
 
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"

Benson 2008-06-04 16:24

Re: Way to Software unlock?
 
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 2008-06-13 06:27

Re: Way to Software unlock?
 
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 2009-04-26 07:22

Re: Way to Software unlock?
 
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...

dkenny 2010-04-29 22:28

Re: Way to [remote] Software unlock?
 
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


All times are GMT. The time now is 18:30.

vBulletin® Version 3.8.8