Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Tornado (webserver with WebSocket)
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
I do not know if there are any browsers fully support HTML5, also on the platform iPhone / iPod / iPad and the Windows phone platform.
Please, is there anyone among us who has the opportunity to try it?
Thanks, Pako
Please, is there anyone among us who has the opportunity to try it?
Thanks, Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
On iPhone it is supported perfectly out of the box in Safari and UC Browser+
Best regards, Walter
PS In the next post is the simple test html page I made that is using websockets with your Tornado plugin and it is working just as perfect in the iPhone with Safari, UC Browser+ as well as under Windows (Vista) in Chrome, Firefox and Opera.
Best regards, Walter
PS In the next post is the simple test html page I made that is using websockets with your Tornado plugin and it is working just as perfect in the iPhone with Safari, UC Browser+ as well as under Windows (Vista) in Chrome, Firefox and Opera.
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Hello,
I decided to try to create a very simple sample of an html page just to understand and try out the websocket functionality with your Tornado plugin. It is working fine
I just copied the file to the EventGhost www-musicbee folder where you have the index.html and related.
One problem I at least have. Everytime I edit a html-files, the changes are not affective unless I restart EG completely. I tried to stop/start the plugin but it doesn't help. It seems that the Tornado server is caching existing pages somehow.
Would need a kind of page re-load action or so...
Best regards, Walter
PS now also tested successfully with Blackhawk, Torch Browser under Windows.
Works also fine with Chrome under Android
I decided to try to create a very simple sample of an html page just to understand and try out the websocket functionality with your Tornado plugin. It is working fine
I just copied the file to the EventGhost www-musicbee folder where you have the index.html and related.
One problem I at least have. Everytime I edit a html-files, the changes are not affective unless I restart EG completely. I tried to stop/start the plugin but it doesn't help. It seems that the Tornado server is caching existing pages somehow.
Would need a kind of page re-load action or so...
Best regards, Walter
PS now also tested successfully with Blackhawk, Torch Browser under Windows.
Works also fine with Chrome under Android
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
Hi Walter,
Thank you for your detailed feedback.
So i-family is fine, so there is a need to test Windows phone platform, if I understand it well.
Best regards,
Pako
Thank you for your detailed feedback.
So i-family is fine, so there is a need to test Windows phone platform, if I understand it well.
Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Well, your MusicBee page also loaded fine but I did not control the MusicBee itself but I can see MB events in EventGhost when I tap the web buttons on the iPhone. It connects without problems.
So I would say yes, if you make web pages with websocket features as provided, it works fine
My best regards, Walter
So I would say yes, if you make web pages with websocket features as provided, it works fine
My best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Pako,
Now I have fully migrated my home automation system to use your Tornado plugin including the websocket support.
It is working very well.
The old solution based on webserver and websocket suite plugins has done a great job so far but now it is time to move forward!
Thanks,
Walter
Now I have fully migrated my home automation system to use your Tornado plugin including the websocket support.
It is working very well.
The old solution based on webserver and websocket suite plugins has done a great job so far but now it is time to move forward!
Thanks,
Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Walter,krambriw wrote:Now I have fully migrated my home automation system to use your Tornado plugin including the websocket support.
It is working very well.
I'm very, very pleased.
I assumed (already during the development Tornado plugin), that in projects, using the Tornado,
some of the options of the original Webserver plugin will be unused.
However, despite the fact I made ÔÇïÔÇïa new plugin as compatible as possible.
It was for this reason in order the transition (from Tornado plugin to Webserver plugin) was as simple as possible.
BTW, which new "Websocket actions" you use the most?
Do you have any suggestions for improvements?
Do you have any suggestions for better wording of the text?
Thanks, Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Pako,
It is a bit early to say in details yet, I have to use if for a while and discover more possibilities.
Currently I am using mostly 'BroadcastMessage'
Best regards, Walter
PS if you find a solution so that it is possible to edit & change a html page without restarting EG would of course be very much wished for
It is a bit early to say in details yet, I have to use if for a while and discover more possibilities.
Currently I am using mostly 'BroadcastMessage'
Best regards, Walter
PS if you find a solution so that it is possible to edit & change a html page without restarting EG would of course be very much wished for
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Walter,krambriw wrote:PS if you find a solution so that it is possible to edit & change a html page without restarting EG would of course be very much wished for
I am convinced that it is not necessary to restart EventGhost.
That should be enough to empty your browser cache.
But in my experience EventGhost restart is often faster.
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Pako,
This morning I discovered the Tornado plugin with an error as in the log below. The CPU load was very high, when stopping (disabling) the Tornado plugin, it was down to normal low again. Enabling it, the CPU load was very high again.
It was a normal BroadcastMessage action request that was causing this.
I had to restart EG to cure the problem...
Best regards, Walter
This morning I discovered the Tornado plugin with an error as in the log below. The CPU load was very high, when stopping (disabling) the Tornado plugin, it was down to normal low again. Enabling it, the CPU load was very high again.
It was a normal BroadcastMessage action request that was causing this.
I had to restart EG to cure the problem...
Best regards, Walter
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\__init__.py", line 1265, in __call__
23:29:01 return self.plugin.BroadcastMessage(message)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\__init__.py", line 2916, in BroadcastMessage
23:29:01 client.write_message(message)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\__init__.py", line 849, in write_message
23:29:01 self.ws_connection.write_message(message, binary=binary)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\lib\tornado\websocket.py", line 593, in write_message
23:29:01 self._write_frame(True, opcode, message)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\lib\tornado\websocket.py", line 582, in _write_frame
23:29:01 self.stream.write(frame)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\lib\tornado\iostream.py", line 220, in write
23:29:01 self._handle_write()
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\lib\tornado\iostream.py", line 551, in _handle_write
23:29:01 _merge_prefix(self._write_buffer, num_bytes)
23:29:01 File "C:\Program\EventGhost\plugins\Tornado\lib\tornado\iostream.py", line 1003, in _merge_prefix
23:29:01 chunk = deque.popleft()
23:29:01 IndexError: pop from an empty deque
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
Dear Walter,
At this point, I do not know what to do.
But perhaps the cause could be some unusual format of the message.
You have the opportunity to find out what was the content of the message, when it happened?
Best regards,
Pako
At this point, I do not know what to do.
But perhaps the cause could be some unusual format of the message.
You have the opportunity to find out what was the content of the message, when it happened?
Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
Hello Pako,
In the meantime I have changed the code in iostream.py from line 1002 to the below. I will run for a while and see if it comes back and what can be debugged...
In the meantime I have changed the code in iostream.py from line 1002 to the below. I will run for a while and see if it comes back and what can be debugged...
Code: Select all
while deque and remaining > 0:
try:
chunk = deque.popleft()
if len(chunk) > remaining:
deque.appendleft(chunk[remaining:])
chunk = chunk[:remaining]
prefix.append(chunk)
remaining -= len(chunk)
except:
app_log.error(str(prefix),
exc_info=True)
app_log.error(str(deque),
exc_info=True)
app_log.error(str(remaining),
exc_info=True)
Last edited by krambriw on Mon Jan 20, 2014 1:02 pm, edited 1 time in total.
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
Hi Walter !
But eg.Print() or eg.PrintError(), it worked ...
Pako
I've discovered during development that I can not use print inside the Tornado code.krambriw wrote: INstead of 'pass' I tried to insert a print statement but I did not manage to get it work
But eg.Print() or eg.PrintError(), it worked ...
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Tornado (webserver with WebSocket)
ok, thanks I have changed a bit, see above in the code
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: Tornado (webserver with WebSocket)
is it possible to get eventghost var iable in an javascript for the site?
in the html file you just do {{eg.globals.variablename}} right? but how can i use the eg variable in the javascript?
couse for some reason xbmc dont alow cross domain requests, so i cant have my eg webpage fetch data from xbmc library, so my thought would be to have eg xbmc plugin fetch the data every x hours and save it to a variabe i then call in my javascript...
or if anyone know a way to post and url and fetch the response cross site that would work to
in the html file you just do {{eg.globals.variablename}} right? but how can i use the eg variable in the javascript?
couse for some reason xbmc dont alow cross domain requests, so i cant have my eg webpage fetch data from xbmc library, so my thought would be to have eg xbmc plugin fetch the data every x hours and save it to a variabe i then call in my javascript...
or if anyone know a way to post and url and fetch the response cross site that would work to