Using Websockets

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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?
User avatar
mcallegari
Posts: 4514
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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?
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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.
User avatar
mcallegari
Posts: 4514
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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.
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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.
User avatar
mcallegari
Posts: 4514
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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!
Jabberwock
Posts: 7
Joined: Tue Jun 14, 2016 6:50 am
Real Name:

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...
Post Reply