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 lighting code doesn't seem to work #232
Comments
Also tried using ENTEC start code (based on this thread https://bridgesim.net/discussion/399/dmx-usb-interface since my USB to DMX dongle is also a lixada ) as here: https://github.com/daid/EmptyEpsilon/blob/master/src/hardware/devices/enttecDMXProDevice.cpp#L69 - but so far no luck. |
Hmmmm. The existence of this repo is interesting: https://github.com/lowlander/dmx_usb_module It's a USB driver for Linux 2.6 kernel for the Enttec DMX USB dongle.
Hmm. I am sure I'm using the standard usbserial driver. Perhaps this is a problem. |
Hmm, things are not looking too promising. First, there's this (via the homepage of abovementioned dmx_usb_module, here http://www.erwinrol.com/dmx512/ ):
The DMX4LInux site is here: https://llg.cubic.org/dmx4linux/index.html
So perhaps this goes some way to explain why people seem to make all these Arduino + 485 chip gizmos to drive DMX lights. But... maybe the thing I bought is such a gizmo? Or maybe this info is outdated? The thing I bought claims to support linux, so... who knows. edit: well this page does not claim linux support: https://www.lixada.com/p-l0385.html but mine didn't come with a CD and doesn't look exactly like that. Maybe mine is a knock-off of it though? |
Actually, it did. But there's nothing on it for linux. However it does contain a link to this: And on that page it says:
And the word "kernel" links to: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/serial/ which is to say the normal linux usb serial driver. Which it may be the case that the normal linux usb serial driver can't work for DMX according to http://www.erwinrol.com/dmx512/ TN-101 refers to this: https://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_105%20Adding%20Support%20for%20New%20FTDI%20Devices%20to%20Mac%20Driver.pdf which appears to apply to the serial driver for the Macintosh (which has an interesting feature of aliasing baud rates to non-standard values, so to get the non-standard DMX baud rate of 250000, you can alias 300 baud to 250000 (because who the hell uses 300 baud anyway?). However this seems to be something specific to the Mac serial driver.) |
Not to say it ever worked, so this is not new breakage.
I finally got some dmx hardware, specifically, the hardware mentioned here, because it is cheap:
https://artemis.forumchitchat.com/post/easy-plug-play-dmx-28-10051243
(Although not as cheap as the $28 that thread claims.)
In particular, I got a USB to DMX adapter that shows up like this:
I believe it is a RS485 (like RS232 but higher voltage and differential so cables can be longer.)
First thing I notice is that I can't seem to do TCGETS2 or TCSETS2 ioctl to get/set the baud rate on it. I get "inappropriate ioctl for device." Ok, perhaps it is permanently set to the right baud rate, and I'm talking to it via USB, so... whatever, comment that part out.
I tried a few more things (and found and fixed a couple bugs by staring at the code) but this is one of those deals where if it doesn't work, it just sits there and does nothing, giving no hints about what you've done wrong.
The lights I got are "Lightahead LA-18w DMX512 RGB LED PAR Light, Red, Green, Blue".
And of course I got some DMX cables (similar to microphone cables with XLR connectors.)
The lights have a few buttons on the back for switching the modes. The demo modes seem to work, and the slave mode seems to work (one light in demo mode can drive the slave light to make it mimic the demo light.)
When I put them in DMX mode (A001 or D001, say) nothing happens. D001 is "4 channel" dmx mode... the 1st 3 channels are Red Green and Blue. The 4th channel is (and I quote) "Fourth channel: save the setting from the 0-150 or 161-255 to 151-160 when the interval moved to save when". It also mentions a "fifth channel" (presumably only there in the 7 channel dmx mode). Again I quote: "Fifth channel from the 0-150 or 161-255 to 151-160 when the interval moved completely out of the dimming mode."
Ok, well, that certainly could not be clearer. :-/
My code in snis_dmx (in particular snis_dmx_set_rgb() expects 3 channel dmx. Tried hacking it to use 4 bytes per, on the theory that the "4 channel dmx" the lights use means I need 4 bytes per light, not 3.) Tried a few other things I can't remember. All behave the same (nothing happened.)
Oh, I shouldn't say "nothing happened". The USB to DMX converter has a transparent plastic case, and inside is a small blue LED. When transmitting out /dev/ttyUSB0, the LED on the converter board inside the transparent case lights up and flashes. But the DMX controllable par lights do nothing.
I was running my test program:
Had to chown /dev/ttyUSB0 as it is owned by root when it's created.
So it is all very mysterious. So mysterious, I likely will not figure it out without some outside help.
I also tried looking in EmptyEpsilon's code, but no luck so far.
The text was updated successfully, but these errors were encountered: