Closed ola-importer closed 10 years ago
From si...@nomis52.net on January 28, 2012 07:42:57
Try attaching the dummy port to the same universe and run with -l 3. You should see log lines printed at the values change.
From markus.d...@gmail.com on January 28, 2012 07:53:18
attached dummy (in addition to my usb interface), and it shows up:
ola_set_dmx -u 1 -d 0,0,0,0,0
Universe.cpp:558: Added source client, 0x81bd50 to universe 1 DummyPort.cpp:49: Dummy port: got 5 bytes: 0x0 0x0 0x0 0x0 0x0 Universe.cpp:589: Client 0x81bd50 has been removed from uni 1
ola_set_dmx -u 1 -d 0,0,1,0,2,0,3,0,4,0,5,0
Universe.cpp:558: Added source client, 0x8053d8 to universe 1 DummyPort.cpp:49: Dummy port: got 12 bytes: 0x0 0x0 0x1 0x0 0x2 Universe.cpp:589: Client 0x8053d8 has been removed from uni 1
I tried to disable my lit up rgb light with this, but it stays up. Nothing changes.
From si...@nomis52.net on January 28, 2012 08:05:01
It looks like a problem with the Eurolite plugin or device itself. I don't have the hardware so I'm can't debug much more. You may want to add some logging around line 197 of plugin/usbdmx/EuroliteProOutputPort.cpp and see what it's doing.
From markus.d...@gmail.com on January 28, 2012 08:54:59
I did some debugging and got this:
That's all for now, I'll go on testing tomorrow.
From si...@nomis52.net on January 28, 2012 10:02:13
Yes, those are both expected. The web UI sends a full frame, where as set_dmx just sends the slots you pass to it.
The output for the Eurolite device runs in a separate thread, so once you send some data it'll continue sending in the background.
From markus.d...@gmail.com on January 29, 2012 12:45:03
okey, I got it working. but first a question about these lines of code:
// header usb_data[0] = 0x7E; // Start message delimiter usb_data[1] = DMX_LABEL; // Label usb_data[4] = DMX512_START_CODE; buffer.Get(usb_data + 5, &frame_size); usb_data[2] = (frame_size + 1) & 0xff; // Data length LSB. usb_data[3] = ((frame_size + 1) >> 8); // Data length MSB usb_data[frame_size + 4] = 0xE7; // End message delimiter
isn't there a off by one error in the last line? since usb_data[0 to 4] are written before, shouldn't it be 'usb_data[frame_size + 5] = 0xE7;' or else the last dmx value is discarded? The same would apply below at 'libusb_bulk_transfer', where that length would be 'frame_size + 5 + 1', or else we never send out 518 bytes (frame_size + 4 + 1 is max 517).
But nevertheless, i was right with my guess the controller wants a full frame. This works:
// header usb_data[0] = 0x7E; // Start message delimiter usb_data[1] = DMX_LABEL; // Label usb_data[4] = DMX512_START_CODE; buffer.Get(usb_data + 5, &frame_size); unsigned int start = 5 + frame_size; while( start < 517 ) { usb_data[start++] = 0; } usb_data[2] = (512 + 1) & 0xff; // Data length LSB. usb_data[3] = ((512 + 1) >> 8); // Data length MSB usb_data[517] = 0xE7; // End message delimiter
int transferred = 0; int ret = libusb_bulk_transfer( m_usb_handle, ENDPOINT, usb_data, 518, // frame + header + footer &transferred, URB_TIMEOUT_MS);
What this does is to set all unset dmx-values to 0. So a full frame is sent out.
A (small) drawback of course: you have to remember the last full frame, even if you only want to change the first value. e.g. if you have set channel 1-3 to some value, and you'd only want to change channel 1, you'd have to set the values for 2-3 again (--> so you'd need to remember them).
But the other way around - to change only channel 3, but not 1-2 - is not possible with the current implementation, too, afaik. So now you simply always have to send the full frame.
What do you say?
From si...@nomis52.net on January 31, 2012 22:35:00
Yes, there is a bug there. I've pushed a change, please let me know how that goes.
From si...@nomis52.net on January 31, 2012 22:35:26
Summary: Eurolite Output Port doesn't work.
From markus.d...@gmail.com on February 04, 2012 02:10:51
yeah, it works! memset is definitely better than a loop ;-)
issue can be marked as resolved.
From markus.d...@gmail.com on February 04, 2012 08:12:19
looks like I was wrong, it doesn't work. I just reinstalled everything to start clean, and it didn't work anymore. I must have been using my binary without knowing ...
Here's a diff that makes it work for me again (the only change your patch didn't implement but my version did):
diff --git a/plugins/usbdmx/EuroliteProOutputPort.cpp b/plugins/usbdmx/EuroliteProOutputPort.cpp index 8354eac..a299740 100644 --- a/plugins/usbdmx/EuroliteProOutputPort.cpp +++ b/plugins/usbdmx/EuroliteProOutputPort.cpp @@ -203,8 +203,8 @@ bool EuroliteProOutputPort::SendDMX(const DmxBuffer &buffer) { usb_data[1] = DMX_LABEL; // Label usb_data[4] = DMX512_START_CODE; buffer.Get(usb_data + 5, &frame_size);
From si...@nomis52.net on February 04, 2012 09:20:11
Submitted. Please let me know if that works.
From markus.d...@gmail.com on February 16, 2012 11:49:07
ftr: tested it, works
From markus.d...@gmail.com on January 28, 2012 06:07:49
I successfully can control my controller with the OLA admin web console (channel 1-3 for rgb). I have a Eurolite USB Pro DMX adapter.
But I cannot set a value with ola_set_dmx, whatever I try:
ola_set_dmx -u 1 -d 1,255,2,255,3,255 ola_set_dmx -u 1 -d 255,255,255 ola_set_dmx -u 1 -d 0,255,255,255 ola_set_dmx -u 1 -d 1,255,255,255 ola_set_dmx -u 1 -d 255,255,255,1,2,3 ola_set_dmx -u 1 -d 1,255 ...
It simply does nothing. (I don't know what the right syntax for the dmx values is, btw, as the example is not 100% clear. Maybe thats the fault)
Olad prints this for each command:
Universe.cpp:558: Added source client, 0x99af10 to universe 1 Universe.cpp:589: Client 0x99af10 has been removed from uni 1
Using ola 0.8.17.
Is this a bug?
Original issue: http://code.google.com/p/open-lighting/issues/detail?id=165