E2OpenPlugins / e2openplugin-OpenWebif

GPL Web Interface for e2stabs
GNU General Public License v3.0
204 stars 226 forks source link

PowerState a small issue with tuner #754

Closed s3n0 closed 6 years ago

s3n0 commented 6 years ago

Hello.

I recently added two additional states to control the power mode in OpenWebif (it was approved).

However, there is a minor problem. I've found that by clicking on the channel name (in userbouquets), the tuner will start, while the TV stays off - which is probably OK.

I do not use the HDMI-CEC plugin because my LG-TV does not support HDMI-CEC, but just the stupid Simplink protocol. So I only use two scripts (/usr/script/EnterStandby.sh ; LeaveStandby.sh) to turn on/off the TV via RS232 connection (fully functional). That does not matter, however.

So where's my problem ?! Subsequently, when I send a command to switch to Standby mode, the code verifies whether the device is in Standby mode. And this is just a problem. The device replies that it is already in Standby mode and the command is not executed in this case. But I need to turn off my tuner again (it takes a bit of electricity)! I still notice that the "POWER" graphic button is always red at all times.

It also works to command "Wake Up" power mode - no test condition whether or not the device is in Standby mode. It is unnecessary. Or is there any other reason why there must be a "if inStandby" condition?

I use this "tuner-only" mode to debug Softcam plugins (with the TV turned off). But as soon as I suddenly try to switch the device back to Standby, I can not do it.

The solution could be adding code that detects the status of the tuner. Or better solution - simply remove the existing standby mode detection in the code to activate "power mode 5". This Standby command ("power mode number 5") should always and at all costs tell the set top box to go into Standby mode - without detecting whether it is already in it ! This is not a standby switch ("Toggle_Standby") but a command to go straight to Standby regardless of everything !

But I do not know if this can be done - delete the condition if inStandby is not None: from the code:

elif state == 5: # Standby
    if inStandby is None:
        session.open(Standby)

...so I prefer to write ISSUE :).

If that's possible, will you change it ? Will it not do any other problems ?

Well thank you. :-)

https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/control.py

jbleyel commented 6 years ago

I think you are on the wrong way.

You have a different issue on your box If inStanby == None but the box is not in standby vice versa. You have to take a look here .../Screens/Standby.py

In addition: The 2 new buttons are useless because the toggle button do exactly the same.

I will not add a tuner state check. Many people so am i use the box in standby but the tuner is active while recording.

s3n0 commented 6 years ago

There are a lot of cases when the satellite box needs to literally fall asleep. Do not "flip over" and pray that the "turn on" mode will be detected to sleep. There are a lot of holes and bugs in the system. Thinking that the system works perfectly is a huge mistake. In 10 years, Enigma 2 systems will not work for 100%.

If I want the device to go into Standby, does the device refuse to do so? My system is allegedly in standby mode. Super :). But why is it then running a satellite tuner and decoding a satellite channel? :) After clicking on any satellite channel in OpenWebif, the tuner will simply turn on and the decoding will begin. Why does not the correct wake-up from OpenWebif? The TV does not work and the set top box behaves as if it were in Standby mode (depending on the status variable).

This code strongly reminds the Microsoft Windows code activity. The Windows system code decides on the user in 90% of cases. When the user commands something to the system, the system performs 10 other things that decide to perform the system itself at the expense of the user :).

By the way, this is a FormulerF3 box with OpenATV 6.1 image.

I thought there were two possibilities: to fine-tune the OpenWebif code to work with Toggle_Standby, or to add a Standby command to the code (what I did). So, according to what you write, can not one of these be done?

Just for constant problems with the state of the power variable I wanted to have a direct command in the power change menu - "go to standby immediately and do not ask, do not find, do not check ... but just pass on the result of your sleep! " :-).

Standby mode works correctly on my set top box. Only when I use the OpenWebif channel list to switch the station is a problem with Standby mode. So, in my opinion, it's not a problem with my device, but the OpenWebif problem. I really use this problem with success, so I should not complain :). I only worry that the set top box refuses to switch to standby when I ask for a standby mode.

Why does not my box switch through Wake Up or Toggle Standby after clicking on a satellite channel in OpenWebif? I really do not know.

jbleyel commented 6 years ago

As i said. The openwebif is the wrong place to fix enigma2 issues. If there is an issue and the standby detection is not working correctly please contact the openatv team.

s3n0 commented 6 years ago

No... you read it badly. The problem is not in standby mode detection. The problem is that when you click on a channel in OpenWebif, TUNER will start, but the Enigma will not go into the "on" mode and stay in "standby" mode.

For me personally, this is not a problem. It suits me for my collaboration (I already wrote it). It should be just a report / suggestion for improvement. OpenWebif does not wake up the entire satellite box. Only a tuner wakes up. Relax please. :-)

Can you please show me where exactly when you click on a channel under the OpenWebif web interface will a wakeup of a satellite box ? The Java function zapChannel is called by clicking on the satellite channel (in the OpenWebif GUI interface). But nowhere can I see the effort to wake up the satellite box - I can not find it anywhere in the code. I would like to know this for a better definition of the problem as you write - with Enigma (OpenATV specifically). Otherwise, I can not write a bug report in OpenATV. DebugLOG shows very little about it.

I'm a stupid assembler programmer, sorry :). I create complex logic algorithms, I do not write "commands" when programming but numbers. Sorry. I can not find another call through the website - '/ api / zap? ........'

Will I find the code to wake up a satellite box that does not work (with OpenATV) from an unknown cause?

Well thank you.

function zapChannel(sRef, sname) {
    var url = '/api/zap?sRef=' + escape(sRef);
    webapi_execute(url,
    function() {
        $("#osd").html(tstr_zap_to + ': ' + sname);
        $("#osd_bottom").html(" ");
    });
}
jbleyel commented 6 years ago

Zap is here:

https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/web.py#L154

and then here

https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/ee2cc2fb474257a1cf6c11326eed9078e480a0ce/plugin/controllers/models/control.py#L86