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
Dmx output component for light / fan #319
Comments
Related: esphome/esphome-core#25 |
@OttoWinter
Does anything hardware or architecture wise that would prevent me from getting this to work? |
No, it should work. The library you pointed to however does not seem to support ESP devices, you probably need to use another one. |
Last couple of evenings I have been working on implementing support to DMX512 protocol. Here is the code for further discussion and perhaps future merge request. Example YML:
|
Any news on this? I'd be interested in this feature as well. ESP8266 + MAX485 is exactly the setup I have. I'm using https://github.com/mtongnz/ESP8266_ArtNetNode_v2 at the moment, but it's not very reliable in my experience as I get frequent reboots of the esp with flickering of the lights included. Also I'm already using esphome and an integration into it would be awesome :-) |
Also interested in DMX output support! |
I'm also very much interested in DMX support and I had a look at the current solutions. All have their drawbacks:
For the software side, the additional transistor is by far the simplest solution. All other methods to generate the break signal (88us low on the Tx line) that I am aware of are more workarounds and would require some nasty changes to the UART component. @OttoWinter I'd be interested in what you consider the simplest / cleanest solution, or in other words: How to best implement this? |
@andyboeh I'm on ESP32 too, look at dmx_no_uart branch. It uses most common ESPDMX library with no UART component as dependency. It should work both ESP32/8266. But still generates some stability issues... IMO brake signal isnt problem at all, but sending DMX frame on every loop. |
Ah, thanks for the hint, I didn't see your other branch! I'll have a look at it next weekend. |
For testing purposes, I created a custom component for DMX512. It uses the internal UART and generates the break signal by detaching and attaching the pin from/to the pin matrix. It is limited to the ESP32 using the Arduino framework (it should also work using IDF, but this is untested. Requires a change in the config validation if you would like to try it). Code, README and example: https://github.com/andyboeh/esphome-dmx512 For now, I didn't want to change anything on the ESPHome code, thus the TX Pin needs to be configured twice and you need to figure out which hardware UART is used (it defaults to 1, which is usually the case if serial logging is enabled). I only did limited testing using a Lite-Puter DMX dimmer pack, I can't say anything about the stability. |
@andyboeh this looks really awesome. I will find some time to play around with it! I built a DMX library for ESP32 that runs on ESP-IDF and Arduino. Some of the feedback I received included interest in porting it to ESPHome. The issue for me is that I am completely new to the ESPHome environment and I'm still wrapping my head around how to get a custom component running. My library doesn't depend on any existing UART code - I wrote a completely new UART driver for it that runs on the ESP32 hardware. So my library doesn't depend on any existing UART driver. Any chance that could be helpful here? It doesn't run on ESP8266, but maybe it would allow for DMX input/output on an ESPHome release branch? |
@someweisguy I'm not too familiar with ESPHome either, so what I'm doing might be wrong as well. However, my assumption is that every component that uses a hardware UART needs to go through ESPHome's UART implementation. Otherwise, the UART assignment is going to be messed up in case the user configures an additional UART. That said, the main problem with using the ESPHome UART component is that it doesn't have support for sending the break signal. That's the reason for the awkward double-configuration of the TX pin in my implementation. Your library supports a lot more than what I wanted to achieve - my goal is to be able to dim the living room lights :) |
Also interested in DMX output support! |
For the record, this is what I'm hoping to be able to use:
This makes for a very compact and simple setup that could be easily powered/embedded into a dmx fixture. The downside is I don't have any flexibility on the circuit. (no transistor) |
I tried your external component against a chain of "4PCS DJ PAR Can 36 LED RGB Bühnenlicht DMX512 Disco Show Bühnenbeleuchtung DHL" (totally white label par lights) over about 25m and it works flawlessly, provided one terminates the DMX line. |
@andyboeh |
I have some kind of "throttling" functionality in the pipeline where it sends full frames only twice a second and not as fast as possible - I just haven't had the chance to test it (I'll push it afterwards). That would probably solve the problem as the Further, if I understood the protocol correctly, for new values it would be sufficient to only send the bytes up to the changed channel. That should improve the situation as well. |
no, no - it should be as fast as possible - You could try add some transition to light - higher fps is better. |
Maybe I wasn't clear enough about that: Changed values, i.e. transitions, are of course sent as fast as possible! But refreshing old / already set values can be slower. |
@jakosek I just pushed the promised update:
|
@andyboeh |
If it helps you, that's what is running well on my end: https://github.com/klaernie/esphome-configs/blob/main/dmx01.yaml |
What exactly do you mean, a schematic diagram? Or the configuration file? An example configuration file is provided in the github repository. |
I’d love a schematic if you got one |
Please find attached the very simple schematic for the RS485 adapter that I'm using. A bit more background info: I use a WT32-ETH01 board that is plugged into a base board. On the base board is a 12-pin header where the RS485 adapter board is plugged into. The adapter board provides a RJ45 socket with the DMX signal. On the PCB, I also added a simple 3-pin screw terminal as an alternative. |
I'm pretty sure it's my electric skills that are failing me now :( I do appreciate your work with this module! Me failing is obviously a problem from my end. |
Seems like channel calculation based on address is not supported but can be worked around with manual calculation. You jut have to keep in mind when you set up your light fixtures that the next free address number on the bus can be the address of the previous light + the last channel number of that light. This way you can daisy chain them with XLR cables and use one single ESP to control them all. So for example the ADJ VBar Pak can be used in various modes, if you set them up to 8-channel mode (to access all the effects) you can set the address of the first one 1, the next one to 9, the third one to 17, fourth one to 25, using the buttons on each fixture. Then in the config you'd have channels for the first one from 1 to 8, the second one from 9 to 16, third one from 17 to 24, forth one from 25 to 32. |
According to @nagyrobi my DMX component also works on the ESP8266. I pushed support for it to to the main branch and I'd be happy to hear your feedback! |
@nagyrobi fyi: The 120 Ohm resistor is already on the board (R7), at least according to the schematic (https://protosupplies.com/product/max485-ttl-to-rs-485-interface-module/). And there are pull-ups on RE and DE, so no need to connect anything unless you want to be able to disable the output. |
Maybe also interesting to know for some people, there is also a 3v3 version of the max485 called max3485, so that one would be better for esp, also if you want to use the esp as slave for example then over time you won’t blow out the esp pins with 5V. |
Yes, very true! I use the SP3485 which is the equivalent of Sipex. |
I use the MAX485-M at 3.3V only and it works (on another modbus device too). |
Hm indeed. My previous experience a few weeks ago showed though that MODBUS communication CRC errors happen if I don't add the 120 Ohm resistor myself in parrallel with the connector. |
It's specified at 5V, so there is no guarantee that it works on 3.3V. Use the 3485 to be on the safe side.
Yeah, the exact value depends on your cables and your environment. |
@andyboeh this works so well. It's worth making this component as part of ESPHome @jesserockz |
@nagyrobi if you have it running you should PR that component into ESPHome. I have no objections (unless the code is not up to scratch) |
@nagyrobi @jesserockz I consider my DMX implementation a hack. The user has to configure the TX GPIO a second time and needs to know which UART number is in use. To implement that properly, changes to the Arduino libraries are necessary (see #1494). |
It's a nice workaround and does nothing illegal IMHO. |
@jesserockz I am considering creating a PR myself. Do you think it's worth creating one even though the UART number and TX pin have to be configured twice? @nagyrobi I removed the picture of the module you are using from my Github as it contains some sort of watermark which led me to believe that there might be copyright issues with using that image. Do you have one where you're sure about the rights? |
I'll make one |
Hi guys I have an entire house with lighting based on DMX512, and I know my way around Arduino, C++ and Python. I'm also a programmer of many years experience. I'm fairly new to Home Assistant (just moved over from LinuxMCE), but I'm keen to help get this Esphome solution working, if I can. It seems to have stalled, because @andyboeh doesn't want to support what he considers a hack - fair enough. What can I do? |
@Ajwardxxx Please read my comment just 3 posts above yours: I wanted feedback whether it would make sense to create a PR myself, but @jesserockz didn't find the time to reply. The component itself is working fine and all issues from March until now could be fixed by a proper configuration. |
jesserockz, as one of the main devs from ESPHome is way too overwhelmed. He won't answer to such direct pings from anyone. The proper way to get stuff to his table is to prepare a normal PR (eventually marked as draft) + docs (there are many of us who can help with that). Development related questions can be asked on Discord where several dev contributors can offer support. When done with all of this, and tests run etc., PR can be marked for review and Jesse will put it on his todo list. Which, often is about several months long, but it's worth the patience. The community, (including me) stated clearly that yes, this component definitely deserves to be part of ESPHome, and we are all appreciating you took the time to make it. I'm also actively using it. Please come to Discord support chat and create a new thread with any direct questions you may have and you will get competent answers if uncertain about anything. Submit your work as a PR and we'll all do our best together to make it into a release. |
Ok. Sorry I missed the obvious! Really I was just dipping in to see if it's
feasible. Looks like it is, so I'll get stuff set up and see what I can do.
…On Mon, 5 Dec 2022, 21:01 andyboeh, ***@***.***> wrote:
@Ajwardxxx <https://github.com/Ajwardxxx> Please read my comment just 3
posts above yours: I wanted feedback whether it would make sense to create
a PR myself, but @jesserockz <https://github.com/jesserockz> didn't find
the time to reply. The component itself is working fine and all issues from
March until now could be fixed by a proper configuration.
—
Reply to this email directly, view it on GitHub
<#319 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANYZTHQLTET4O55CDG47AMLWLZJZXANCNFSM4H7PPQ6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
any progress on this project?? I have a fairly straightforward DMX setup (lights, lasers & dimmers) and want to go wireless. this seems like it would fit the bill perfectly. |
Works perfectly as external component:
|
Hi Jeff,
I'm afraid not - pressure of work. I have scheduled some time this coming
week, though.
...as mentioned, it can be used as an external component. The work I'm
planning is to generate compliant documentation so it can be formally
reviewed and accepted.
…On Sat, 4 Feb 2023, 18:17 Jeff, ***@***.***> wrote:
any progress on this project?? I have a fairly straightforward DMX setup
(lights, lasers & dimmers) and want to go wireless. this seems like it
would fit the bill perfectly.
—
Reply to this email directly, view it on GitHub
<#319 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANYZTHRH37E3YEVVWXLMRL3WV2MNFANCNFSM4H7PPQ6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@andyboeh this is not a hack anymore, starting with 2023.12 ESPHome officially supports sharing GPIO pins between components. uart:
id: uart_bus
baud_rate: 250000
tx_pin:
number: GPIO2 #ESP8266, Wemos D1 Mini D4
allow_other_uses: true
stop_bits: 2
dmx512:
id: dmx
uart_id: uart_bus
tx_pin:
number: GPIO2 #ESP8266, Wemos D1 Mini D4
allow_other_uses: true
uart_num: 1 Submitted PR to your external component repo. |
Thanks for the PR. Nevertheless, I won't submit - I don't have the resources to maintain it. Feel free to take over. |
Describe the problem you have/What new integration you would like
I have some max485 that I use to create dmx device for my light dmx is cool because its a bus system and require only 1 esp to control it I would really like an integration into esphome
Please describe your use case for this integration and alternatives you've tried:
Add a dmx platform for controlling for example fan speed or light intesity/color
may be a config could look like this :
(D for dimmer) And I didn't try to use anything else for dimming the fan since I don't really like messing with high voltage
Additional context
The text was updated successfully, but these errors were encountered: