-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
support dmx512 esp8266 #215
Comments
No it currently does not. |
do you have any plan to add? |
What platform do you use? Currently I do not have plans, but I doubt I would support it for platforms other than esp if I did at first. |
sorry. i don't understand what is your mean of platform . i want build a led WiFi controller(esp8266 12f) with support multiple led chip (ws2812-SK6812 ,ws2821 (DMX512)).i use your library and it doesn't support for DMX 512 protocol . |
Platforms or architecture refers to the CPU type. Many arduinos are Atmel AVR, but you mentioneded esp8266, which is another. If I was gifted some of these ws2821 I would add support for esp. |
I was alos thinking about this option, even considered hacking into your code, but the structure of the library is a little beyond me. Reason is actually that i have not found a reliable DMX output for ESP8266 in combination with wifi, and i know your DMA output is reliable. DMX does require some additional hardware (The MAX485), and the format is a little different from the normal one, being that it does use 1 start & 2 stop bits, but it is normal Serial 8N2 (inverted polarity for the MAX485 but that does not affect the software side of things) at 250kbps for the rest of it, with a minimum reset-break of 88us (most libraries use more though, starting at about 100us) So not the strange HIGH - LOW timing that is common for ledstrips. I am willing to gift you some ledstrip and be involved in the enhancement, if only i can find a place where they still sell it. It seems like a simple enhancement, where all that is really needed is to convert 8 bytes into 11 bytes, which include the start & stop bits, and setting the transmission speed & break length. |
https://en.wikipedia.org/wiki/DMX512 I can't even find an official spec on the WS2821. World Semi website doesn't even reference them at all. I found these on alibaba. |
Good find ! I did find a datasheet, though, i know they basically receive DMX and there is some kind of addressing function, though in the fixtures i have seen, the address is simply cascading. They are not cheap, but i guess for testing you'd only need a few. I ran into fixtures which contained these LEDs which were built several years ago, but where the limitation has now become apparent. They are slow, and there is a limit in addresses on the chain. In the end DMX is a lighting standard system, and that is what i would use it for. (other than obviously fixing setups that were built with DMX LED-strip) There is reliable transmission available for AVR's but on an ESP i have not managed. Actually a UART method is the most obvious of course, no complications, but the libraries that i have found for it have incomplete frames in combination with WiFi traffic and connection. DMA mode also should be easy enough, but within your code, i am pretty sure i'll mess it up. Anyway if you want some DMX-Led-dots.. Let me know. |
@devarishi7 Just send me a donation (see top of the wiki) and I will order some for testing. |
Done, i think it should do the trick. Keep me updated on the progress. |
So howz the progress ? |
I could not get the i2s method (DMA) to function correctly yet, I was going to look at just using the Uart to do the work (there are uart methods for WS2812 already). The order for actual LEDs is a complete unknown. It just states in transit and can take months or just days. |
Ah well let's hope they arrive quickly. I thought the DMA would be fairly straightforward, somehow creating a way to add the start and stop bits and set the speed. When i was looking at it, i got a little stuck on setting the speed, with all templates and all, it is not a programming style that i am familiar with. The adding the start and stop bits would appear similar to creating the neopixel bytes i guess. I have never tried you UART mode to be honest. i am willing to do some testing on it. At DMX speed. |
Mmm, DMX512 is not the same as the WS2821. The differences are minor but interesting. I guess my question is, DMX512 or WS2821? |
hehe.. Eh well i was not aware of a couple of things here. I know about the startcode. The LED strips i've found actually respond to DMX512 without issue, but it is possible that these are not WS2821's or that WS2821's do discard the startcode (i think it's that !) In any case, these DMX LED-strip are meant to be connected to a DMX512 system without extra interface, that is what made them popular for a while. No extra controllers. #define BAUDDMX 250000UL volatile uint16_t dmxaddress = 1; volatile uint8_t dmxnewvalue = 0; void setup() { void loop() { void ReceiveDMX() { void Processing() { // main processing void CopyValues() { void SendDMX() { void uart_write(char data) { void uart_write_buffer() { void init_uart() { void SetupTimerRegisters() { // Sets up Timer2 to fire every 4us ISR(TIMER2_COMPA_vect) { ISR(USART_RX_vect) { |
The LSB (reverse order of the bits) is something the UART does automatically, but not the i2s hardware that is used for the ESP8266 DMA methods. |
Ok, well the LED strip 'claims' to be fully DMX512 compatible (at least the ones that are the target) If WS2821's don't have that, they would not claim that, but regardless of that, easiest would i guess be to just add the possibility for either way, like you do with the speed for WS2812's and even that for the inverted logic level and even the startcode. Anyway, DMX512 is very commonly used, the strips are rare. |
Here is my current work on using the i2s (DMA). While it does send a data stream, and the general timing is correct, the output stream doesn't match the data in the i2s buffer. The break and first slot are malformed even when the bits in the buffer are correct. The refactored i2s (DMA) for WS2812x still works fine and these share that core code, so I am really confused as to why it doesn't work. |
Test Sketch
|
Hmm that is a bit disturbing. I assume that you tested it by simply replacing the method within the same sketch (i mean that it still works for WS2812) |
Ah perfect ! I am going to set up for testing over the weekend. |
added WS2821 (3x faster, same protocol) and merged into master |
v2.7.0 |
Sorry about the late response, but i ran into some issue testing, which is probably related to me using an older core for the esp (2.4.2) which is the least bloated (for flash, i am actually quite tight on flash use of the ESP-01's i am using) and functioning core, but that core throws me a lot of warnings and errors in combination with your latest version. Also just as a small note, |
Ok i can see you are reading what i write. Now i got the thing upload properly, though i had to decrease my FS size to keep OTA working, but that is of later concern. Then i somehow had the wires on the XLR inverted, but once that was fixed, i kept having the inconsistent behaviour, basically it appeared as if either the address was shifting which would mean that maybe the break was not recognized correctly. I started out making sure i would send at least a full frame (increasing the number of pixels to 171, which didn't help, then i went into the SRC, to increase the breaktime, but to no avail, then i tried to increase ByteSendTimeUs , bu that didn't matter, and then doing the math i saw. |
Was this for DM512 or ws2821? |
This was for DMX512. I also changed the ByteSendTimeUs to 44us (11 * 4uS) |
with regards to the WS2821SpeedBase i actually recommend setting
whoich results in a bit length of 1.35us resulting in 740740bps which is a lot closer to the 750Kbps that the datasheets suggests. |
So about the 'other question' i had, the documentation wasn't quite clear about it. But testing has confirmed that the UART0 swapped RX pin can be used without issues as long as |
@devarishi7 You are asking questions like this is a discussion area, it is not, issues are for tracking bugs. Further, with topics that are not what the issue is about. Please use the appropriate forum, like the discussion area or gitter channel. #78 and https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods. But maybe a complete FAQ on the topic is needed. |
I checked the SRC, and my correction from August 2nd has not been implemented. |
This comment was missed. Checking the DMX512 E1.11 timing update, the pulse needs to be within a very narrow range. |
Yes and i tested it with 4.0us (250Kbps) and that works perfectly, and the current 4.2us setting doesn't really. For now i have been giving the correction when i refer to it for new users. I don't have a way of testing the WS2821SpeedBase unfortunately. |
I also found a bug that caused the WS2821 to output incorrect signal. I will put a new release with these fixes within the week as I may have introduced other bugs with other changes 8-/ |
Continue to find more bugs where break was incorrectly sized for WS2821 due to improper assumptions of speed and bit size. This does affect the DMX512 just a little and would appreciate a confirmation with these changes. It should allow a slightly less wait between shows. |
Oh eh, well i'm on holidays at the moment for 6 weeks, and i didn't bring all required devices, but as long as the break for DMX512 is at least 88us all is good and any length up to 140us i have never had any issues (conceptinetics.h uses 136us and that's fine) |
v.2.7.3 |
Now i am also using ESP32, and i was wondering if / hoping that you plan to add / adapt the current working method for the ESP8266 into the ESP32 I2S & I2Sx methods ? I think i might be able to manage myself but i can not do better than you i am sure. |
Make a formal request in a new conversation or issue and reference this one. |
dose it support dmx512 for ic like ws2821 and other ic like that?
The text was updated successfully, but these errors were encountered: