<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[serialport considerations for linux]]></title><description><![CDATA[<p dir="auto">Hi,<br />
The serialport stuff i was working on ended up working for windows, but it still fails to function correctly on linux and sends random values, even on another (identical) setup</p>
<p dir="auto">Are there anythings specifically that could cause this to happen?</p>
]]></description><link>https://forum.qt.io/topic/142999/serialport-considerations-for-linux</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 20:42:26 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142999.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Feb 2023 11:14:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to serialport considerations for linux on Mon, 20 Feb 2023 09:12:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/agmar">@<bdi>agmar</bdi></a></p>
<ul>
<li>Put the <code>open()</code> as the <em>first</em> thing in <code>openSerial()</code> (actually immediately <em>after</em> the <code>setPortName()</code>).</li>
<li><em>Always</em> check the return result of any <code>open()</code>s.</li>
<li>Remove the <code>open()</code> from <code>writeAll()</code>.</li>
</ul>
]]></description><link>https://forum.qt.io/post/748425</link><guid isPermaLink="true">https://forum.qt.io/post/748425</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 20 Feb 2023 09:12:14 GMT</pubDate></item><item><title><![CDATA[Reply to serialport considerations for linux on Mon, 20 Feb 2023 09:04:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Hi, this is the response i get from the port if i add the suggested code to the oenSeriall function :</p>
<p dir="auto">bool QSerialPort::setRequestToSend(bool): device not open<br />
bool QSerialPort::setDataTerminalReady(bool): device not open</p>
<p dir="auto">however, if i try adding either of these, nothing sends through the serial port...</p>
<pre><code>m_serial-&gt;open(QSerialPort::ReadWrite);
m_serial-&gt;open(QIODevice::ReadWrite);

</code></pre>
]]></description><link>https://forum.qt.io/post/748422</link><guid isPermaLink="true">https://forum.qt.io/post/748422</guid><dc:creator><![CDATA[agmar]]></dc:creator><pubDate>Mon, 20 Feb 2023 09:04:15 GMT</pubDate></item><item><title><![CDATA[Reply to serialport considerations for linux on Fri, 17 Feb 2023 20:52:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">In which direction does the randomness happen ? From your machine to your device ?<br />
Did you already tried setting <a href="https://doc.qt.io/qt-6/qserialport.html#requestToSend-prop" target="_blank" rel="noopener noreferrer nofollow ugc">requestToSend</a> ? Maybe you need <a href="https://doc.qt.io/qt-6/qserialport.html#dataTerminalReady-prop" target="_blank" rel="noopener noreferrer nofollow ugc">dataTerminalReady</a>.</p>
]]></description><link>https://forum.qt.io/post/748197</link><guid isPermaLink="true">https://forum.qt.io/post/748197</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 17 Feb 2023 20:52:52 GMT</pubDate></item><item><title><![CDATA[Reply to serialport considerations for linux on Fri, 17 Feb 2023 06:44:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a></p>
<p dir="auto">well, this is the setup:</p>
<pre><code>private:
    Ui::MainWindow *ui;
    QSerialPort *m_serial;

};

void MainWindow::openSeriall(){
    m_serial-&gt;setPortName(portName);
    m_serial-&gt;setBaudRate(QSerialPort::Baud19200);
    m_serial-&gt;setDataBits(QSerialPort::Data8);
    m_serial-&gt;setParity(QSerialPort::NoParity);
    m_serial-&gt;setFlowControl(QSerialPort::NoFlowControl);
    m_serial-&gt;setStopBits(QSerialPort::OneStop);

}


void MainWindow::writeSerial()
{

    QByteArray message;

        message.append(0xFF);


       if (m_serial-&gt;open(QIODevice::ReadWrite)) {
           m_serial-&gt;write(message);
           m_serial-&gt;waitForBytesWritten(-1);
           m_serial-&gt;close();

}
}

</code></pre>
<p dir="auto">i cant see anything wrong, i took care of the baud rate, data bits...</p>
<p dir="auto">maybe no flow control could be causing this? the transmission is successful on a windows pc , strangely enough...</p>
]]></description><link>https://forum.qt.io/post/748036</link><guid isPermaLink="true">https://forum.qt.io/post/748036</guid><dc:creator><![CDATA[agmar]]></dc:creator><pubDate>Fri, 17 Feb 2023 06:44:44 GMT</pubDate></item><item><title><![CDATA[Reply to serialport considerations for linux on Thu, 16 Feb 2023 12:26:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/agmar">@<bdi>agmar</bdi></a> said in <a href="/post/747930">serialport considerations for linux</a>:</p>
<blockquote>
<p dir="auto">Are there anythings specifically that could cause this to happen?</p>
</blockquote>
<p dir="auto">No.</p>
<p dir="auto">I'm not an expert, but at least make sure the baud rate etc. parameters are correct under Linux?</p>
]]></description><link>https://forum.qt.io/post/747937</link><guid isPermaLink="true">https://forum.qt.io/post/747937</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 16 Feb 2023 12:26:59 GMT</pubDate></item></channel></rss>