[PyQt] PyQt5 QtSerialPort Error "QSocketNotifier: Invalid socket specified"

Phil Thompson phil at riverbankcomputing.com
Mon Sep 12 17:13:07 BST 2016


On 12 Sep 2016, at 5:10 pm, Dan Arbogast <arbogastdan at gmail.com> wrote:
> 
> Thanks for the response Phil, I tried substituting open() in place of setOpenMode() and now the output is:
> 
> ttyUSB0
> ttyUSB1
> False
> QSocketNotifier: Can only be used with threads started with QThread
> True
> 0
> QSocketNotifier: Can only be used with threads started with QThread
> 0
> 
> So now both the open() and writeData() lines show a new QSocketNotifier error.
> 
> There are several examples out there for how to use QtSerialPort with C++ but nothing I could find for Python.  Do you know of any?  I shouldn't be this hard.

It should be easy enough to port a C++ example to Python. If the two versions behave differently then that would suggest a PyQt bug.

Phil


More information about the PyQt mailing list