Page 6 of 7
Re: Tornado (webserver with WebSocket)
Posted: Tue Aug 12, 2014 9:33 am
by TRIROG1
Pako!
Could you please tell me what is the last version that will work with EventGhost r1640?
Thanks!
Re: Tornado (webserver with WebSocket)
Posted: Wed Aug 13, 2014 7:37 am
by Pako
TRIROG1 wrote:Could you please tell me what is the last version that will work with EventGhost r1640?
If you carefully read the descriptions for each version, so you can easily find out that it is version 0.3.
However - why you need to use the old version?
I think it would be more useful to fix the problem that is preventing you use the new version.
Pako
Re: Tornado (webserver with WebSocket)
Posted: Wed Aug 13, 2014 1:01 pm
by TRIROG1
Hi!
I saw that there was also a version 0.3b but i don't know if it is a stable release or just a beta.
I'd love to use the last version of EG but i can't seem to figure out the problem with loading the config.py - as described
here
Re: Tornado (webserver with WebSocket)
Posted: Wed Aug 13, 2014 3:04 pm
by Pako
TRIROG1 wrote:I'd love to use the last version of EG but i can't seem to figure out the problem with loading the config.py - as described
here
I've read it before, but I'm not sure that I understand this correctly.
This behavior is reproducible?
This behavior is the same on every computer?
Pako
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 6:06 am
by TRIROG1
Seems like i solved my problem ... getting acquainted with tornado now

...
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 6:14 am
by TRIROG1
Is it possible to get rid of the index.html showing in url?
In webbrowser it only opens zhe url without the /index.html appendix and it's the same with the "It works" page...
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 8:17 am
by Pako
TRIROG1 wrote:In webbrowser it only opens zhe url without the /index.html appendix and it's the same with the "It works" page...
I'm sorry, but my English is not enough.
Can you please write in other words?
Pako
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 10:07 am
by TRIROG1
Of course
If Default document setting is empty in the tornado plugin settings and open
http://localhost/
i get the "It Works page"
the URL in firefox says
http://localhost/ - Good!
But if i put "index.html" in the Default document setting and open
http://localhost/
i get the index page
but the URL in firefox is
http://localhost/index.html - i don't like that!
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 10:59 am
by Pako
Yes, the option "Default document" is designed exactly for this purpose.
If you see this behavior as unsatisfactory, so in this case Tornado plugin is not suitable for you.
It is not allowed to browse the directory structure.
You must define the document you want to view.
Pako
Re: Tornado (webserver with WebSocket)
Posted: Thu Aug 14, 2014 8:07 pm
by leothlon
Hello.
I'm working on a webui to run with tornado getting updates from websockets.
i have currently only made the page to controll lights, and added music controll that will be on all pages.
it looks rather good on both pc and tablet. (my focus is android tablet, i want to use it as control pannel on the wall)
The problem i have however is that it feels kinda slow, atleast changing page does. the websocket updates and commands works well however.
Right now the page works in the way that:
1. User clicks on a lamp, command is sent to EG.
2. EG turns of lamp with tellstick / rfxcom / zwave.
3. EG use tornado broadcast all values (this is so that if multiple devices have gui up they all update correctly and shows the same info).
4. The webgui parse the broadcast message to update the gui.
I am now wondering if anyone here could help me clean up the code abit, especially to make changing pages faster but also just to get the better.
Note:
I did normal links between the pages before but that causes the javascripts to be loaded again and websocket to be connected again for every page change.
So i then tried getting the <body> tag from new page and replace the current <body> tag, this was still slow so now i tried to make all pages in same html file seperated in their own div and then just hide / show the corrent page. figured this could help with using function on .show and .hide to open / close Websocket to xbmc on movie page. (havn't decided if i am gonna do xbmc controll straight from webgui or have EG work the "middle-man" for that to)
Download link: (forum wouldn't let me upload here, file to big)
http://www.filedropper.com/webgui
Re: Tornado (webserver with WebSocket)
Posted: Fri Aug 15, 2014 7:05 am
by Pako
It looks nice.
I've tried it, but problems with the speed I was not noticed.
Redrawing was immediate.
The truth is, I've tried it only on localhost.
When I used a cell phone, so the initial page is displayed in full resolution (that is only cut out) and it was not possible to shrink.
Interesting is the date - it shows me that I am one month younger.
Pako
Re: Tornado (webserver with WebSocket)
Posted: Fri Aug 15, 2014 9:00 am
by leothlon
Yea, when i run the site on a computer (even if its not localhost). the site works fast and well.
It is mainly designed for android tablet and to look good there. the scaling is still not what i want 100% but it looks decent on 1920x1080.
On phone with smaller display i havn't tried, i was thinking of making another gui for that as i feel using the floorplan layout would be to cluttered on such small display.
But as my main coding language is .net and i am not all that good with javascript even if i know some i figured there must be quite afew performance upgrades i could do to the code, so i figured i would ask here..
Also the background image is quite large, anyone here good with CSS and knows if its possible / how hard it would be, to create the background with CSS rather than use a image? or is my best bet just to try and make the image smaller?
Also does anyone know if you can use "normal" jquery for html5 apps, (instead of the jquery-mobile)
Couse then maby i could build the webgui into an android app, that might work faster, kinda like running on localhost?
also i forgot to say that holding mouse down on dimmable lamps gives you a slider to select dim level (try on the 2 lights in the livingroom)
Re: Tornado (webserver with WebSocket)
Posted: Fri Aug 15, 2014 10:31 am
by krambriw
3. EG use tornado broadcast all values
Maybe I misunderstood, but you only have to broadcast the single state if it changes, not all states. This could improve your performance provided you currently are broadcasting all states when a single state is changing
Re: Tornado (webserver with WebSocket)
Posted: Fri Aug 15, 2014 10:37 am
by leothlon
The reason i set it to broadcast all values was that in the early stage of developing the ui it did not always recieve the value on all connected devices, but if i then broadcasted all values this would correct itself whenever next change happened.
So if one update failed it would still be fixed if another device updated istead of having to wait for that same device to change value again.
Do you think i will save alot by having only the single value broadcasted? i will look into this later tonight to test.
Thanks for the advice.
Re: Tornado (webserver with WebSocket)
Posted: Tue Aug 19, 2014 6:13 am
by leothlon
Does anyone know how much WebSocket connections affects the network?
i am currently setting up xbmc control on my webgui but now i don't know if i should have the webpage connect directly to my 3 xbmc machines using websocket or if they should go throu EG as a "proxy"...
if i have 3 controller clients with webgui open:
1. Android tablet
2. PC
3. Phone
they would all need to connect to each xbmc giving 3x3=9 open connections.
then add that each need to be connected to EG that would give 3 more connections. 9+3=12
Now also add that EG needs to be connected to each xbmc (to control lights and such depending on play/pause/stop events). adding up to a total of 15 open connections.
in the future sonos control might be added to resulting in additional connections to.
So my question now is, how will all thease open connections affect the network and the performance of my xbmc machines (one is just a raspberry pi..)
Would it be better to instead have the webpage open one websocket to EG only, then when i want to query the xbmc library for all my tv shows i would send command to EG to trigger event wich gets the tvshow list+detail and send it back to webgui.
this would make getting tvshow list abit slower but it would only need 6 open connections. (3 from webgui to EG, 3 from EG to xbmc)