Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[Mut@nt] HD51 Auto Change Channel Before Going on Standby

  • Thread starter Thread starter ess2k
  • Start date Start date
E

ess2k

Guest
Hi

I would like to set some sort of a channel change shortcut to happen when i press the standby button, so that when i press the standby button, it first changes the channel to say BBC1 and then goes on standby. Is this possible? even though maybe some sort of a script?

Thanks in advance.

ess
 
It's easy to set BBC1 to always be the startup channel if that's what you're trying to achieve?
 
You cant set a shut down channel. But as in post 2, you can set a start up channel. It doesnt have to be bbc 1.
 
Sorry, i should have explained my situation better.

Basically I have some channels as streams setup on my box, and I can have 2 streams simultaneously, also i record streams too. so i wanted the channel to change before standby so that while the box is in standby it isn't using up a stream.

I understand that boot up channel can be set, but that isn't what i am looking for. I read somewhere that the the standby.pyo file can be modified. any ideas or direction would be appreciated.
 
I have had a little look but not tested
Code:
https://dream.reichholf.net/wiki/Enigma2:WebInterface#Zap

So maybe have a script to zap to BBC 1 then in the standby.py maybe call it on the def __onFirstExecBegin(self): https://github.com/OpenViX/enigma2/...24a963989f/lib/python/Screens/Standby.py#L124

I could be totally wrong though

Edit seen this with users running scripts on standby
Code:
https://www.domoticz.com/forum/viewtopic.php?f=61&t=2505#p19177
 
Last edited:
I have had a little look but not tested
Code:
https://dream.reichholf.net/wiki/Enigma2:WebInterface#Zap

So maybe have a script to zap to BBC 1 then in the standby.py maybe call it on the def __onFirstExecBegin(self): https://github.com/OpenViX/enigma2/...24a963989f/lib/python/Screens/Standby.py#L124

I could be totally wrong though

Edit seen this with users running scripts on standby
Code:
https://www.domoticz.com/forum/viewtopic.php?f=61&t=2505#p19177

WOW! Thanks, why didnt i find that!

Can i please just ask, on the box itself the file ends in pyo and is not editable with notepad, i can download the source .py file from the github which is editable but then how do i change the .py back to .pyo?

i am venturing into new territory with linux

Thanks
 
Always make a backup of the .pyo file first.

Restart and the .py file will compile to .pyo file.
 
WOW! Thanks, why didnt i find that!

Can i please just ask, on the box itself the file ends in pyo and is not editable with notepad, i can download the source .py file from the github which is editable but then how do i change the .py back to .pyo?

i am venturing into new territory with linux

Thanks

Just visit that github link choose raw and copy all the text and past in notepad++ (standard notepad maybe fine but ++ is better) save as Standby.py do your edits and transfer it Standby.py to \usr\lib\enigma2\python\Screens

Save a copy of the origional .pyo in case it causes issues then you can send it back. Reboot box and the py should compile as .pyo
 
Someone may have a better way to check standby in script then if stanby switch channel else exit, you could then have it run in timer every ten minuets this maybe better than editing .py files as it may cause issues when updating the box.

This method looks good
Code:
https://www.domoticz.com/forum/viewtopic.php?t=2505#p16305
only issue is I dont have lcd folder this maybe due to me having Uno4k and I have no display
 
Thank you guys for all your help, i will be trying this tonight. just a couple final questions so i know exactly what i am doing.

1. when i copy the modded .py to the box, should i delete the .pyo before restart? (i will deffo back it up before i delete)
2. does the compiling take a noticeable amount of time, or should i not notice in change in initial boot up after change? (just asking so i know if it hangs and i can replace original file and that i am not being too hasty)

Thank you soo much, you guys have been an immense help, i will report how i get on after i have had a go.
 
I'd stop enigma first (init 4) before making changes, and restart with init 3 (they're telnet commands).

Just rename the .pyo file to .pyo.ok

You'll not notice any "compiling" so if it slows down you know it hasn't work.

Take an image backup before you make any changes and put it on a usb stick in case the box stops and you can't telnet in to repair it.
 
Last edited:
You can delete it if you want I just normally leave them as I take a backup of them and it shouldn't take much longer to boot
 
Thank you very much all, you have been incredibly helpful. I will give this a go tonitght.
 
Someone may have a better way to check standby in script then if stanby switch channel else exit, you could then have it run in timer every ten minuets this maybe better than editing .py files as it may cause issues when updating the box.

This method looks good
Code:
https://www.domoticz.com/forum/viewtopic.php?t=2505#p16305
only issue is I dont have lcd folder this maybe due to me having Uno4k and I have no display

I will check this method out too, as i have read that an update would overwrite the standby.pyo file, so thank you for this link
 
Can i please just ask, on the box itself the file ends in pyo and is not editable with notepad,
Best not to use notepad for editing anything that is going onto this box anyway. it adds (and expects DOS line endings. The box uses Unix ones.
You could try notepad++ instead (suitably configured).
 
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:
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
 
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.
 

Attachments

Last edited:
@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)
 
....try /usr/scripts/StandbyEnter.sh rather than usr/scripts/StandbyEnter.sh
 

OpenViX Feeds Status

Back
Top