hdavid / dmxP512

DMX output processing library for ENTTEC DMX USB Pro and LanBox LCE.
http://motscousus.com/stuff/2011-01_dmxP512/
32 stars 2 forks source link

Serial library errors #1

Closed mariuswatz closed 11 years ago

mariuswatz commented 11 years ago

Hi Henri, I used your library for another installation but this time I had massive problems with the Processing Serial library dropping connections with the Enttec USB adapter. It ended up being more stable on one laptop than the other I tested, but it would regularly drop connections and fatally crash.

I ended up using a custom hack of Serial and modified dmxP512 to recognize Serial exceptions, so that I could call dmxProSerialPort.dispose() and then re-connect. That proved stable-ish on one computer but failed on another, but I only had one DMX adapter to test so it might have been a faulty box.

Have you seen any behavior along those lines?

hdavid commented 11 years ago

hello

i never experienced such problems in the past and never heard of such problems either. if you have the chance you could definitely try to isolate the problem : on a different laptop, different os, other processing version, blank/demo sketch from dmxP512, with different drivers, or different usb cable, with a different enttec box if you have the possibility.

if you have a working code for (automatically or manually) reconnect, i would be pleased to integrate it in the lib. In return i'll ask you to test it as i don't own a enttec box anymore.

cheers,

henri

mariuswatz commented 11 years ago

I think the error was likely due to hardware or driver trouble. The problem was not being able to isolate the source since I didn't have access to a comparable interface box. The code alterations I did to Serial.java were only to add error reporting, you can see it here:

https://github.com/mariuswatz/teaching/blob/master/misc/Processing%20Serial%20hack/unlekker/serial/SerialHack.java

What I did was check for the "hasError" flag I added to Serial and then use that as a sign to call "dmxOutput.dmxProSerialPort.dispose();". I also changed your code to reconnect when the port was disposed of, as well as remember the DMX state so it wouldn't set 0 values on reset.