op 22-09-14 18:03, Laurens Van Houtven schreef:
On 22 Sep 2014, at 17:31, Bram Van Steenlandt <b...@diomedia.be> wrote:

No specific reason actually, I didn't even know twisted had support for a 
serial port.

This being said:
ftdio_sio can be a bit buggy at times, esp when using multiple devices on the same 
pc, ftdi on freebsd & osx isn't very stable either.
I use this interface selector system where the serial connection can be setup with 
pyserial,libftdi (which works much better for ftdi adapters) or a tcp socket (which uses 
a so called "device server" with ethernet and rs232 onboard).
Doing it with twisted seems more complicated to me (but I could be wrong), in 
my case it makes a lot of sense to wait for the data, I poll plc's over rs485 
and those kind of things.
Use cases vary :-) In a wait-dosomething-wait scenario, I find @inlineCallbacks 
to typically yield virtually the same code you ended up with.

When I was doing this, there was some pretty complex chatter back and forth, 
and I was multiplexing several connections over a single RS232 device, so 
Twisted certainly came in handy. In your case: don't fix what ain't broken, of 
course :)
Wouldn't it be difficult to combine the twisted method with external libaries like MinimalModbus, libftdi , libartnet etc ?
Or is there some magic that I'm not aware of ?
I there a disadvantage to using a thread ?


Also as I've said, there are sometimes a lot of hardware issues (usb bus resets 
and stuff, users that disconnect usb-ports and plug them back in) which can be 
difficult to deal with.

How long does twisted has this serial port support actually ?
Well over a decade: Mon Dec 16 04:04:25 2002 to be precise. See svn rev 
trunk@4528.

hth
lvh


_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to