<br><br><div class="gmail_quote">On 9 November 2011 01:57,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 11:59 am, <a href="mailto:dsturmfels@gmail.com">dsturmfels@gmail.com</a> wrote:<br>
&gt;Hi,<br>
&gt;Has anyone had much experience with serial flow control in twisted?<br>
<br>
</div>I don&#39;t. :)  It sounds like this may not really have much to do with<br>
Twisted, though.<br>
<div class="im">&gt;I&#39;ve been using a twisted serial port in my gtk+ software for quite a<br>
&gt;while<br>
&gt;now, and I can get xonxoff flow control to work, but for some reason,<br>
&gt;rtscts flow control isn&#39;t working (or I may be using it wrong).<br>
&gt;<br>
&gt;I&#39;m connecting the software, via a usb-serial cable, to a Datalogic<br>
&gt;barcode<br>
&gt;scanner cradle.<br>
&gt;I&#39;ve been able to replicate this problem with pyserial as well.<br>
<br>
</div>As you perhaps already know, Twisted&#39;s serial port support is<br>
implemented in terms of pyserial - and the layer Twisted adds is very<br>
thin.  So the problem you experience with pyserial is probably exactly<br>
the same as the problem you experience with Twisted, since the latter is<br>
actually the same code as the former.<br>
<div class="im">&gt;<br>
&gt;Without flow control on, I can for example, send a particular serial<br>
&gt;string<br>
&gt;to the cradle, and the cradle replies instantly with it&#39;s software<br>
&gt;version<br>
&gt;(as a string).<br>
&gt;If I scan a barcode, this also instantly shows up in<br>
&gt;twisted/pyserial/etc<br>
&gt;(as a string).<br>
&gt;<br>
&gt;With xonxoff flow control on in both the software and cradle, the<br>
&gt;serial<br>
&gt;connection works exactly the same as having no flow control on.<br>
&gt;<br>
&gt;With rtscts flow control on in both the software and cradle however,<br>
&gt;the<br>
&gt;cradle doesn&#39;t reply instantly with it&#39;s software version when the<br>
&gt;correct<br>
&gt;string is sent.<br>
&gt;However, a scanned barcode shows up instantly in the twisted/pyserial<br>
&gt;software, and if you&#39;ve previously requested the cradle software<br>
&gt;version,<br>
&gt;the software version string only shows up directly after receiving a<br>
&gt;barcode string.<br>
&gt;<br>
&gt;Am I doing something wrong, or does anyone know what might be going on<br>
&gt;here?<br>
<br>
</div>Do you know that the device supports RTS/CTS?  Do you know that the USB<br>
driver for the device supports it?  Do you know that the USB driver<br>
support for it is bug free? :)<br>
<br>
Sorry I can&#39;t add anything more helpful.  I think you want to be looking<br>
for the problem at a pretty low level, though.  Perhaps even at the<br>
level of measuring voltage on the RTS pin...<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br>Thanks - I was assuming it probably was a hardware problem, but I just thought I&#39;d check to see if I&#39;d been doing anything wrong.<br>The hardware definitely supports rts/cts flow control, so I&#39;m guessing the problem then might possibly be with the usb-serial cable, or the driver for it.<br>

<br>Either way, I&#39;ve decided to stick with xon/xoff flow control for now - it seems to work quite well.<br><br>Thanks anyway!<br>