Go Back   maemo.org - Talk > OS / Platform > OS2008 / Maemo 4 / Chinook - Diablo
 
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
  #1  
Old 2008-06-01, 02:10
combatdoc's Avatar
combatdoc combatdoc is offline
 
Join Date: May 2008
Posts: 204
Thanks!: 1
Thanked 29 Times in 21 Posts
Send a message via Yahoo to combatdoc Send a message via Skype™ to combatdoc
Default 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?
__________________
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
Reply With Quote
  #2  
Old 2008-06-04, 01:44
superfisch superfisch is offline
 
Join Date: May 2008
Location: Minneapolis
Posts: 5
Thanks!: 2
Thanked 9 Times in 4 Posts
Default 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.
Reply With Quote
The Following 3 Users Say Thank You to superfisch For This Useful Post:
  #3  
Old 2008-06-04, 02:29
combatdoc's Avatar
combatdoc combatdoc is offline
 
Join Date: May 2008
Posts: 204
Thanks!: 1
Thanked 29 Times in 21 Posts
Send a message via Yahoo to combatdoc Send a message via Skype™ to combatdoc
Default 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.
__________________
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
Reply With Quote
  #4  
Old 2008-06-04, 02:59
superfisch superfisch is offline
 
Join Date: May 2008
Location: Minneapolis
Posts: 5
Thanks!: 2
Thanked 9 Times in 4 Posts
Default 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"

Last edited by superfisch; 2008-06-04 at 04:44. Reason: code
Reply With Quote
The Following 3 Users Say Thank You to superfisch For This Useful Post:
  #5  
Old 2008-06-04, 16:24
Benson's Avatar
Benson Benson is offline
 
Join Date: Oct 2007
Posts: 4,930
Thanks!: 1,605
Thanked 2,272 Times in 1,290 Posts
Default Re: Way to Software unlock?

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.
Reply With Quote
  #6  
Old 2008-06-13, 06:27
combatdoc's Avatar
combatdoc combatdoc is offline
 
Join Date: May 2008
Posts: 204
Thanks!: 1
Thanked 29 Times in 21 Posts
Send a message via Yahoo to combatdoc Send a message via Skype™ to combatdoc
Default 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.
__________________
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
Reply With Quote
  #7  
Old 2009-04-26, 07:22
qwerty12's Avatar
qwerty12 qwerty12 is offline
 
Join Date: Sep 2007
Location: Looking at y'all and sighing
Posts: 4,274
Thanks!: 5,528
Thanked 5,358 Times in 1,954 Posts
Default 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...
Reply With Quote
The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
  #8  
Old 2010-04-29, 22:28
dkenny dkenny is offline
 
Join Date: May 2009
Posts: 8
Thanks!: 1
Thanked 2 Times in 1 Post
Default 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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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