<?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[Live Plot data by reading COM port data]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I'm using LoPy with Pysense connected to the Pc via USB.</p>
<p dir="auto">Is there a way to read the accelerometer data sent by the Pysense and plot it with Spyder for example ?<br />
I would like to use matplotlib library and use the data from the COM port to make a live plot.</p>
<p dir="auto">This is the code I use :</p>
<pre><code>import serial
import time
ser=serial.Serial(port='COM4',baudrate=9600)

while True:
    print(&quot;try&quot;)
    time.sleep(10)
    s=ser.read(100) #reading up to 100 bytes
    print(s)

ser.close()
</code></pre>
<p dir="auto">And I get &quot;access denied&quot;. When the Pysense is sending data, I can't read it because the port is already in use.<br />
SerialException: could not open port 'COM4': PermissionError(13, 'Access denied.', None, 5)</p>
<p dir="auto">So I guess while Atom is using the port Spyder can't access to it ? Am I right ?</p>
<p dir="auto">How should I do that ?<br />
Is there an easier way to print data ? I don't have SD card and I don't want to use one.</p>
<p dir="auto">Cheers,<br />
ThomasP</p>
]]></description><link>https://forum.pycom.io/topic/2810/live-plot-data-by-reading-com-port-data</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 20:45:14 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2810.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Mar 2018 14:37:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Live Plot data by reading COM port data on Fri, 09 Mar 2018 14:37:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I'm using LoPy with Pysense connected to the Pc via USB.</p>
<p dir="auto">Is there a way to read the accelerometer data sent by the Pysense and plot it with Spyder for example ?<br />
I would like to use matplotlib library and use the data from the COM port to make a live plot.</p>
<p dir="auto">This is the code I use :</p>
<pre><code>import serial
import time
ser=serial.Serial(port='COM4',baudrate=9600)

while True:
    print(&quot;try&quot;)
    time.sleep(10)
    s=ser.read(100) #reading up to 100 bytes
    print(s)

ser.close()
</code></pre>
<p dir="auto">And I get &quot;access denied&quot;. When the Pysense is sending data, I can't read it because the port is already in use.<br />
SerialException: could not open port 'COM4': PermissionError(13, 'Access denied.', None, 5)</p>
<p dir="auto">So I guess while Atom is using the port Spyder can't access to it ? Am I right ?</p>
<p dir="auto">How should I do that ?<br />
Is there an easier way to print data ? I don't have SD card and I don't want to use one.</p>
<p dir="auto">Cheers,<br />
ThomasP</p>
]]></description><link>https://forum.pycom.io/post/16917</link><guid isPermaLink="true">https://forum.pycom.io/post/16917</guid><dc:creator><![CDATA[ThomasP]]></dc:creator><pubDate>Fri, 09 Mar 2018 14:37:47 GMT</pubDate></item><item><title><![CDATA[Reply to Live Plot data by reading COM port data on Fri, 09 Mar 2018 14:49:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2338">@thomasp</a> said in <a href="/post/16917">Live Plot data by reading COM port data</a>:</p>
<blockquote>
<p dir="auto">So I guess while Atom is using the port Spyder can't access to it ? Am I right ?</p>
</blockquote>
<p dir="auto">Close Atom, when you want to read form the serial port on the PC. You may also use a WiFi connection and sockets.</p>
]]></description><link>https://forum.pycom.io/post/16918</link><guid isPermaLink="true">https://forum.pycom.io/post/16918</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Fri, 09 Mar 2018 14:49:08 GMT</pubDate></item><item><title><![CDATA[Reply to Live Plot data by reading COM port data on Fri, 09 Mar 2018 15:51:10 GMT]]></title><description><![CDATA[<p dir="auto">That was quick.<br />
I just wanted to make sure I was doing it properly.<br />
Works great. Thank you.</p>
]]></description><link>https://forum.pycom.io/post/16919</link><guid isPermaLink="true">https://forum.pycom.io/post/16919</guid><dc:creator><![CDATA[ThomasP]]></dc:creator><pubDate>Fri, 09 Mar 2018 15:51:10 GMT</pubDate></item></channel></rss>