[Twisted-Python] GPRS/Modem protocol through USB support

Laurens Van Houtven _ at lvh.io
Mon Sep 22 10:03:26 MDT 2014


On 22 Sep 2014, at 17:31, Bram Van Steenlandt <bram at 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 :)

> 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 at 4528.

hth
lvh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: </pipermail/twisted-python/attachments/20140922/ff543a4e/attachment.sig>


More information about the Twisted-Python mailing list