SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Media Extender
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Media Extender Discussion related to any SageTV Media Extender used directly by SageTV. Questions, issues, problems, suggestions, etc. relating to a SageTV supported media extender should be posted here. Use the SageTV HD Theater - Media Player forum for issues related to using an HD Theater while not connected to a SageTV server.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-18-2012, 08:14 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Having SageTV extenders start up in Standby mode after hard power cycle?

Is there any way to have the SageTV extenders start up in Standby mode rather than booting up after a power loss and regain?

I haven't seen a setting anwhere, but would it be possible to change one of the Linux startup scripts in order to do this? I am guessing that I want it to boot up to waitpower rather than miniclient.

Or is this a bad idea that could lead you to get to an endless loop and a bricked extender?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #2  
Old 10-18-2012, 08:45 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Might be better off using the autosleep plugin to put it to sleep after a period of inactivity. Yes, it means it will 'power up' for a time after power on, but the power usage between standby and running idle is about a watt.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 10-18-2012, 09:05 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I am not concerned about the power - I have about 7-8 extenders on my system. When I have a power flash in my house, which used to be rare but happens more frequently in the last few months, all of the extenders that are plugged in and that aren't connected to UPS will connect to my Sage server.

This will cause my JVM to max out and will cause either no response or a totally unresponsive system. If I am not home to rectify this is cause WAF issues.

I would like to deal with it in either ways - either by what I suggested in the first post, or developing some other process that gets triggered when there is a power flash that then shuts down all of the extenders.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #4  
Old 10-18-2012, 09:09 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by wayner View Post
I am not concerned about the power - I have about 7-8 extenders on my system. When I have a power flash in my house, which used to be rare but happens more frequently in the last few months, all of the extenders that are plugged in and that aren't connected to UPS will connect to my Sage server.

This will cause my JVM to max out and will cause either no response or a totally unresponsive system. If I am not home to rectify this is cause WAF issues.

I would like to deal with it in either ways - either by what I suggested in the first post, or developing some other process that gets triggered when there is a power flash that then shuts down all of the extenders.
If that's the case, I can't help you. I do think you might be better off running a second 'server', and having the less frequently used extenders connect to it. The server can map it's import folders to your main server's recording folders, and it should import in the information (especially if you use .properties files). In this way, you will still be able to watch, and delete recordings from those extenders, just won't be able to use the guide, or schedule recordings.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #5  
Old 10-18-2012, 09:12 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I might do that - I have a backup server which is running WHS v1 but it has been behaving wonky for a while.

But I rarely use more than 3 extenders simultaneously and as long as that is the case I am fine. It is just when they all decide to power on at once that I have issues.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #6  
Old 10-18-2012, 10:53 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Right, i realize that, but while they may be 'performing fine', they would likely perform better with more heap to themselves. Even if you ran this 'secondary server' in a VM on your main server, it would allow you to get away from the heap limitations sage extenders are stuck with.

In hindsight, with the costs of RAM these days, sage would have been far better off spawning a separate JVM for each connected extender.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #7  
Old 10-18-2012, 10:55 PM
Lostinpvr's Avatar
Lostinpvr Lostinpvr is offline
Sage Advanced User
 
Join Date: Nov 2005
Location: Nashville, TN
Posts: 86
Having SageTV extenders start up in Standby mode after hard power cycle?

Not sure if this is what you are experiencing but seems to be Similar to what I have seen. If I have to unplug the power from the HD-300 to do a Hard Re-Boot it powers on and then logs into the SageTV by default. I only have 1 HD-200, 1 HD-300 and 1-MediaMVP (Yep a MediaMVP).

With the HD-300 I know a Power fail or a Manual Reset will turn them back on by default. Strangely I don't think my HD-200 acts the same way?

Is this the same as you are experiencing?

JL
__________________
Sage Ver:SageTv 7.19.256 | Server:Intel DH55HC/i5 650 3.20GHz OS:W7P | Storage: 3 TB | Client's:HD200, HD300, 1-MVP, PS | Capture:2-HVR1600, 1-HD-PVR | STB:1-HD 2-SD | 2-USB-UIRT
Reply With Quote
  #8  
Old 10-19-2012, 03:21 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by wayner View Post
Is there any way to have the SageTV extenders start up in Standby mode rather than booting up after a power loss and regain?

I haven't seen a setting anwhere, but would it be possible to change one of the Linux startup scripts in order to do this? I am guessing that I want it to boot up to waitpower rather than miniclient.

Or is this a bad idea that could lead you to get to an endless loop and a bricked extender?
If you're not concerned about power consumption then what you could do during power outage is to switch your server gracefully off via UPS signal, then when power comes back you leave all your extenders turning on and let them all going into standalone mode, then program your server to switch back on after a short delay, this way your java heap will not be affected. When your wife want to use one of the extenders then the only thing she has to do is soft power off and press the home button again to get control, simple!

Of course during power outage you'll not be able to record anything, but realistically how long the power outage last where you live?

Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #9  
Old 10-19-2012, 07:17 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I would think that if you turn off auto connect to server then when you have an electrical problem it wouldn't cause server problems. They wouldn't connect and cause JVM issues. Since I have multiple servers I always had my extenders setup this way.
Reply With Quote
  #10  
Old 10-19-2012, 08:50 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
These power outages are generally just flashes that last a second or two but they have probably occurred, on average, once a week over the last 3 months.

Turning of the auto connect is one option but that is detrimental to WAF and I personally find it annoying as well since it will mean that it will take longer to get into Sage.

I have developed a Groovy process that uses the Sage API to find the status of all extenders and turn them off. But I may want to make sure that no one is watching anything on the extender first - but that should be easy to do.

The tougher issue will be to figure out when a power flash has occurred and to run this script a few minutes later once all of the extenders have booted up. Maybe I could just monitor how many extenders are connected to the server and when it hits about 4 extenders I could run this process.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #11  
Old 10-19-2012, 11:28 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by wayner View Post
These power outages are generally just flashes that last a second or two but they have probably occurred, on average, once a week over the last 3 months.

Turning of the auto connect is one option but that is detrimental to WAF and I personally find it annoying as well since it will mean that it will take longer to get into Sage.

I have developed a Groovy process that uses the Sage API to find the status of all extenders and turn them off. But I may want to make sure that no one is watching anything on the extender first - but that should be easy to do.

The tougher issue will be to figure out when a power flash has occurred and to run this script a few minutes later once all of the extenders have booted up. Maybe I could just monitor how many extenders are connected to the server and when it hits about 4 extenders I could run this process.
Turning them off is one thing, but does that actually release the JVM usage of them?
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #12  
Old 10-19-2012, 04:18 PM
KryptoNyte's Avatar
KryptoNyte KryptoNyte is offline
SageTVaholic
 
Join Date: Dec 2006
Posts: 2,754
Based on the value of the extenders these days, not to mention the WAF while you're away, would it make sense to put them (or at least some of them) on some economical uninteruptible power supplies?
Reply With Quote
  #13  
Old 10-19-2012, 08:56 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Fuzzy View Post
Turning them off is one thing, but does that actually release the JVM usage of them?
Yes, although there does appear to be some memory leakage. For example my Java usage was about 840. I turned off one extender and the usage fell to 620.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #14  
Old 10-19-2012, 11:03 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Then is seems the autosleep plugin would be enough.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #15  
Old 10-20-2012, 02:59 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
FOr references sake, it looks like the process that starts Sage after a reboot on the extender is:
/etc /init.d/S35smp8634

There are a bunch of scripts in this directory and they are all numbered: S05, S10, ... up to S35. At least this is the case on one of my HD200s.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #16  
Old 10-21-2012, 09:27 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by wayner View Post
FOr references sake, it looks like the process that starts Sage after a reboot on the extender is:
/etc /init.d/S35smp8634

There are a bunch of scripts in this directory and they are all numbered: S05, S10, ... up to S35. At least this is the case on one of my HD200s.
Those scripts are probably what handle the various hardware events from the sigma chip, but I'm not sure you'd be able to alter/change any of their behaviors, as they are likely a part of the firmware, so can't be changed until after the device is powered on, and only on a temporary basis.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #17  
Old 10-21-2012, 10:07 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
The scripts are fairly basic - this S35 one starts up miniclient. Script S25 sets up the network, etc. The script rcS seems to run first and starts all other scripts in numerial order. So I am assuming that I could create my own script and call it S95wayner and do whatever I want.

Here is the rcS script:
Code:
STP-HD200[init.d]# cat rcS
#!/bin/sh


# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ;do

     # Ignore dangling symlinks (if any).
     [ ! -f "$i" ] && continue

     case "$i" in
        *.sh)
            # Source shell script for speed.
            (
                trap - INT QUIT TSTP
                set start
                . $i
            )
            ;;
        *)
            # No sh extension, so fork subprocess.
            $i start
            ;;
    esac
done
And here is the S35 script which attempts to start miniclient:
Code:
STP-HD200[init.d]# cat S35*
#!/bin/sh
#
case "$1" in
        start|"")
                if [ "$VERBOSE" != no ]
                then
                        echo -n "Initializing modules... "
                fi
                # CIFS is now in the kernel
#               /sbin/insmod /lib/modules/cifs.ko
#               exit 0
                /sbin/insmod /lib/modules/llad.ko
                export LD_LIBRARY_PATH=/client/lib
                /client/xrpc -ustart 2 4
                /client/xrpc -ustart 1 1
                /client/xrpc -ustart 0 2
                /sbin/insmod /lib/modules/em8xxx.ko
                rm /dev/ir
                /sbin/insmod /lib/modules/irkernel.ko
                irmajor=`awk '$2=="ir" {print $1}' /proc/devices`
                # Load FIP only if it is present to prevent wrong GPIO usage
                rm /dev/fip
#               /sbin/insmod /lib/modules/fipkernel.ko
#               mknod /dev/fip c 252 0
                mknod /dev/ir c $irmajor 0
                hdparm -S12 /dev/hda
                echo 'nameserver 192.168.0.1' > /tmp/resolv.conf
#               exit 0
                DEBUGMODE=`/sage/getprop debug_logging`
                cd /sage
                echo '*** Starting SageTV server ***'
                ./runsage &
                while true; do
                        cd /client
                        #. /tmp/config
                        export VIDEO_OUTPUT
                        export VIDEO_RESOLUTION
                        export AUDIO_OUTPUT
                        VIDEO_SUPPORTED_MODES=
                        export VIDEO_SUPPORTED_MODES
                        # For now, hard code to hdmi 1080p
#                       VIDEO_RESOLUTION="1280x720p@59|standard\=HDMI_720p59"
#                       VIDEO_RESOLUTION="720x480i@59|standard\=NTSC_M"
                        AUDIO_OUTPUT=""
#                        export VIDEO_RESOLUTION
                        export AUDIO_OUTPUT
                        export LD_LIBRARY_PATH=/client:/client/lib
                        cd /client

                        if [ "$DEBUGMODE" = "TRUE" ]; then
                                /client/miniclient 127.0.0.1 2>&1 | logger -s -t
 m
                        else
                                /client/miniclient 127.0.0.1
                        fi

                        SERVER=""
                        if [ -e /tmp/config ] ; then
                                . /tmp/config
                        fi
                        if [ "$SERVER" = "" ]; then
                                sleep 1
                                /client/waitpower
                                sleep 1
                        else
                                . /tmp/config
                                mv /tmp/config /tmp/configold
                                export VIDEO_OUTPUT
                                export VIDEO_RESOLUTION
                                export AUDIO_OUTPUT
                                export VIDEO_SUPPORTED_MODES
                                export CACHED_AUTH
                                export SERVER_NAME
                                if [ "$SERVER" = "" ]; then
                                        IP=`/client/miniclient`
                                else
                                        IP=$SERVER
                                fi
                                if [ "$FIRMWARE_UPDATE" != "" ]; then
                                        export FIRMWARE_UPDATE
                                        export LD_LIBRARY_PATH=
                                        /client/flashserver &
                                        export LD_LIBRARY_PATH=/client:/client/l
ib
                                fi
                                powerret=2
                                while [ "$powerret" = "2" ]; do
                                        if [ "$DEBUGMODE" = "TRUE" ]; then
                                                /client/miniclient $IP 2>&1 | lo
gger -s -t m
                                        else
                                                /client/miniclient $IP
                                        fi
                                        sleep 1
                                        /client/waitpower
                                        powerret=$?
                                        sleep 1
                                        if [ -e /tmp/patch.properties ] ; then
                                                powerret=1
                                        fi
                                done
                        fi
                done
                ;;
        stop)
                ;;
        *)
                echo "Usage: `basename $0` {start|stop}" >&2
                exit 1
                ;;
esac
STP-HD200[init.d]#
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #18  
Old 10-21-2012, 10:11 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by wayner View Post
So I am assuming that I could create my own script and call it S95wayner and do whatever I want.
Nope, the script are not in the user re-writable flash file system, so in order to change it you need to make a new firmware...sorry.

Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #19  
Old 10-21-2012, 10:19 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks Eddy - is there any way to run a script from the USB flash drive? I notice that script S30 mounts the USB flash drive - can you then run scripts from this drive.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #20  
Old 10-21-2012, 10:47 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by wayner View Post
Thanks Eddy - is there any way to run a script from the USB flash drive? I notice that script S30 mounts the USB flash drive - can you then run scripts from this drive.
Not automatically, I'm afraid, unless you have the "udev" daemon running, which unfortunately isn't...

Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about using Firewire to power cycle my STB SDeGonge Hardware Support 2 06-01-2010 06:15 AM
cycle power or leave on? walter scott SageTV HD Theater - Media Player 19 01-28-2010 05:53 PM
My two HD200 needs power cycle a few times a week personalt SageTV Media Extender 2 11-24-2009 03:20 PM
HDPVR power cycle 'loses' the remote dead_ferrets Hardware Support 14 06-03-2009 04:37 PM
V4.1.10 MVP - stv selection not surviving power cycle hchucky SageTV Beta Test Software 10 04-06-2006 01:28 AM


All times are GMT -6. The time now is 12:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.