c3dd Running OLA with an USB FTDI device : RX buffer problem ? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

Peripheral Hardware Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2012, 00:16
RenZO RenZO is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
Default 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-lighti...xTriWidget.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
Reply With Quote
The Following User Says Thank You to RenZO For This Useful Post:
tingo (August 5th, 2012)
  #2  
Old August 3rd, 2012, 03:56
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,851
Thanks: 445
Thanked 1,829 Times in 1,495 Posts
Default

Does it make any difference to use /dev/cuaU0? I admit to not being clear on the difference, but have only used cuaU0.
Reply With Quote
  #3  
Old August 3rd, 2012, 10:06
RenZO RenZO is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
Default

With /dev/cuaU0, it's exactly the same behavior.
Reply With Quote
  #4  
Old August 5th, 2012, 01:17
RenZO RenZO is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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-lighti...12df81e8a9bdc7

Now we can enjoy OLA with FreeBSD !
RenZO
Reply With Quote
The Following User Says Thank You to RenZO For This Useful Post:
tingo (August 5th, 2012)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: FTDI bitbang mode on FreeBSD draco003 Howtos & FAQs (Moderated) 5 July 13th, 2012 20:31
Running FreeBSD from a flash device jem General 1 January 30th, 2012 20:03
USB Serial port FTDI works very slow, FreeBSD 8.2 Radiolab Peripheral Hardware 0 May 8th, 2011 11:49
FTDI FT232R device driver mlhuang FreeBSD Development 0 January 14th, 2010 16:48
PROBLEM samba Error = No buffer eazysnatch Web & Network Services 1 September 18th, 2009 11:25


All times are GMT +1. The time now is 08:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0