How to fork web control ? (to control QLC+ from AS3 AIR app)

Archive of the non-categorized posts related to the QLC+ technical support.
Please do not create new threads here, instead, use the categories above !
Post Reply
Pissou
Posts: 3
Joined: Sun Feb 14, 2016 4:42 am
Real Name:

Hi,

Firsly sorry for my english.

2 days i'm trying to send commands by "websocket" from a third app i'm developping... on Adobe Air (AS3)...

Sadly Air seems can't send OPEN DMX signal (without wasting one year to do it).

As I'm a QLC+ user : I hoped control QLC+ from my app... sadly too I don't know if any command car be recevied by QLC directly by the native process...

And as I'm a lucky guy Air don't seems to like send midi data... it would be too simple

That's why i'm trying to fork QLC web access page to send data as javascript does :

My code looks like this in AS3 (cleared)
_socket.connect("localhost", 9999); // it seems to works because if QLC is off or not in -W mode it throws an error
_socket.write("QLC+CMD|CH|1|69"); // my command string
_socket.flush(); // it sends data

I've cleaned the code over, but i've try it in UTF-8, unicode, bytes etc...

Either nothing happends, either i've a 400 Bad Request

As I just spent the night on it and my brain starts burnin', could you help me or just say me if it is only possible to accès QLC like that : "QLC+CMD|CH|1|69" ? Is there any controls of socket source that can explain I can't do it, or it's just because i'm a dumber ?

Thank you guys !
Sylvain

(I've even think my app could command a robotic hand which play real keyborad to controls QLC+ but I think there's a simplyest way to do it ;-) )
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

That doesn't work because you don't have to send QLC+CMD. Where did you read you need to do it ??
This is the reference API web page (see setSimpleDeskChannel function)
http://www.qlcplus.org/Test_Web_API.html

And this is the javascript code of the Simple Desk page sending a DMX value:
https://github.com/mcallegari/qlcplus/b ... sk.js#L132

There is no QLC+CMD, just CH|channel|value
Pissou
Posts: 3
Joined: Sun Feb 14, 2016 4:42 am
Real Name:

For QLC+CMD : https://github.com/mcallegari/qlcplus/b ... bsocket.js
Line 22 ... i've try everything. I've read all sources but without any known of C... it's quite hard !

Well, i've try to make a page witch capture $_get in url like ?CH=1&VAL=42, but after hours, it works within Firefox, but AS3 loader dont use Socket as I already known (i've to sleep).

Return to start point : i've to directly target ws://' + window.location.host + '/qlcplusWS' but class Socket in AS3 trown an error if I put anything else than "localhost" on 9999 ...

thank you for your link http://www.qlcplus.org/Test_Web_API.html , il works fine there, it's not mysteriously generated by the soft.... and it's not in https ...My problem seems to come from AIR .... I've to continue my quest ... Or change of job.


Thanks for your quick answer and your great work !
Pissou
Posts: 3
Joined: Sun Feb 14, 2016 4:42 am
Real Name:

If someone have the same problem in the future (I now that future and AIR are not compatible but...), the native class AIR doesn't connect to ws:// protocol (it seems it only support IP).
I've try with that one and it works as expected !

https://github.com/theturtle32/AS3WebSocket

Thank you again,
Sylvain.

ex:

Code: Select all

	import com.worlize.websocket.WebSocketEvent;
	import com.worlize.websocket.WebSocket;
	
var websocket:WebSocket = new WebSocket("ws://localhost:9999","myconnection");
websocket.addEventListener(WebSocketEvent.OPEN, handleWebSocketOpen);
websocket.connect();
			
function handleWebSocketOpen(event:WebSocketEvent):void {
	trace("Connected");
	websocket.sendUTF("CH|1|100");
}

Post Reply