Page 1 of 1
How to let the websocket override the desktop version
Posted: Sat May 25, 2024 2:51 am
by Ihaveseenthelight
Hi, how are you all? I am trying to control a light via a websocket in python. I have everything working to the point where i see my light flashing when i run my ws.send command. However, it is just a flash and then returns to the values specified in my desktop application and localhost. How do i disable their output.
Re: How to let the websocket override the desktop version
Posted: Sun May 26, 2024 9:25 am
by GGGss
Ihaveseenthelight wrote: ↑Sat May 25, 2024 2:51 am
However, it is just a flash and then returns to the values specified in my desktop application and localhost. How do i disable their output.
Welcome to the forum,
Please explain your last sentence? What is a desktop application and what do you call a localhost? A localhost refers to 127.0.0.1 in networking terms. It does not relate to QLC+ or lighting consoles in general...
And what output do you want to disable?
Re: How to let the websocket override the desktop version
Posted: Sun May 26, 2024 4:22 pm
by Ihaveseenthelight
Thank you! Oké, it's not the local host then. I don't have my laptop in front of me, but I have an ip address and use port 9999. By using this address and port I can control the sliders from my browser.
The qlc.exe file is what i refer to as the desktop application.
I can adjust a slider in qlc+ or in my browser and that will change the color of the light, but when i use websocket.send('1' | '255') (or something like that) it just flashes red briefly. I want it to remain the specified color i send with python instead of flashing briefly and returning to the color that is specified by the sliders in either qlc+ or my browser.
I can be more detailed tomorrow when i have my laptop.
Re: How to let the websocket override the desktop version
Posted: Mon May 27, 2024 8:24 am
by GGGss
Did you try the web api here?
https://www.qlcplus.org/Test_Web_API.html
What you sent was a value for a DMX channel. For a fixture to stay lit, you have to call a scene...
Re: How to let the websocket override the desktop version
Posted: Mon May 27, 2024 3:45 pm
by Ihaveseenthelight
* i read your sentence about the web API first and then wrote the answer below. Oke, so I will have to control scenes then. How would i proceed if want to just send a sequence of values to a channel? Would that even be possible?
Uhm. i got the web api connected yesterday, but that does not seem to work anymore.
However, when i type this in in my browser url, i see the simpledesk and can control the sliders: http://<myipaddress>:9999/simpleDesk
this is my program:
import requests
from websocket import create_connection, WebSocketException
TARGET_WS_URL = "ws://<myipaddress>:9999/qlcplusWS"
ws = create_connection(TARGET_WS_URL)
ws.send(f"1|255")
I would expect channel one to go red.
In the inputs/outputs screen in QLC+ i select my ipadress as the input and DMX USB as output, as i control my lights via an Enttec USB dongle.
The moment I select the this IP address as the input, the lights start flickering in what appear to be random sequences and random colors.
Re: How to let the websocket override the desktop version
Posted: Tue May 28, 2024 6:46 am
by GGGss
Ben,
When you refer to ip-address:9999 your are using the web remote part of QLC+.
You do not have to set an input since the web remote (and the associated api) work out of the box. (That is if you set the correct startup parameter
https://docs.qlcplus.org/v4/advanced/co ... parameters)
In your Python environment, your can use Artnet as an output and things will become very easy... QLC+ then translates incomming Artnet packets to DMX output. In this case you need to set an Artnet input and DMX output in Passthrough mode.
https://pypi.org/project/python-artnet/
Re: How to let the websocket override the desktop version
Posted: Tue May 28, 2024 10:15 am
by Ihaveseenthelight
Ah great. Thank you for explaining so clearly and providing the links! I will dive into that.