Jump to content


Photo

screwed SocketMMI.py


  • Please log in to reply
24 replies to this topic

#1 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 10:41

Hi!

 

May I ask who had the glorious idea to completely screw up the SocketMMI.py implementation ?

 

The C++ part still allows multiple connections to the /tmp/mmi.socket, but the python part of the OpenPLi image now has hardcoded that only a single socker 0 is allowed ?

 

     def setSession(self, session):
                self.session = session

        def connected(self):
                return socketmmi.getState(0)

        def getName(self):
                return socketmmi.getName(0)

        def startMMI(self):
                slot = 0 <<<<<<< ????????????
                self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed, ....

 

 

In an original DMM image this looks like this (slot is always passed as an argument as it should be):

 

    def numConnections(self):                                              
                return self.socket_ui.numConnections()                         
                                                                               
        def getState(self, slot):                                              
                return self.socket_ui.getState(slot)  
                                                                               
        def getName(self, slot):                                               
                return self.socket_ui.getName(slot)                            
                                                                               
        def startMMI(self, slot):                                              
                self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed ....

 

 

 

Same in plugin.py, only single connection is allowed:
 

 

def main(session, **kwargs):
        socketHandler.startMMI()

def menu(menuid, **kwargs):
        if menuid == "setup" and socketHandler and socketHandler.connected():
                return [(socketHandler.getName(), main, "socket_mmi", 0)]
        return [ ]

 

 

Compare:

 

def menuCallback(slot, session, **kwargs):
        socketHandler.startMMI(slot)      
                                    
def menu(menuid, **kwargs):
        ret = [ ]          
        if menuid == "setup" and socketHandler:
                connections = socketHandler.numConnections()
                slot = 0;                                   
                valid = 0;
                while valid < connections and slot < 256:
                        if socketHandler.getState(slot):
                                ret.append((socketHandler.getName(slot), boundFunction(menuCallback, slot), .....................
                                valid += 1                                     
                        slot += 1         
        return ret               

 

 

This causes second connection to the mmi.socket to never get connected:

 

netstat -alx | grep mmi
unix  2      [ ACC ]     STREAM     LISTENING      13540 /tmp/mmi.socket
unix  3      [ ]         STREAM     CONNECTING         0 /tmp/mmi.socket
unix  3      [ ]         STREAM     CONNECTED      13555 /tmp/mmi.socket

 

 

 

Can somebody please explain what the (good) intention was in this case and if there is a fair chance to revert it to allow multiple MMI connections again ?

 

Ciao

gutemine


Edited by gutemine, 4 September 2016 - 10:45.


Re: screwed SocketMMI.py #2 WanWizard

  • PLi® Core member
  • 70,396 posts

+1,807
Excellent

Posted 4 September 2016 - 10:50

Unless MiLo's automated whitespace fix contains an error, I don't see any intentional change? https://github.com/O...MI/SocketMMI.py

 

The lines you refer to are from: Andreas Monzner, committed on 20 May 2008, so I suggest you ask DMM?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: screwed SocketMMI.py #3 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 11:27

Please check the commit from Ghost - he just fixed one line, but WHO did ( remove or probably forget) all the other changes since then ?

 

Normally you are much better on committing changes that others have done ;)

 

Don't get me wrong, I just want to understand what happened and make you aware that it is more or less unusable that way if you have more then 1 MMI server socket that needs attention  ...


Edited by gutemine, 4 September 2016 - 11:31.


Re: screwed SocketMMI.py #4 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 4 September 2016 - 11:31

Can you explain first why multiple MMI connections are mandatory?

Edited by littlesat, 4 September 2016 - 11:32.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: screwed SocketMMI.py #5 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 11:38

well there are softcams that connect to mmi.socket to show their menus in the extensions menu, but this is also for showing CI menus there and not only within the Common Interface menu screen.

 

And as most boxes have 2 CI slots and still could have a softcam there could be definitely more then 1 connections possible. In my opinion support for up to 3 is a must. DMM even allows up to 255 as you can see from the code snipped that I posted for comparison.

 

I just found out when I investigated why my AutoPin plugin always shows the first CI Module menu in your image, even when I choose the second one. The slot argument is ignored which gives always the same menu.


Edited by gutemine, 4 September 2016 - 11:42.


Re: screwed SocketMMI.py #6 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 4 September 2016 - 11:48

Can you point us to DMM's patch so we can cherry pick it? I'm afraid this is not possible anymore...

The latest we have was from far back in 2008...

 

https://github.com/O...b4f67557afb7d38

 

And in this code it was also not yet multiple in DMMs code...

 

I also do not see it in OE-A code...

 

I fully agree that for multiple CIs (with some softcams) it might be mandatory...

 

As far I can see your hint above we still mis a part here... e.g. startMMI needs a new mandatory variable.... Please note most part of DMMs code is closed source... so sometimes it is guessing...

In addition I'm not the correct person to 'recode' this part as I do not own multiple CIs etc.... (as it is not yet such mandatory in the Netherlands).

 

I cannot explain the good of it... as back in 2008 this was simply the same code we cloned that time from DMM... the only change we made to it ware some white spaces in this DMM code made back in that time... I can only mention the bad why we never received a merge request from someone with multiple CIs who is capable of testing it...


Edited by littlesat, 4 September 2016 - 11:56.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: screwed SocketMMI.py #7 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 11:56

Come on, this is a public Plugin on their Feed, all the python sources are there:

 

DreamOS:

 

http://www.dreamboxu...r0.1_mipsel.deb

 

OE 2.0:

 

http://www.dreamboxu....0_mips32el.ipk

 

The only thing which you have to fix yourself on your outdated implementation is your socket_mmi.cpp as you are lacking the numConnections routine ... but this is probably a simple connections++;  in the connect routine and a connections--; in the disconnect routine and a routine returning this value if asked for it ...


Edited by gutemine, 4 September 2016 - 11:59.


Re: screwed SocketMMI.py #8 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 4 September 2016 - 12:02

The only thing which you have to fix yourself on your outdated implementation is your socket_mmi.cpp as you are lacking the numConnections routine ...

 

This "only" thing is closed source.... So not helpfully at all...

And the other stuff you point us, is also not helpfully at all without having that closed source stuff part...

 

I suggest until someone offer us a real solution here... case closed....

 

I cannot make it... due to time, no CI+ (hardware samples) etc...

 

But thanks for notifying that for multiple CI support we need to do something regarding multiple MMI sockets... Thanks for this added value to the open source community from you... ;)

 

Hopefully someone with  the required CIs, cpp knowlege, python knowledge can offer us a ready to use solution...


Edited by littlesat, 4 September 2016 - 12:06.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: screwed SocketMMI.py #9 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 12:05

you are not able to add a handfull lines of code YOURSELF where I even hinted you how simple it would be ????

 

DMM even adds a proper swig interface so they now have a socketmmi.py instead of laoding the so directly which means the API is open and technically documented.

 

I can do this extra C++ routine in 5 min, but I'm sorry, now YOU lost also your chance that I will help ANY further with such a reply.

 

Then enjoy your OpenSource with code from 2008 :o and all the whitespaces fixed ....


Edited by gutemine, 4 September 2016 - 12:09.


Re: screwed SocketMMI.py #10 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 4 September 2016 - 12:08

For you everything is simple... When it is that simply why do you simply offer us a merge uest.... Especially when YOU can do it in five minutes....

Yes we enjoy OpenSource... and open minded Source...

Thanks for your open minded help...


Edited by littlesat, 4 September 2016 - 12:10.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: screwed SocketMMI.py #11 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 12:14

I even told you how simple it would be - if you don't take advice and only want to Cherry pick (as you wrote yourself) or collect patches others are doing - then don't try to explain to me who's mind is closed ....

 

The numConnections is only needed for a simple while statement, you can even hardcode the maximum value as long as your getState(slot) returns correctly (which it currently doesn't despite the argument passed). Which means you don't even need the handfull of C++ llines if you want to stay with your outdated implementation.

 

Which means you didn't even look at the code .... before starting your OpenSource lecture ...


Edited by gutemine, 4 September 2016 - 12:18.


Re: screwed SocketMMI.py #12 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 4 September 2016 - 12:18

I have here DMM sources from 2011, I don´t see too much differencies with PLi code ,SocketMMI.py , socket_mmi.cpp , socket_mmi.h , I can upload it if it is OK 



Re: screwed SocketMMI.py #13 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 12:19

If you only want to copy from others without coding yourself ... enjoy ...



Re: screwed SocketMMI.py #14 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 12:31

This is how it looks like with 2 CI Modules and 1 Softcam properly connected via MMI - just that you know and see what you are missing ...

Attached Files


Edited by gutemine, 4 September 2016 - 12:33.


Re: screwed SocketMMI.py #15 Dimitrij

  • PLi® Core member
  • 10,299 posts

+347
Excellent

Posted 4 September 2016 - 12:35

gutemine

thanks for the info, I hope we will soon make a change.

It remains only a small problem, almost nothing, CI+ on the openPli not work :) .


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: screwed SocketMMI.py #16 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 12:47

It doesn't allow anybody to run an MMI Interface python or binary application as soon as the slot is occupied.

 

Here is the same screenshot with OpenPLI Image running also nicely with 2 Modules and the same softcam on a 7020hd from one of my AutoPin testers running all this nicely - except the F*d up MMI results.

 

Hence your reply is nonsense :D

 

But thanks for working on it, because the previous reply in simply not acceptable .. in my narrow mind. And sorry for the double piostings.

Attached Files


Edited by gutemine, 4 September 2016 - 12:51.


Re: screwed SocketMMI.py #17 theparasol

  • Senior Member
  • 4,157 posts

+198
Excellent

Posted 4 September 2016 - 13:24

Sorry to add more text instead of code to this topic. Most of you know already I'm a bad coder and need to testdrive my code until it works and on my machines compiling small changes to openpli takes forever so the coding fun is spoiled for me but  I think Gutemine is right, its really simple indeed!

 

Openpli can use unmodified plugin.py and socketmmi.py from OE2.0

 

Only thing that has to be done is adding to openpli socket_mmi.cpp a simple counter that increases and decreases with each CI module that is attached to the box.

And add a function numConnections() that returns it. Seems all the rest is already in it, even the slot parameter is there but openpli simply isnt using it yet.

By using the python scripts from OE2.0 it does. So what seems to be done is just a connection counter and function to return its value.

 

 


@Camping: ZGemma H.2S, Technisat Multytenne 4-in-1 @Home: Edision Mini 4K, Wave Frontier T55, EMP Centauri EMP DiSEqC 8/1 switch, 4x Inverto Ultra Black single LNB


Re: screwed SocketMMI.py #18 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 14:44

Thanks for confirming my argument.

 

Don't forget the SocketMMI.py it will be also need to be replaced with the enhanced one which uses the slot argument.

 

You can even put slot=0 in the argument list of the functions which are enhanced with the slot argument, so that it is only an optional argument with 0 as default.

 

For Plugins which are not (yet) passing the argument then everything will stay the same ...


Edited by gutemine, 4 September 2016 - 14:44.


Re: screwed SocketMMI.py #19 Dimitrij

  • PLi® Core member
  • 10,299 posts

+347
Excellent

Posted 4 September 2016 - 17:29

http://git.opendream...82dad909dec8f32

There are no files  socket_mmi.cpp/socket_mmi.h


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: screwed SocketMMI.py #20 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 4 September 2016 - 17:45

Please READ what I posted.

 

The sources of OE 2.0 socketmmi.so are NOT public, you will have to code these tiny changes YOURSELF as I wrote and theparasol summarized already.

 

if this is already too difficult ... no comment. And NO, this doesn't violate what is stated in the LICENSE file.


Edited by gutemine, 4 September 2016 - 17:47.



5 user(s) are reading this topic

0 members, 5 guests, 0 anonymous users