Page 1 of 1

Using Websockets

Posted: Sat Jun 18, 2016 12:38 pm
by Jabberwock
In my attempts to use EventGhost to control QLC+ I have tried out several Websockets plugins for that software. However, none of them worked - they could not connect to the QLC+ server (at the 9999 port). I have decided to test it in another way and have used a Simple Web Socket Client available as a plugin for the Chrome browser. However, I could not connect with it either. What am I missing?

Re: Using Websockets

Posted: Sat Jun 18, 2016 3:06 pm
by mcallegari
QLC+ implements the standard RFC 6455 websockets specifications. (I have written it from scratch for version 4.10.3 !)

I found awkward that you need a websocket plugin for Chrome when Chrome implements websockets natively via javascript.
Maybe you haven't had a look at this ?
http://www.qlcplus.org/Test_Web_API.html

Oh, and I hope you know that the QLC+ webserver is not active by default. You need to launch QLC+ with the -w option

Re: Using Websockets

Posted: Sat Jun 18, 2016 3:13 pm
by Jabberwock
I did have a look at the API and know it works. I just wanted to try out an external websockets app (aside from EventGhost) which would allow me to test the interface. If I understand it correctly, the Chrome plugin (and possibly EventGhost implementations) do not work as they do not follow the standard you have specified?

Re: Using Websockets

Posted: Sat Jun 18, 2016 5:17 pm
by Jabberwock
For what it is worth, I have also tested three Websockets apps on my Android phone - no connection either.

I know that the webserver needs to be started, I have checked that it is working with the test API page. As it has no Close button, just in case I have first checked the apps and then the API test page. The apps fail to connect while the test API page works correctly.

Re: Using Websockets

Posted: Sat Jun 18, 2016 5:52 pm
by mcallegari
As I said, websockets have a RFC specification. Implementers should follow it to talk the same language. Who didn't follow the RFC is out of standard, so they speak an unknown language.

It might help if you tell us which apps you tested, so I can eventually have a look at what is going on.
Otherwise, as a comparison reference, you can test those apps with QLC+ 4.10.2 or older which had a totally different web server.
If they still don't work, then the apps are definitely not following the RFC. If they work, then it means the RFC implementation of the current QLC+ webserver is incomplete.

Re: Using Websockets

Posted: Sat Jun 18, 2016 6:26 pm
by Jabberwock
I have tested 4.10.2 with the Android apps (Websocket client by Johan Denoyer and WebSocket by Riccardo Amadio) and it works - I am able to tap a button with them. The EventGhost plugin connects with the server, I have not yet figured out the correct way of sending the messages. So it seems something is wrong with 4.10.4... sorry about that.

Re: Using Websockets

Posted: Sun Jun 19, 2016 8:38 am
by mcallegari
Alright, I downloaded the apps and found out what's going on.

QLC+ exposes the websocket at the URL

Code: Select all

ws://<ip address>:9999/qlcplusWS
I forgot about that.

If you enter that address in the WebSocket app by Riccardo Amadio, it works out of the box.
The other websocket app, instead, is less flexible, so there's no way to enter a specific URL. It always tries to open the websocket on the "/" URL.
I could apply a workaround to make it work (I tried and it works), but is it really needed ?

[EDIT] Websocket client by Johan Denoyer works as well if you enter the IP address on the first field and "9999/qlcplusWS" in the port field. Quite hackish, but it works

Re: Using Websockets

Posted: Sun Jun 19, 2016 11:53 am
by Jabberwock
That was the missing piece!

In the EventGhost Webserver plugin it works without problem out of the box. That is, on my testing machine - on the target the connection is denied, but then so is with the Web_API page. I suspect there might be a firewall problem or something.

Thanks a lot for your assistance, when I fix my target machine everything will be working well!

Re: Using Websockets

Posted: Sun Jun 19, 2016 4:06 pm
by Jabberwock
There is some oddity here, but I cannot figure out what it is. On my target machine I cannot activate any widget elements in my workspace with EventGhost or the Android app. With web API it works. What is curious is that EG and Android both work on the very same computer if I set the channels manually (with „CH|1|255”). What is even more odd, is that if I create a new workspace, place a new button, rename it and attach to a function, both EG and Android can control it! I can send you the misbehaving workspace, if you want...