Run an enigma2 GUI session on boot / as Engima2 has finished loading up (session.open)

  • Hi All!


    I have been working on a plugin over the last few weeks that is designed to start a specific channel after a power cut occurs / the box loses power etc. The plugin is basically complete bar a few tweaks here and there. The issue I am facing is that I am unable to get the plugin to work properly when the box reboots!


    I have attached the code used to boot the code on SESSIONSTART below:

    Code
    def main(session, **kwargs):
        print "\n[Test Program] start\n"
        session.open(channelListScreen)
    
    def Plugins(**kwargs):
        return PluginDescriptor(
            where = PluginDescriptor.WHERE_SESSIONSTART,
            fnc = main)

    I am able to load the plugin fine from the plugins menu which has allowed me to confirm that the program is able to set the channel correctly however when the box is rebooted the GUI is not displayed to the user and the channel is not changed to the user defined channel.


    I have read online that this might be caused by the fact that enigma2 has not loaded enough to be able to display a session. How can i get around this? I assume that adding a delay will just cause the Engima2 boot process to hang...! Is there an alternative option i can use instead of "WHERE_SESSIONSTART" that will allow me to run a session window (session.open(channelListScreen))?


    I look forwards to hearing back from everybody!


    All the Best!


    Oliver

  • I hope you had a good time developping. Just a question: why don't you use startupservice?

    Gruss
    Dre


    Boxen (im Einsatz): DM920, DM900, DMOne
    Developer Project Merlin - we are OpenSource

  • Hi All!


    Thank you for your help with my issue!! Very much appreciated.

    I will give these solutions a go on Monday, i'm currently away from home at the moment and dont have access to my receiver!!


    Out of interest, how recently was the WHERE_INFOBAR option implemented into enigma2? My receiver runs a fairly old version of Enigma2 (from around 2015) and will most likely need a firmware upgrade


    Thank you for your help everybody!


    All the best,


    Oliver

  • Hi All!


    I just tried the WHERE_INFOBAR option however it does look like the firmware is too old on my box. Will update and try again later this week.


    As for the WHERE_SESSIONSTART option, this appears to be working to an extent. The background tasks seem to be completed but my GUI is not displayed. I am using session.open then the GUI class but it doesn't seem to be working, it does load through the plugins menu


    All the best,

    Oliver

  • I just tried the latest firmware for my receiver, it was built in March 2018. I have had a look at the plugin.pyo file and there is no mention of the WHERE_INFOBAR command leading me to think my receiver might be too old to support this feature...!


    Seeing as this is unavailable, would it be possible to use the WHERE_SESSIONSTART feature instead? I would like the GUI I have created to be displayed as soon as the box boots into enigma. Is this going to be possible/


    Thank you for all of you help!!


    All the best,

    Oliver

  • Which receiver are you running? We're only talking about HD Dreamboxes as that feature was introduced by Dream in enigma2 3.2 which was after the fork and did exclude the DM7025.


    BTW: *.pyo files do not provide source code. Every official Dreambox image does provide the source code directly in the *.py files.


    And one last time: why don't you just use the StartupService plugin?

    so long
    m0rphU

  • Hi m0rphU!


    Thank you for your reply. I'm actually using a Technomate TM Nano-SE M2 Plus, this was because I was struggling to find a genuine DreamBox. This isnt too much of an issue however, as I intend on making the plugin cross compatible across most enigma2 boxes. My choice of receiver is most likely the reason why WHERE_INFOBAR does not work!! (Maybe this is a feature exclusive to the DreamBox series of receivers).


    I did have a look into the StartupService plugin but thought it was only capable of setting the default channel on startup! How would I go about using the StartupService plugin to autorun my plugin? The biggest issue has been getting the GUI to actually load, if StartupService can do this I will use it.


    Thanks again for your reply!


    All the best,

    Oliver

  • My choice of receiver is most likely the reason why WHERE_INFOBAR does not work!! (Maybe this is a feature exclusive to the DreamBox series of receivers).

    As written before: Yes, that feature was introduced after the fork. Everything from enigma2 v3.2 onwoards is Dreambox exclusive. The sources are still available, but you can't run it on another receiver. For this you need to check the code-base of your image (probably something Open*something?).



    I did have a look into the StartupService plugin but thought it was only capable of setting the default channel on startup! How would I go about using the StartupService plugin to autorun my plugin? The biggest issue has been getting the GUI to actually load, if StartupService can do this I will use it.


    Ah GUI. I was just referring to your first post:

    [...]I have been working on a plugin over the last few weeks that is designed to start a specific channel after a power cut occurs / the box loses power[...]


    But anyway, just have a look at the code of the startup service plugin. It migh help you find the right direction. The dream codebase of the plugin is available there: https://github.com/opendreambo…master/startupservice/src

    so long
    m0rphU

  • Oliver.M.

    If the GUI ist not loaded at SessionStart you can open your screen with session.open(yourscreen) later with an eTimer or you can open your screen with Notifications.AddNotification(yourscreen).

    from Tools import Notifications

    Gruß Sven (aka Dreamy)


    DM920 mit unstable OE2.5 DP
    One mit unstable OE2.6 DP

  • Hi All


    m0rphU, Sorry about that, I probably could have explained my issue better, Thank you for your help though!


    Sven H, Thank you for posting your solution!! the Notifications.AddNotification function has worked perfectly, thank you for your help!


    Thank you everybody, you have all been a huge help with my project and I have learnt a lot about Engima2 plugin programming.


    All the best,


    Oliver