View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 18 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Mon Apr 07, 2014 3:23 am 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 389
Location: Fargo, ND, USA
Mythwelcome never goes into standby. I use the system menu to put the machine into standby the square turns green but it never gos into standby.

I click the mythwelcome box when I did a clean install of 8.1.1 . After the install is finished I check the >Service Menu >LinHES settings>Host to see if the "Run Mythwelcome" box is checked and it was.

Question: is the /usr/LH/bin/mythwelcome-config.py script run whenever the "Run Mythwelcome" is checked

Observation: I know the mythwelcome-config.py script is not running because in the Backend Settings > General > Shutdown / Wakeup Option page the "Idle shutdown timeout (secs): is still at 0. If the script is run it sets this line to 40.
Code:
# mythtv-setup Shutdown/Wakeup options
if mythdb.settings[localhostname].idleTimeoutSecs == u'0':
    mythdb.settings[localhostname].idleTimeoutSecs = u'40'


I manually run the /usr/LH/bin/mythwelcome-config.py script
Observation: mythwelcome-config.py script still dos not run. "Idle shutdown timeout (secs): is still at 0

/var/log/messages.log has this statement every-time the system reboots.
Code:
frontend: First configure: Running mythwelcome-config.py


Observation: in the mythwelcome-config.py script there is this line
Code:
.MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"'

Question: is the \ after -c correct?
Question: is there someplace that a python log file is located? How do I know if the script try to run and errors out.

TVBox

_________________
TVBox
LinHES R8.4


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 7:44 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
TVBox wrote:
Question: is the /usr/LH/bin/mythwelcome-config.py script run whenever the "Run Mythwelcome" is checked
Not immediately but if it is a new install it should run on the first boot. It probably should.

Quote:
Observation: I know the mythwelcome-config.py script is not running because in the Backend Settings > General > Shutdown / Wakeup Option page the "Idle shutdown timeout (secs): is still at 0. If the script is run it sets this line to 40.
Code:
# mythtv-setup Shutdown/Wakeup options
if mythdb.settings[localhostname].idleTimeoutSecs == u'0':
    mythdb.settings[localhostname].idleTimeoutSecs = u'40'
That is checking if the value is 0, so if you have specified something else it won't overwrite the use preference. Now it could be that the value isn't a unicode 0 which is what the default db has that value set to. Did you restore any settings or change that value?

Quote:
/var/log/messages.log has this statement every-time the system reboots.
Code:
frontend: First configure: Running mythwelcome-config.py
Something is not right as that should only run the first boot, not every boot.

Quote:
Observation: in the mythwelcome-config.py script there is this line
Code:
.MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"'

Question: is the \ after -c correct?
Yes. it is escaping the quote.
Quote:
Question: is there someplace that a python log file is located? How do I know if the script try to run and errors out.
The script has no logging. If you run it from the cmd line and it errors you would see the python error break.


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 11:43 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
brfransen wrote:
Quote:
Observation: I know the mythwelcome-config.py script is not running because in the Backend Settings > General > Shutdown / Wakeup Option page the "Idle shutdown timeout (secs): is still at 0. If the script is run it sets this line to 40.
Code:
# mythtv-setup Shutdown/Wakeup options
if mythdb.settings[localhostname].idleTimeoutSecs == u'0':
    mythdb.settings[localhostname].idleTimeoutSecs = u'40'
That is checking if the value is 0, so if you have specified something else it won't overwrite the use preference. Now it could be that the value isn't a unicode 0 which is what the default db has that value set to. Did you restore any settings or change that value?

It looks like some version of mythtv made idleTimeoutSecs a global instead of host specific. Additionally, it looks like the default db doesn't have that setting and the script doesn't account for that. Replace those lines with
Code:
if mythdb.settings.NULL.idleTimeoutSecs == u'0' or mythdb.settings.NULL.idleTimeoutSecs == None:
    mythdb.settings.NULL.idleTimeoutSecs = u'40'
Add print statements before and after to see the change on the cmd line when you run the scripts.
Code:
print mythdb.settings.NULL.idleTimeoutSecs


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 1:27 pm 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 389
Location: Fargo, ND, USA
Thanks Britney for answering.

I removed all disk partitions before I installed 8.1.1
.iso matches md5. and scandisk performed on cd burn
No backups where installed.
I did this install only to troubleshoot the Mythwelcome problem. If I didn't have to change anything during the install to get the install screen to advance I did not change it. Defaults where used whenever possible.

Quote:
The script has no logging. If you run it from the cmd line and it errors you would see the python error break
If I run the script manually
/usr/LH/bin/mythwelcome-config.py (xterm window)
There is no complaint of error of any type but it still dos not change the setting pages from the defaults.
++++++++++++++
A correction to my first post, when I run it manually there is no entry in the messages.log file
++++++++++++++

On every startup it appears mythwelcome-config.py trys to run
/var/log/messages.log
frontend: First configure: Running mythwelcome-config.py

In the very first boot (configuration of the program first boot)
In the very first messages.log entry (that had anything that seems mythwelcome)
Code:
frontend: First configure: Running mythwelcome-config.py
frontend: ls: cannot access /etc/X11/autostart/*: No such file or directory
frontend: Unable to open lock directory: /home/mythtv/.tilda/locks
frontend: Unable to open lock directory: /home/mythtv/.tild

frontend: xwininfo: error: No window with name "MythTV Frontend" exists!
frontend: xwininfo: error: No window with name "MythTV Setup" exists!
frontend: xwininfo: error: No window with name "mythwelcome" exists!

frontend: 2014-04-07 13:11:07.729350 C  mythwelcome version: fixes/0.27 [v0.27-125-g7f548de] www.mythtv.org


Quote:
That is checking if the value is 0, so if you have specified something else it won't overwrite the use preference. Now it could be that the value isn't a unicode 0 which is what the default db has that value set to. Did you restore any settings or change that value?

The 0 would have been a default setting.
On the MythShutdown / MythWelcome Settings Page as it setts right now
Command to Set Wakeup Time: sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time "

If the script run would it not be
Command to Set Wakeup Time: sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time"

Sorry I know the way I have the information listed here is very hard to follow .
TVBox

I was working on your first post and did not see your second post

_________________
TVBox
LinHES R8.4


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 2:20 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
I did find where we are running mythwelcome_config.py on every start. We shouldn't be and I will fix that. I will also commit the change I posted above for idleTimeoutSecs. Did you try that code?
Quote:
On the MythShutdown / MythWelcome Settings Page as it setts right now
Command to Set Wakeup Time: sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time "

If the script run would it not be
Command to Set Wakeup Time: sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time"
Not true. The script did run correctly. The \ in the script is to escape the quotes so the py interpreter doesn't act on them but rather puts them in the string as data. To prove it to yourself you can change the string on the settings page and exit and then run the script and then check the setting page again. You will see it will put the set-alarm text back in.


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 2:24 am 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 389
Location: Fargo, ND, USA
Thanks again Britney for taking the time.
I was working on your first post and did not see your second post before I posted my second post.

I updated the /usr/LH/bin/mythwelcome-config.py script and ran it.

+++++++++++
Shutdown / Wakeup Options > Idle shutdown timeout (sec):
has updated to >> 40

Testing 1 (passed)
changed "Shutdown / Wakeup Options > Idle shutdown timeout" to 70
run mythwelcome-config.py script setting remained 70

Testing 2 (passed)
changed "Shutdown / Wakeup Options > Idle shutdown timeout" to 0
run mythwelcome-config.py script setting changed to 40

Testing 3 (passed)
tried to changed "Shutdown / Wakeup Options > Idle shutdown timeout" to (blank space)
screen will not allow a blank entry to remain when you leave the line.

++++++++++++++++++++++++++++++++++++++++
I have no idea what is going on here. It is what I was trying to point out in the bottom of my #2 post.
ran updated mythwelcome-config.py script (there was no changes in the script that effected this line)

MythShutdown / MythWelcome Settings > Command to Set Wakeup Time:
did not change it is still >> sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time " (no \ )

The line in the mythwelcome-config.py script
mythdb.settings[localhostname].MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"'
Produces the statement in the "Idle shutdown timeout" blank
sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time "
The "\" is not there.

Testing A
Added a 1 to the end of line in the script
mythdb.settings[localhostname].MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"1'
run the script and the page entry turned to
sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time\"1
The "\" is still gone but the 1 is added.

Testing B
removed the 1 from the end of line in the script
mythdb.settings[localhostname].MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"'
run the script and the page entry turned to
sudo sh -c "/usr/LH/bin/mythwelcome-set-alarm.sh $time\"
The "\" is still gone.

I tried to think up different tests to find out why the "\" dos not show up. The "\" is still gone in all of them. I could not come up with a answer.

Now here is the catch 22
Because the mythwelcome_config.py script is running on every start.
If I manually insert the \ into the statement, on a machine restart the \ will be removed.
+++++++++++++++++++++++++++++++++++++++++++++
The remaining ten statements (not including the two above)
all function as expected with the testing I did

TVBox

_________________
TVBox
LinHES R8.4


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 6:59 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
TVBox wrote:
I tried to think up different tests to find out why the "\" dos not show up. The "\" is still gone in all of them. I could not come up with a answer.

Now here is the catch 22
Because the mythwelcome_config.py script is running on every start.
If I manually insert the \ into the statement, on a machine restart the \ will be removed.
From your description that statement of the script is working correctly. The statement in the db and that you see in the setting screen should NOT have the backslashes. As I stated above, the script has them to make sure the python parser doesn't act on them as part of the syntax. For more info on escaping in python: https://docs.python.org/2/reference/lex ... g-literals


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 10:17 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
Mythwelcome can be installed or setup afterwards. It works in R8.1.1

When you run the config script mythwelcome-config.py

Right afterward a lot of times mythwelcome was up but the automatic shutdown timer was broken (something with the script)

Here is the workaround

Stop the backend
Run myth-setup
General\Shutdown/Wakeup Options

Idle shutdown timeout (secs): 30
Server halt command: /usr/bin/mythshutdown --shutdown

test it out


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 10:47 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
RacerX wrote:
Idle shutdown timeout (secs): 30
Server halt command: /usr/bin/mythshutdown --shutdown
mythwelcome-config.py enters that exact Server halt command. As we determined above mythwelcome-config.py was adding a hostname to the idle shutdown timeout. It has worked that way perfectly for me but I am wondering if that could be why you have lost the timer. Can you provide the output of:
Code:
mysql -u mythtv -pmythtv -D mythconverg -e 'select * from settings where value = "idleTimeoutSecs";'


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 11:04 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
Mythwelcome works on my R8.1.1 Master BE\FE

I started using Mythwelcome around R8 this is when I had the issue with the timer not working.

Code:
mysql -u mythtv -pmythtv -D mythconverg -e 'select * from settings where value = "idleTimeoutSecs";'


Code:
+-----------------+------+-------------+
| value           | data    | hostname |
+-----------------+------+-------------+
| idleTimeoutSecs | 30   | NULL        |
+-----------------+------+-------------+


Last edited by RacerX on Tue Apr 08, 2014 11:11 am, edited 1 time in total.


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 11:08 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 993
Location: SC
Does that change after running mythwelcome-config.py?


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 11:18 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
The results are the same

Code:
+-----------------+------+-------------+
| value           | data    | hostname |
+-----------------+------+-------------+
| idleTimeoutSecs | 30   | NULL        |
+-----------------+------+-------------+


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 9:02 pm 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 389
Location: Fargo, ND, USA
Thank you for the help

Prior to the script changes I had two standby modes. Red and Green
after the script change I have Three standby modes. Red, Green and Yellow.
After I reach yellow standby shutdown never occurs. How do I go about trouble shooting it?

My standby seems to operate properly. I have a keyboard with a sleep button on it and it puts the machine into a S3 (ram powered) sleep mode. I can run mythwelcome-test-wakeup.sh and instead of shutting it down with the script I shut it down with the keyboard sleep key and it wakes up in about 3 seconds.

TVBox

_________________
TVBox
LinHES R8.4


Top
 Profile  
 
PostPosted: Tue Apr 08, 2014 11:48 pm 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
These commands are used to troubleshoot mythwelcome

Code:
mythwelcome –v

mythbackend –v idle.system


Top
 Profile  
 
PostPosted: Wed Apr 09, 2014 2:37 am 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 389
Location: Fargo, ND, USA
RacerX
Thanks for answering

mythwelcome –v
mythbackend –v idle.system

I tried to run both of these commands in a xterm window and what happens is that the screen opens up on the Mythwelcome screen for about 2 seconds and then it switches to the screen that says "There are already 1 MythFrontends running. Do you really wan to start another one. Yes or No" . Your only option is to choose "No" and they it take you back to the Mythwelcome screen.

The commands will not run from the command line.

Any suggestions on how to get it to run.

Edit: I found RacerX Mythwelcome how to post
viewtopic.php?f=24&t=23786

TVBox

_________________
TVBox
LinHES R8.4


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu