New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending ArtNet #60
Comments
Thanks for this. If I'm going to implement ArtNet I'm more inclined to do it in a separate library and use that library in this project. do you have any docs that helped you understand the ArtNet protocol? |
I'm using this very cheaply to build artnet node: https://github.com/mtongnz/ESP8266_ArtNetNode_v2 and the S1-DR DMX dimmer (2 channels) from aliexpress Works really stable. I haven't developed it myself, just creative searching on the web and copy-pasting and adjusting along the way. Found it originally here: http://www.oscat.de/community/index.php?topic=880.0 |
I have been working with the code that @Petorrrrr has posted and integrated into this project code. I am not a full time progammer so improvements are probably possible. I've created a variable as Petorrrr stated, created the DMXSend PRG and created a DMX task, running in freewheeling mode. I wanted to use the FB_OUTPUT_DIMMER_MQTT functionblock. I copied it to a DMX specific one FB_OUTPUT_DIMMER_MQTT_DMX (this shouldn't be necessary, could be integrated in the normal one).
I added a method to intitialize the DMX variables:
In the PublishReceived method I changed:
to
Then inside the main functions I added this on the top of the code:
And changed the "ELSIF SINGLE THEN" to:
At the end I've added:
Works very nice (I think), when I click a pushbutton (single) the light fades out, when I click it again it fades in. When I set a value through MQTT the light fades to this value. |
Cool! Unfortunately, this didn't work out fully for me. I use a slightly different setup where I created additional Virtual dimmers for use with my OpenHAB instance with MQTT. Don't recall the exact reasons, but I think it was the easiest way for me with limited knowledge. But you inspired me to add the fade functionality in the DMX_SEND program. So I added/changed this:
|
@jaccospelt thanks for sharing, much appreciated! Could you perhaps share your project over here? I'm planning to add a dedicated page on it. For sure it will help other people as well. |
@jaccospelt any chance you could share your project? I tried to reconstruct your work based on the code snippets above, but that did not work out completely. I am not totally sure how to incorporate this in the main program and also #75 seems to interfere. Once I have it up and running, I will document this feature in order to help others. |
thank you for the feedback on sharing on this one. |
Does anyone have some updates, or is willing to share their code? |
As posted on Gitter, I managed to get the pfc200 to output ArtNet communication.
Included you find my project (I've anonimized the IP adresses used, but not my home setup). It's written in codesys 3.5 SP15 patch 3
homeAutomation export.zip
In essence, I've created another Global Variable List (OtherVariables) where I store the var DMX. In here I store the artnet characters to be send.
In the program DMX_SEND the first 18 characters get initialized (mandatory for ArtNet) and then it loops through the DMX variable to add the DMX values to the send buffer. If it detects a value has changed a flag "send" is set to true.
If send is true, an ArtNet message is sent over UDP to the specified IP address.
This program runs in Freewheeling mode (if you do it cyclic it doesn't always pick up all the changes if you change more than 5 channels through MQTT).
I'm sure that the code can be cleaned up. I've mostly copy-pasted it and adjusted it so that it's working (stable).
Also in here are some minor changes to some of the functions, if needed I can provide some more detail. Also I've done some visualization. Since this issue is focusses on the ArtNet part I won't describe this further.
The text was updated successfully, but these errors were encountered: