Running OLA with an USB FTDI device : RX buffer problem ?

Hello,

First, I need to explain what is OLA : Open Lighting Architecture.
OLA is a framework for lighting purposes, so it provides a way to use DMX and RDM protocols (used in theaters and many shows).
Transport could be over IP or USB devices. More infos and code on the website:
http://www.opendmx.net/index.php/OLA

I already use OLA under Linux systems, and I decided to try it on FreeBSD 9.0-RELEASE.
OLA build was made easily, thanks to some ajustments by Simon (OLA's author).
All seems to be working, but I encounter a problem with USB devices.
I have two different devices : Enttec USB Pro and Jese TRI. Both are based on FTDI chipset, and used through:
/dev/ttyU0

The detection is like:
Code:
ugen0.2: <ENTTEC> at usbus0
uftdi0: <DMX USB PRO> on usbus0

When using the Enttec device, OLA can send data without problem (TX only), but will stop quickly when using RDM (TX + RX).
When using the TRI device, OLA can only send 15 frames (TX with Return Code) before stop, and will stop when using RDM (TX + RX) too.

So I tried to change the port speed:
Code:
# stty -f /dev/ttyU0.init speed 115200

Then, I restart OLA and the TRI can now send 170 frames (the returned code for each frame is about 2 bytes), and RDM exchanges can go further than before, but it finally stops. So, it seems to be a buffer problem, but only in RX transmission (because TX works with Enttec, without returned code).

Maybe you'll want to read some OLA code (about the TRI plugin):
http://code.google.com/p/open-lighting/source/browse/plugins/usbpro/DmxTriWidget.cpp

Anyway, if I restart OLA, I can use it again until the next stop ; so it doesn't seem to be a system problem.
Here are the settings when olad is running:

Code:
localhost# stty -f /dev/ttyU0
speed 115200 baud;
lflags: -icanon -isig -iexten -echo
iflags: -icrnl -ixon -ixany -imaxbel -brkint
oflags: -opost -onlcr tab0
cflags: -cread cs5 -parenb -hupcl
discard dsusp   eof     eol     eol2    erase   erase2  intr    kill    
^@      ^@      ^@      ^@      ^@      ^@      ^@      ^@      ^@      
lnext   min     quit    reprint start   status  stop    susp    werase  
^@      0       ^@      ^@      ^@      ^@      ^@      ^@      ^@

Is there a setting which allows a "duplex usage" of this kind of port?
I've tried these options without success:
Code:
stty -f /dev/ttyU0.init ixoff ignbrk igncr

I'm ready to try anything :)

Thanks
RenZO
 
Does it make any difference to use /dev/cuaU0? I admit to not being clear on the difference, but have only used cuaU0.
 
Finally, Simon found the solution. It's because of the cflag CREAD.
And I didn't figure out that the minus(-) in '-cread' means it's disabled (I was thinking of -argument) !

So, 'cread' needs to be enabled, because as said in stty manual: Enable the receiver.
Since olad is running, we can enable the flag with:
Code:
# stty -f /dev/ttyU0 cread

Then, we don't see '-cread' in the settings:

Code:
localhost# stty -f /dev/ttyU0
speed 115200 baud;
lflags: -icanon -isig -iexten -echo
iflags: -icrnl -ixon -ixany -imaxbel -brkint
oflags: -opost -onlcr tab0
cflags: cs5 -parenb -hupcl
discard dsusp   eof     eol     eol2    erase   erase2  intr    kill    
^@      ^@      ^@      ^@      ^@      ^@      ^@      ^@      ^@      
lnext   min     quit    reprint start   status  stop    susp    werase  
^@      0       ^@      ^@      ^@      ^@      ^@      ^@      ^@


Now everything works fine, even if using TX or RX.
Simon has made a change in OLA in order to have the flag set automatically:
http://code.google.com/p/open-lighting/source/detail?r=e90253fd2ac5da4a87a3674fe012df81e8a9bdc7

Now we can enjoy OLA with FreeBSD !
RenZO
 
Back
Top