<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Wireless MCUのトピックcannot read uart from SFM10 using python</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/cannot-read-uart-from-SFM10-using-python/m-p/1655796#M14997</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read data from the SFM10, using the simple hello world example,&lt;/P&gt;&lt;P&gt;It works in powershell but not using python&lt;/P&gt;&lt;P&gt;The following code works for an arduino&lt;/P&gt;&lt;P&gt;import serial&lt;/P&gt;&lt;P&gt;# Set a 5 second timeout&lt;BR /&gt;port = serial.Serial('COM6', 115200, bytesize=8, parity='N', stopbits=1, timeout=5)&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;line = port.readline().decode('utf-8')&lt;BR /&gt;print(line)&lt;BR /&gt;except serial.SerialTimeoutException:&lt;BR /&gt;print("No data received within timeout period")&lt;BR /&gt;finally:&lt;BR /&gt;port.close()&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 13:55:30 GMT</pubDate>
    <dc:creator>Magnus73</dc:creator>
    <dc:date>2023-05-23T13:55:30Z</dc:date>
    <item>
      <title>cannot read uart from SFM10 using python</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/cannot-read-uart-from-SFM10-using-python/m-p/1655796#M14997</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read data from the SFM10, using the simple hello world example,&lt;/P&gt;&lt;P&gt;It works in powershell but not using python&lt;/P&gt;&lt;P&gt;The following code works for an arduino&lt;/P&gt;&lt;P&gt;import serial&lt;/P&gt;&lt;P&gt;# Set a 5 second timeout&lt;BR /&gt;port = serial.Serial('COM6', 115200, bytesize=8, parity='N', stopbits=1, timeout=5)&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;line = port.readline().decode('utf-8')&lt;BR /&gt;print(line)&lt;BR /&gt;except serial.SerialTimeoutException:&lt;BR /&gt;print("No data received within timeout period")&lt;BR /&gt;finally:&lt;BR /&gt;port.close()&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 13:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/cannot-read-uart-from-SFM10-using-python/m-p/1655796#M14997</guid>
      <dc:creator>Magnus73</dc:creator>
      <dc:date>2023-05-23T13:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: cannot read uart from SFM10 using python</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/cannot-read-uart-from-SFM10-using-python/m-p/1659259#M15018</link>
      <description>&lt;P&gt;Hi again, today I got a really good help from synchronicIT, see condensed solution below&lt;/P&gt;&lt;P&gt;import time&lt;BR /&gt;import serial&lt;/P&gt;&lt;P&gt;running = 0&lt;/P&gt;&lt;P&gt;ser = serial.serial_for_url('COM6', do_not_open=True)&lt;BR /&gt;ser.baudrate = 115200&lt;BR /&gt;ser.bytesize = 8&lt;BR /&gt;ser.parity = 'N'&lt;BR /&gt;ser.stopbits = 1&lt;BR /&gt;ser.rtscts = False&lt;BR /&gt;ser.xonxoff = False&lt;BR /&gt;&lt;BR /&gt;ser.open()&lt;/P&gt;&lt;P&gt;# START&lt;/P&gt;&lt;P&gt;ser.rts = False&lt;BR /&gt;ser.dtr = True&lt;/P&gt;&lt;P&gt;time.sleep(0.02)&lt;/P&gt;&lt;P&gt;ser.rts = True&lt;BR /&gt;ser.dtr = False&lt;/P&gt;&lt;P&gt;time.sleep(0.01)&lt;BR /&gt;test=ser.readline()&lt;BR /&gt;time.sleep(0.02)&lt;BR /&gt;ser.write(b'the text\n')&lt;/P&gt;&lt;P&gt;test2=ser.readline()&lt;/P&gt;&lt;P&gt;print(test2)&lt;/P&gt;&lt;P&gt;ser.close()&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 17:06:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/cannot-read-uart-from-SFM10-using-python/m-p/1659259#M15018</guid>
      <dc:creator>Magnus73</dc:creator>
      <dc:date>2023-05-29T17:06:13Z</dc:date>
    </item>
  </channel>
</rss>

