#domogik

/

      • gin28 has quit
      • gin28 joined the channel
      • gin28 has quit
      • gin28 joined the channel
      • Ycarus joined the channel
      • fritz_ghola
        bonjour
      • cereal_
        hi
      • fritz_ghola: here?
      • this will be faster then email
      • fritz_ghola
        cereal_: yes
      • why "because we need a webserver :)"
      • flask was not enough for admin ?
      • by the way, you mean to replace tornado by gunicorn
      • cereal_
        flask is only a dev server
      • fritz_ghola
        "So Tornado can be quite good for very small custom WSGI application where they don't do much and so response is very quick, but it can suffer where you have long running requests running under a blocking WSGI application. Gunicorn will therefore be better as it has proper ability to handle concurrent requests. With gunicorn being single threaded though and needing multiple worker processes though, it will use much more memory."
      • OverLoad
        'lu
      • fritz_ghola
        we have several blocking calls, so the more I read on tornado, the more indeed, this is not the best solution for us
      • hello OverLoad
      • cereal_
        fritz_ghola: thats indeed what i start to think
      • i think the best solution would be to run a real webserver and then run flask from within that one
      • fritz_ghola
        uWSGI seems to be an alternative to gunicorn also
      • the fact is a real webserver imply a more complicated install
      • especially if the user have already its own webserver
      • cereal_
        indeed that would be more complicated, but it would be the best i think
      • fritz_ghola
      • cereal_
        thats another solution
      • fritz_ghola
        crap crap crap
      • I am really not sure of what we should do...
      • we have several topics to handle here :
      • - non blocking calls
      • - ssl
      • - an easy install process
      • - easy to ttest for developpers
      • cereal_
        websockets
      • because the way we do it now is really tight into tornado
      • brb
      • fritz_ghola
        indeed
      • uwsgi seems fine
      • a lot of options
      • but we will have to change the bin/admin.py to something else (or call it over something else) to run the uwsgi command line
      • cereal_
        nah inside bin/admin we should start the uwsgi contrainer in starthttp
      • fritz_ghola
        you found an example ?
      • cereal_
        with gunicorn yes
      • but we have other problems this way
      • fritz_ghola
        which ones ?
      • cereal_
        in starthttp we pass some stuff to the flask app
      • this can not be done if we run them outside python
      • so we should load all these things on flask init (doable)
      • the way we handle websockets will be a complete rewrite
      • as they need to move into flask
      • fritz_ghola
        indeed
      • cereal_
        sot he websocket will be the hardest
      • the other are easy to solve
      • fritz_ghola
        so gunicorn ?
      • Kaz joined the channel
      • R4v3n joined the channel
      • R4v3n has quit
      • R4v3n joined the channel
      • cereal_
        not sure
      • to be hinest i like an external server the most
      • and gunicorn/uwsgi have the same needs/problems
      • fritz_ghola
        which problems do you think of ?
      • cereal_
        the ones i described above
      • mainly the websocket handling
      • fritz_ghola
        but we will also have ws to handle even with nginx or anything else
      • or I miss something
      • cereal_
        yes true
      • i have gunicorn running with admin
      • and i see the login page
      • fritz_ghola
        the easiest part :)
      • cereal_
        yes
      • fritz_ghola
      • are we align on these points ?
      • about an external webserver, it could help us to use lets encrypt also, and so make ssl configuration a lot easier...
      • but this will hardened the install process
      • cereal_
        gunicorn in python code | gunicorn or uWSGI outside of python code
      • thos are basically the same
      • fritz_ghola
        or if we do this, in 0.6 we support only a few possibilities in the install script; for example debian 8.6 + nginx and ubuntu 17.x + nginx
      • cereal_
        the only difference is that we do a system call or we just call the python code
      • fritz_ghola
        yes, but this is an important difference for a developper usage
      • cereal_
        thats one line difference in start_http in admin.py
      • fritz_ghola
        if you want to launch only the admin component, you launch what ? flask part, the wsgi launcher ?
      • cereal_
        we launch admin.py
      • and admin.py starts the gunicorn when we normally started tornado
      • fritz_ghola
        ok
      • so, which do you want to do ? I let the choice to you
      • _Raynor_ joined the channel
      • OverLoad has quit
      • cereal_
        i'll look into gunicorn (but hitting problems already)
      • _Raynor_
        Hello, is there a way for a Domogik instance running on computer A, to use, say, an USB RFXtrx433E plugged on computer B (both computer being on the same network)?
      • cereal_
        so no promisse yet
      • fritz_ghola
        cereal_: ok, I let you this point
      • _Raynor_: I would say yes and not
      • we have no reinclude the multi server features on domogik
      • _Raynor_
        Basically: use various devices from other computer
      • fritz_ghola
        so you can't install a plugin on another server
      • but if I remember correctly, there are some way to use some other server serial devices on a server
      • _Raynor_
        fritz_ghola: what is (was?) the multi server features?
      • fritz_ghola
        install domogik on 2 servers, 1 master, 1 slave
      • _Raynor_
        Theses ways are out of Domogik scope I guess?
      • Ah ok
      • fritz_ghola
        you can install a plugin on the slave
      • this was a 0.3 feature
      • we didn't rewrite this in 0.4 (0.4 was sort of a reboot)
      • it will be done a day, but not sure when
      • not in 0.6 (current deve release) at least
      • _Raynor_
        So when you are saying "yes", you mean: yes on old 0.3 release then?
      • fritz_ghola
        no
      • "yes" as I am quite sure there are some ways to "mount" another server serial devices on a server
      • but this is outside of domogik
      • _Raynor_
        OK :)
      • fritz_ghola
        something like this maybe : netcat www.example.com port </dev/ttyS0 >/dev/ttyS0
      • cereal_
        fritz_ghola: not sure about the websockets how we should do that
      • fritz_ghola
        You can create a Serial-Over-Lan (SOL) connection by using socat. It can be used to 'forward' a ttyS to another machine so it appears as a local one or you can access it via a TCP/IP port.
      • _Raynor_: try these things
      • cereal_
      • _Raynor_
        My goal is to use a "real" computer as the main server (already acting as such server for other goals) by installing Domogik on it, but use smaller computers (such as Raspberry Pi) to "place" RFXtrx433E near the devices it controls, and RPi's GPIO (for reading electric meter, which is in the basement).
      • cereal_
        _Raynor_: lwet the rpi handle this, if you make it sends/receive xpl then you can easely do this
      • _Raynor_
        Thanks, I'll look into theses
      • cereal_
        fritz_ghola: i want to do this in a couple of steps
      • 1- move the websockets into flask
      • 2- move the stuff for flaskinit into flask
      • 3- then look at what server to use
      • 1/2 will always be needed
      • and then we can simple test different servers
      • _Raynor_
        cereal_: Domogik on computer A, RFXcom on computer B and xpl between the two
      • s/two/two?/
      • fritz_ghola
        for rfxcom it won't work like this, you have a usb model, so you need the plugin to use it
      • for other things, if you have xpl stuff outside of domogik, you could put them on the rpi and use the generic plugin to cathc these xpl messages
      • I think that what ceral mmeant
      • else, you can also use the script plugin to launch some ssh commands from the main server to call a script to read values on the gpiio of the rpi
      • of use the vdevice plugin to create devices on domogik and call an url to set the value of the device from a script on your rpi
      • we really need to document all this for people...
      • cereal_
        fritz_ghola: ok with above shema?
      • fritz_ghola
        I was realing your link
      • yes, ok
      • cereal_
        this way we can easely manage it and test all step by step
      • fritz_ghola
        yes
      • cereal_
        and only the moment we start to implement part 3 people will/should notice something
      • fritz_ghola
        it seems really fine
      • _Raynor_
        fritz_ghola: Thanks for the insights: I'll try netcat-ing the USB port
      • fritz_ghola
        :)
      • cereal_
        2pff this will not be easy
      • as tornado can not pass the websockets to flask ..
      • fritz_ghola
        :(
      • cereal_
        this means that 1 and 3 needs to be done at the same time
      • fritz_ghola
        yes