Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 2 of 6 FirstFirst 1234 ... LastLast
Results 16 to 30 of 90

Thread: Auto Change Channel Before Going on Standby

  1. #16
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,762
    Thanks
    473
    Thanked 607 Times in 433 Posts
    I still havent tested this but OpenATV already have something in place for custom standby scripts
    Code:
    https://github.com/openatv/enigma2/commit/f8f20c86f73748ee30564fcb8df66739990b3d26#diff-540acf08816e2c9c140f420d5390a0c1
    Maybe Vix can do the same.

    Edit they changed to use Console().ePopen instead of os.system
    Code:
    https://github.com/openatv/enigma2/commit/1e54b1be4e2f526fc9b84678a42deaee18fef486#diff-540acf08816e2c9c140f420d5390a0c1
    Last edited by dsayers; 01-03-18 at 19:38.

  2. #17

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    Quote Originally Posted by dsayers View Post
    I still havent tested this but OpenATV already have something in place for custom standby scripts
    Code:
    https://github.com/openatv/enigma2/commit/f8f20c86f73748ee30564fcb8df66739990b3d26#diff-540acf08816e2c9c140f420d5390a0c1
    Maybe Vix can do the same.

    Edit they changed to use Console().ePopen instead of os.system
    Code:
    https://github.com/openatv/enigma2/commit/1e54b1be4e2f526fc9b84678a42deaee18fef486#diff-540acf08816e2c9c140f420d5390a0c1
    hi, So what are the implications of this, what does this means? can i add os.system to the file myself?

    Thanks

  3. #18
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,762
    Thanks
    473
    Thanked 607 Times in 433 Posts
    Quote Originally Posted by ess2k View Post
    hi, So what are the implications of this, what does this means? can i add os.system to the file myself?

    Thanks
    Yes you can add it yourself I was just giving info for devs to look at so maybe something like this can be standard then users would add there standby scripts to usr/scripts in StandbyEnter.sh and StandbyLeave.sh.

    I haven't tested yet but attached is an edited Standby.py FTP Standby.py to \usr\lib\enigma2\python\Screens and save a copy of the .pyo.

    Reboot box.

    Create your script and call it StandbyEnter.sh and FTP it to usr/scripts when you press stanby it should run the script.

    For creating the script test it with script runner first to see if it works.
    Attached Files Attached Files
    Last edited by dsayers; 01-03-18 at 21:30.

  4. The Following User Says Thank You to dsayers For This Useful Post:

    ess2k (01-03-18)

  5. #19

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    @dsayers

    Thank you for going through the trouble, I have tried but for some reason i cannot get it to work. I have backups of the origional standby.pyo, deleted it, put your standby.py in, restarted and it created the pyo as expected. i created my script and put it in the correct folder and set correct permissions but nothing happens.

    I have but the script in the bin folder and ran the script from putty and it changes the channel, my script is just this,
    Code:
    wget -q -O - http://127.0.0.1/web/zap?sRef=1:0:19:1B1D:802:2:11A0000:0:0:0
    i tried running the script from the usr\scripts folder in putty but keep getting, no such file or directory found, but its there, to try and run the script from that folder i am simply typing in the following, usr/scripts/StandbyEnter.sh

    any ideas? ( i am pretty new at this linux commands stuff)

  6. #20
    ccs's Avatar
    Title
    ViX Beta Tester
    Join Date
    Sep 2014
    Posts
    5,836
    Thanks
    554
    Thanked 1,277 Times in 1,089 Posts
    ....try /usr/scripts/StandbyEnter.sh rather than usr/scripts/StandbyEnter.sh

  7. The Following User Says Thank You to ccs For This Useful Post:

    ess2k (01-03-18)

  8. #21
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,762
    Thanks
    473
    Thanked 607 Times in 433 Posts
    Quote Originally Posted by ess2k View Post
    @dsayers

    Thank you for going through the trouble, I have tried but for some reason i cannot get it to work. I have backups of the origional standby.pyo, deleted it, put your standby.py in, restarted and it created the pyo as expected. i created my script and put it in the correct folder and set correct permissions but nothing happens.

    I have but the script in the bin folder and ran the script from putty and it changes the channel, my script is just this,
    Code:
    wget -q -O - http://127.0.0.1/web/zap?sRef=1:0:19:1B1D:802:2:11A0000:0:0:0
    i tried running the script from the usr\scripts folder in putty but keep getting, no such file or directory found, but its there, to try and run the script from that folder i am simply typing in the following, usr/scripts/StandbyEnter.sh

    any ideas? ( i am pretty new at this linux commands stuff)
    I have just copied and pasted the wget script and pasted in putty and it zaps to BBC 1 HD, it can also be ran in script runner, menu, setup, vix, script runner choose StandbyEnter.sh

    Im currently on OpenATV and they call it Job manager and it runs fine but not when pressing standby.

    So I thought I would try another script so in StandbyEnter.sh I put
    Code:
    #!/bin/bash
    wget -O /tmp/ABM.xml "https://raw.githubusercontent.com/oe-alliance/AutoBouquetsMaker/master/AutoBouquetsMaker/providers/sat_282_sky_uk.xml" &> /dev/null 2>&1
    Pressed standby and it downloaded sat_282_sky_uk.xml to ABM.xml in tmp, so im not sure why it doesnt change change channel on standby

  9. #22

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    Quote Originally Posted by ccs View Post
    ....try /usr/scripts/StandbyEnter.sh rather than usr/scripts/StandbyEnter.sh


    that got the script to run from the folder usr - scripts. thank you for that, i certainly wont forget that / again

  10. #23

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    @dsayers

    thanks you for all your help, i didnt know what script runner was until now, i ran the script from script runner and it works. again, crazy how 1 script works fine proving the code is correct but this particular script dont.

    edit: do you think adding
    Code:
    #!/bin/bash
    to the beginning of the script would make a difference?

    edit 2- nope, it dont.
    Last edited by ess2k; 01-03-18 at 23:23.

  11. #24
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,781
    Thanks
    237
    Thanked 1,658 Times in 1,306 Posts
    Quote Originally Posted by ess2k View Post
    I have but the script in the bin folder and ran the script from putty and it changes the channel, my script is just this,
    Code:
    wget -q -O - http://127.0.0.1/web/zap?sRef=1:0:19:1B1D:802:2:11A0000:0:0:0
    Whcih won't work, as "?" is an active shell character.
    try:
    Code:
    wget -q -O - 'http://127.0.0.1/web/zap?sRef=1:0:19:1B1D:802:2:11A0000:0:0:0'
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  12. The Following User Says Thank You to birdman For This Useful Post:

    ess2k (02-03-18)

  13. #25

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    Quote Originally Posted by birdman View Post
    Whcih won't work, as "?" is an active shell character.
    try:
    Code:
    wget -q -O - 'http://127.0.0.1/web/zap?sRef=1:0:19:1B1D:802:2:11A0000:0:0:0'
    I really thought this would do the trick, it made perfect sense, but it still won't work

    so i tried another script,
    Code:
    grab -d -p /tmp/test.png
    Though it works from script runner, it doesnt from standby, i even tried the scripts as StandbyLeave.sh just to test and they still dont run.

    could it be a openvix issue?

  14. #26

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    just to show what i have done, in case i am doing something wrong,
    1.jpg Standby.py as provided dsayers (thank you)

    2.PNG Modifies StandbyEnter.sh as suggested by birdman ( thank you)

    3.PNG Image of where i am copying file to, and file attrib

    4.PNG Image of where i am copying file to, and file attrib
    Last edited by ess2k; 02-03-18 at 10:40.

  15. #27
    ccs's Avatar
    Title
    ViX Beta Tester
    Join Date
    Sep 2014
    Posts
    5,836
    Thanks
    554
    Thanked 1,277 Times in 1,089 Posts
    Quote Originally Posted by ess2k View Post
    that got the script to run from the folder usr - scripts. thank you for that, i certainly wont forget that / again
    If the script is in the current directory, then ./scriptname is all you need.
    The full pathname (the one starting with /usr in your case) will work from any directory.

    I'm not sure which the current directory script runner starts up in, so it's best to cd into the one you want at the start of the script.
    (Using the full pathname.)
    Last edited by ccs; 02-03-18 at 11:11.

  16. #28
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,781
    Thanks
    237
    Thanked 1,658 Times in 1,306 Posts
    Quote Originally Posted by ess2k View Post
    just to show what i have done, in case i am doing something wrong,
    1.jpg Standby.py as provided dsayers (thank you)
    That code refers to leaving standby, not entering it. You want the bit lower down....(as ccs noted in #20).
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  17. #29

    Title
    Member
    Join Date
    Jan 2015
    Posts
    41
    Thanks
    12
    Thanked 1 Time in 1 Post
    Quote Originally Posted by birdman View Post
    That code refers to leaving standby, not entering it. You want the bit lower down....(as ccs noted in #20).
    Hi, I am sure the code for entering standby is there too, i collapsed a couple sections just so i could show the code fro entering standby, if you look at the second half of the image, the text in green it says "use custom script when putting in standby" i am sure this is the correct section for entering standby.

    unless I am wrong?

  18. #30
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,781
    Thanks
    237
    Thanked 1,658 Times in 1,306 Posts
    Quote Originally Posted by ess2k View Post
    Hi, I am sure the code for entering standby is there too,
    Ah, sorry. Gave up reading too soon.

    The thing to do is to write a script that just echoes some text to a file in /tmp. That will check that the facility is working.
    Once that is working, to debug a script that then isn't put this at the top:

    Code:
    #!/bin/sh
    #
    
    exec > /tmp/standby.log 2>&1
    set -x
    ...
    ...your actual code....
    ...
    This will produce a (debug) log of what is happening in /tmp/standby.log and let you figure out what is going wrong.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

Page 2 of 6 FirstFirst 1234 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.