<div dir="ltr"><div><div>Thanks for the response Phil, I tried substituting open() in place of setOpenMode() and now the output is:<br><br>ttyUSB0<br>ttyUSB1<br>False<br>QSocketNotifier: Can only be used with threads started with QThread<br>True<br>0<br>QSocketNotifier: Can only be used with threads started with QThread<br>0<br><br></div>So now both the open() and writeData() lines show a new QSocketNotifier error.<br><br>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.<br><br></div>Dan<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 10, 2016 at 10:45 AM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 6 Sep 2016, at 4:49 pm, Dan Arbogast <<a href="mailto:arbogastdan@gmail.com">arbogastdan@gmail.com</a>> wrote:<br>
><br>
> I'm trying to use QtSerialPort for a PyQt5 project but haven't found the magic. Right now the code seems to be opening the port fine but I'm getting "QSocketNotifier: Invalid socket specified" error whenever I try to write to the open port. The code is attached.<br>
><br>
> Running Ubuntu 16.04, PyQt5, Qt 5.6.0<br>
><br>
> The output from this code on my machine is:<br>
><br>
> ttyUSB0<br>
> ttyUSB1<br>
> False<br>
> True<br>
> QSocketNotifier: Invalid socket specified<br>
><br>
> Any idea what is causing the QSocketNotifier error, or how to troubleshoot it? If you run this on your machine do you get the same error?<br>
><br>
> Thanks for any help you might share.<br>
<br>
</span>Try calling open() rather than setOpenMode().<br>
<span class="HOEnZb"><font color="#888888"><br>
Phil</font></span></blockquote></div><br></div>