Problem with two instances of PySerial

Shine Jose shinejose22 at gmail.com
Thu Jul 9 09:40:18 EDT 2009


Hello friends,I am developing an application to read data from serial port
and display it on the screen using GUI developed in pyQT. For this I have
instantiated the GUI as well as pySerial objects in the main thread. I have
provided a button 'Read' which when clicked by the user reads from the
serial port using read() method of pySerial. However, for debugging purposes
I also want to poll the serial port continuously for arrival of data and
display on screen. I achieve this by creating a separate worker thread to
poll the serial port for arrival of data and then updating the required
widget in main thread of program. For polling the serial port, I create a
separate instance of pySerial object. However, I am unable to read any data
in the worker thread. Can the reason for this be 2 instances of pySerial
objects being connected to serial port. The reason I had this doubt was
because Serial.Connect() in the worker thread did not throw any exception &
isOpen() method returns true.
I request you to help me in figuring out the problem.

-- 
Regards,
Shine Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090709/fd28dc16/attachment.html>


More information about the Python-list mailing list