[Twisted-Python] UDP + TCP + Serial

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Fri Apr 20 14:28:22 EDT 2007

I'm looking for a way to combine serial input with UDP (and possibly 
TCP) communication.

Currently I have a very simple quick-and-dirty script using pyserial and 
the socket module without Twisted that reads line-based data from a 
serial port and sends it out using UDP. It works very well, but 
functional and reliability requirements are growing and I'm looking for 
a better design. New functionality that we'll need is connection to a 
database, two-way network communication to control the program while 
it's running, and perhaps the ability to use encrypted connections for 
the output data.

Twisted seems nice, but apart from a few simple hello-world-style test I 
don't have any experience with it. It doesn't seem too difficult though, 
except for one thing: I can't find any concrete information on how to 
combine serial communication and network communication. What reactor do 
I need? How do I initialize it? How can I make it listen to both a 
serial port and one or more UDP and/or TCP ports? I need to do this on 
Linux, but it would be nice to have it working on Windows too.

Many thanks,

If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven

More information about the Twisted-Python mailing list