Sign up here and you can log into the forum!

SleepTimer app.bin

This is the place to ask for how to use software that is (or isn't) included in the various wdlxtv flavours. Questions about software such as rtorrent, NZBGet, sshfs, curlftpfs, ssh, telnet, etc.

SleepTimer app.bin   

Postby simogere » Wed Nov 02, 2011 9:03 am

Hi guys, I have this "little" ( :oops: ) request. Since the last firmware doesn't support WDTVExt, this useful plugin has become unusable.
Is there any pious soul that can made the app.bin version of this plugin?

Image Image Image Image

Thanks in advance those who want to help the SleepTimer Community :lol: :lol:

Simone
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: SleepTimer app.bin   

Postby mad_ady » Wed Nov 02, 2011 11:22 pm

The reason it doesn't work is because wdtvext library only works with 1.02-based releases. It doesn't work with newer versions (1.03/1.05) because WD has made a lot of changes to their code and the library needs to be rewritten to adapt to these changes. Sadly, the person who wrote the library is no longer with this project, and in order to make it work you would need to be proficient in MIPS ASM code. As you can imagine, there are very few people with such skills around.

This is why, if you want wdtvext plugins (like SleepTimer or MediaNavigation), you can use 1.02-0.5.1.x...
User avatar
mad_ady
Developer
 
Posts: 4564
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: SleepTimer app.bin   

Postby blachanc » Thu Nov 03, 2011 4:07 am

mad_ady wrote:This is why, if you want wdtvext plugins (like SleepTimer or MediaNavigation), you can use 1.02-0.5.1.x...

mad_ady,

Warning,
I am typing out loud again :-)

I assume the sleeptimer is turning off the wdtv after some time.

But, using your sysinfo plugin, would it be possible to us a simple
script that basically just invoke the command sleep and then a
shutdown or power-off in background.

Code: Select all
::::::::::::::
sleep_20_sec
::::::::::::::
#!/bin/csh -f

sleep 20 ; ${MY_SHUTDOWN_COMMAND} &



-Ben
Last edited by blachanc on Thu Nov 03, 2011 10:56 am, edited 1 time in total.
blachanc
Patron
 
Posts: 238
Joined: Tue Feb 22, 2011 7:10 am
Location: Montreal,QC, Canada (french)

Re: SleepTimer app.bin   

Postby simogere » Thu Nov 03, 2011 7:05 am

Image
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: SleepTimer app.bin   

Postby recliq » Thu Nov 03, 2011 8:14 am

ähm... there's no csh on WDTV
and for the record here's what i wrote simogere which led to this thread:
recliq wrote:Hi simogere,

this normally belongs in the forum since it's not really a private matter but a technical ;)

...anyways, it's not that easy. The SleepTimer plugin uses several WDTVExt features (OSD display, key interception) which can only be done with WDTVExt.
Best you can get is to use EIRI and a different remote (due to the bug in 1.05 with EIRI and the original remote) to start a shell script which will just wait for a defined period of time and then put the WD to sleep.
However you won't have any visual feedback of what's going on and wether the script is currently running...

I'd suggest to put this question on the forum maybe someone comes up with a different/better idea.

Greetz,
recliq
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: SleepTimer app.bin   

Postby mad_ady » Thu Nov 03, 2011 10:25 am

My feeling is the best approach to this is to modify KAD's videoscreensaver app.bin and simply put the device to sleep if in screensaver mode for more than X seconds. There won't be any visual feedback though, but the result should be the same (and the difficult part of scanning dmaosd.log is already written)
User avatar
mad_ady
Developer
 
Posts: 4564
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: SleepTimer app.bin   

Postby blachanc » Thu Nov 03, 2011 11:59 am

@recliq
recliq wrote:ähm... there's no csh on WDTV

well, I was talking about a concept :oops: (I hope sh is supported)
Code: Select all
::::::::::::::
sleep_90_minutes.sh
::::::::::::::
#!/bin/sh -f
(sleep 5400 ; ${MY_SHUTDOWN_COMMAND} ) &


the idea proposed by recliq & my concept check are related to a "Timer function"
like the sleep function of a TV.

The concept mad_ady is proposing is more like a "sleep on idle"

both ideas would need to be implemented to replace the original plugin:

Plugin: SleepTimer + sleep on idle (update 3)

Anyway, just for fun I will try my concept,

-Ben
blachanc
Patron
 
Posts: 238
Joined: Tue Feb 22, 2011 7:10 am
Location: Montreal,QC, Canada (french)

Re: SleepTimer app.bin   

Postby mad_ady » Thu Nov 03, 2011 12:26 pm

@blachanc I never thought of the idea of a user-initiated sleep timer. In this case your command through UMSP->Sysinfo should do the trick. One could chose to inject a POWER event as if the POWER button were pressed on the remote, or one could run custom power off commands. The problem with the POWER event is that if the WDTV is in screensaver mode when the command is executed, the POWER button action will only turn off the screensaver and not the WDTV. So the user would need a combination of a keypress (to turn off the screensaver) + POWER button to turn off the wdtv.

Give it a try. If it works as expected, I can add it as a permanent option to Sysinfo (with user selectable sleep intervals).
User avatar
mad_ady
Developer
 
Posts: 4564
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: SleepTimer app.bin   

Postby blachanc » Fri Nov 04, 2011 4:26 am

Hi mad_ady

Here are my results ( Iwas not able to access the forum yesterday evening)

If I call the script /conf/sleep_20.sh directly, bingo, it works.

If I call the script /conf/sleep_20.sh via the sysinfo plugin,
it execute, but I get the linux circle of death, until the script completes,
and put the WDTV in standby.

I tried everything I though of to detach the process from the plugin call,
even modifying the sysinfo.php to impose putting the su -c command in background did
not work.

I have no knowledge of /bin/sh, and very little knowledge about su command so I
might not get how to detach the process from the call.

So close but still so far. ;)


sysinfo.xml
Code: Select all
<?xml version="1.0"?>
<sysinfo>
  <item>
      <name>Wake on LAN</name>
      <command>ether-wake -b 00:11:22:33:44:55</command>
  </item>
  <item>
       <name>Test command</name>
       <command><![CDATA[logger "About to shutdown PC..."; echo "Test command" > /tmp/test; sleep 2]]></command>
  </item>
<item>
      <name>test_sleep_20_sec v4</name>
      <command>(/conf/sleep_20.sh)</command>
  </item>
<item>
      <name>ls in background v3</name>
      <command>(echo "here";exec("ls -ltr /tmp/conf| tail -5"))</command>
  </item>

</sysinfo>


/conf/sleep_20.sh
Code: Select all
#!/bin/sh -f
echo " executing  sleep"
(sleep 20  ; irinject POWER ) &


message.txt (various su trials)
Code: Select all

   Line 600: Jan  2 00:09:15 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c  /conf/sleep_20.sh 
   Line 601: Jan  2 00:09:15 WDTV_SALON auth.notice su: + none root:root
   Line 617: Jan  2 00:13:27 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c /conf/sleep_20.sh
   Line 618: Jan  2 00:13:27 WDTV_SALON auth.notice su: + none root:root
   Line 635: Jan  2 00:20:59 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c exec(/conf/sleep_20.sh)
   Line 636: Jan  2 00:20:59 WDTV_SALON auth.notice su: + none root:root
   Line 637: Jan  2 00:21:59 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c exec(/conf/sleep_20.sh)
   Line 638: Jan  2 00:21:59 WDTV_SALON auth.notice su: + none root:root
   Line 639: Jan  2 00:24:59 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c echo "sleep test" ;/conf/sleep_20.sh)
   Line 640: Jan  2 00:24:59 WDTV_SALON auth.notice su: + none root:root
   Line 641: Jan  2 00:25:27 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c logger "About to shutdown PC..."; echo "Test command" > /tmp/test; sleep 2
   Line 642: Jan  2 00:25:27 WDTV_SALON auth.notice su: + none root:root
   Line 644: Jan  2 00:26:08 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c echo "sleep test" ;/conf/sleep_20.sh)
   Line 645: Jan  2 00:26:08 WDTV_SALON auth.notice su: + none root:root
   Line 646: Jan  2 00:26:27 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c /conf/sleep_20.sh
   Line 647: Jan  2 00:26:27 WDTV_SALON auth.notice su: + none root:root
   Line 663: Jan  2 00:28:07 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c echo "sleep test"; /conf/sleep_20.sh
   Line 664: Jan  2 00:28:08 WDTV_SALON auth.notice su: + none root:root
   Line 680: Jan  2 00:30:01 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c exec(" /conf/sleep_20.sh")
   Line 681: Jan  2 00:30:01 WDTV_SALON auth.notice su: + none root:root
   Line 682: Jan  2 00:31:08 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c echo "allo" ;exec(" /conf/sleep_20.sh")
   Line 683: Jan  2 00:31:08 WDTV_SALON auth.notice su: + none root:root
   Line 684: Jan  2 00:37:43 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ls -ltr /conf
   Line 685: Jan  2 00:37:43 WDTV_SALON auth.notice su: + none root:root
   Line 686: Jan  2 00:38:32 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ls -ltr /tmp/conf
   Line 687: Jan  2 00:38:32 WDTV_SALON auth.notice su: + none root:root
   Line 688: Jan  2 00:39:19 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ls -ltr /tmp/conf| tail -5
   Line 689: Jan  2 00:39:19 WDTV_SALON auth.notice su: + none root:root
   Line 690: Jan  2 00:41:53 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c "ls -ltr /tmp/conf| tail -5"
   Line 691: Jan  2 00:41:53 WDTV_SALON auth.notice su: + none root:root
   Line 692: Jan  2 00:43:24 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (ls -ltr /tmp/conf| tail -5)
   Line 693: Jan  2 00:43:24 WDTV_SALON auth.notice su: + none root:root
   Line 694: Jan  2 00:52:51 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (ls -ltr /tmp/conf| tail -5)
   Line 695: Jan  2 00:52:51 WDTV_SALON auth.notice su: + none root:root
   Line 696: Jan  2 00:53:31 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ((ls -ltr /tmp/conf| tail -5))
   Line 697: Jan  2 00:53:31 WDTV_SALON auth.notice su: + none root:root
   Line 698: Jan  2 00:54:22 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ((echo "here";ls -ltr /tmp/conf| tail -5))
   Line 699: Jan  2 00:54:22 WDTV_SALON auth.notice su: + none root:root
   Line 700: Jan  2 00:58:24 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c ((echo "here";ls -ltr /tmp/conf| tail -5))
   Line 701: Jan  2 00:58:24 WDTV_SALON auth.notice su: + none root:root
   Line 702: Jan  2 00:59:11 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (exec(echo "here";ls -ltr /tmp/conf| tail -5))
   Line 703: Jan  2 00:59:11 WDTV_SALON auth.notice su: + none root:root
   Line 704: Jan  2 01:00:26 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "here";exec (ls -ltr /tmp/conf| tail -5))
   Line 705: Jan  2 01:00:26 WDTV_SALON auth.notice su: + none root:root
   Line 706: Jan  2 01:01:10 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "here";exec(ls -ltr /tmp/conf| tail -5))
   Line 707: Jan  2 01:01:10 WDTV_SALON auth.notice su: + none root:root
   Line 708: Jan  2 01:02:33 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "here";exec("ls -ltr /tmp/conf| tail -5"))
   Line 709: Jan  2 01:02:33 WDTV_SALON auth.notice su: + none root:root
   Line 710: Jan  2 01:03:56 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c echo "allo" ;/conf/sleep_20.sh)
   Line 711: Jan  2 01:03:56 WDTV_SALON auth.notice su: + none root:root
   Line 712: Jan  2 01:04:32 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "allo" ;/conf/sleep_20.sh)
   Line 713: Jan  2 01:04:32 WDTV_SALON auth.notice su: + none root:root
   Line 729: Jan  2 01:08:04 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "allo" ;/conf/sleep_20.sh)
   Line 730: Jan  2 01:08:04 WDTV_SALON auth.notice su: + none root:root
   Line 731: Jan  2 01:10:31 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (echo "allo" ;/conf/sleep_20.sh)
   Line 732: Jan  2 01:10:31 WDTV_SALON auth.notice su: + none root:root
   Line 763: Jan  2 01:14:35 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (source /conf/sleep_20.sh)
   Line 764: Jan  2 01:14:35 WDTV_SALON auth.notice su: + none root:root
   Line 773: Jan  1 17:24:14 WDTV_SALON auth.notice su: + /dev/pts/1 root:root

[************************************************************]
[AFTER sysinfo.php modif to impose the background]
[************************************************************]

   Line 781: Jan  2 01:30:58 WDTV_SALON authpriv.notice sudo: www-data : TTY=unknown ; PWD=/usr/share/umsp ; USER=root ; COMMAND=/bin/su -c (source /conf/sleep_20.sh)&
   Line 782: Jan  2 01:30:58 WDTV_SALON auth.notice su: + none root:root




I am open to try any suggestion you could have.

-Ben
blachanc
Patron
 
Posts: 238
Joined: Tue Feb 22, 2011 7:10 am
Location: Montreal,QC, Canada (french)

Re: SleepTimer app.bin   

Postby mad_ady » Fri Nov 04, 2011 5:10 am

Hmm, try with something like:

Code: Select all
<item>
      <name>test_sleep_20_sec v4</name>
      <command><![CDATA[(sleep 20  ; irinject POWER)&]]</command>
  </item>


I will give it a try as well, when I have some free time.
User avatar
mad_ady
Developer
 
Posts: 4564
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Next

Return to Application Questions

Who is online

Users browsing this forum: No registered users and 2 guests