<?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>topic Re: Accessing the virtual serial port in Tablets</title>
    <link>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603428#M34891</link>
    <description>&lt;P&gt;&lt;A href="https://forum.developer.samsung.com" target="_blank"&gt;https://forum.developer.samsung.com&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2023 12:25:19 GMT</pubDate>
    <dc:creator>bill-e</dc:creator>
    <dc:date>2023-07-21T12:25:19Z</dc:date>
    <item>
      <title>Accessing the virtual serial port</title>
      <link>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603283#M34889</link>
      <description>&lt;DIV class="votecell post-layout--left"&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200"&gt;&lt;DIV class="js-vote-count flex--item d-flex fd-column ai-center fc-theme-body-font fw-bold fs-subheading py4"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="postcell post-layout--right"&gt;&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I am trying to interface a Samsung Galaxy tab A8 Android tablet with an embedded device. I can make the connection with a OTG style USB-C cable and can communicate with the embedded device using the "Serial USB Terminal" app that I downloaded from the Play Store. But I need to connect with a Python app that I installed on the tablet. I know the "Serial USB Terminal" app uses the virtual serial port to communicate with the embedded device. But in order to get my Python application to connect I need to know the name of the virtual serial port. I have used the same Python code to communicate with the embedded device using my PC, but on the PC the port is called "COM6". My Linux system calls it "/dev/ttysUSB1". I need to know what the tablet calls that communication port.&lt;/P&gt;&lt;P&gt;Here is the Python code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; serial

&lt;SPAN class="hljs-comment"&gt;# Open the serial port&lt;/SPAN&gt;
ser = serial.Serial(&lt;SPAN class="hljs-string"&gt;'COM6'&lt;/SPAN&gt;, &lt;SPAN class="hljs-number"&gt;9600&lt;/SPAN&gt;, timeout=&lt;SPAN class="hljs-number"&gt;1&lt;/SPAN&gt;)

&lt;SPAN class="hljs-keyword"&gt;while&lt;/SPAN&gt; &lt;SPAN class="hljs-literal"&gt;True&lt;/SPAN&gt;:
    &lt;SPAN class="hljs-comment"&gt;# Get user input&lt;/SPAN&gt;
    user_input = &lt;SPAN class="hljs-built_in"&gt;input&lt;/SPAN&gt;(&lt;SPAN class="hljs-string"&gt;"Enter a string (or 'quit' to exit): "&lt;/SPAN&gt;)

    &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; user_input == &lt;SPAN class="hljs-string"&gt;'quit'&lt;/SPAN&gt;:
        &lt;SPAN class="hljs-keyword"&gt;break&lt;/SPAN&gt;

    &lt;SPAN class="hljs-comment"&gt;# Send the user input to the serial port&lt;/SPAN&gt;
    ser.write(user_input.encode())

    &lt;SPAN class="hljs-comment"&gt;# Read the response from the serial port&lt;/SPAN&gt;
    response = ser.readline().decode().strip()

    &lt;SPAN class="hljs-comment"&gt;# Display the response&lt;/SPAN&gt;
    &lt;SPAN class="hljs-built_in"&gt;print&lt;/SPAN&gt;(&lt;SPAN class="hljs-string"&gt;"Response:"&lt;/SPAN&gt;, response)

&lt;SPAN class="hljs-comment"&gt;# Close the serial port&lt;/SPAN&gt;
ser.close()&lt;/PRE&gt;&lt;P&gt;The only missing piece (since the code works flawlessly on my Windows PC version of python3) is that in the third line of code, the name, "COM6", is an unresolved reference. I have tried every variation I can think of for this port name, but it would be nice if it were documented somewhere.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Jul 2023 04:30:27 GMT</pubDate>
      <guid>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603283#M34889</guid>
      <dc:creator>Fklein23</dc:creator>
      <dc:date>2023-07-21T04:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the virtual serial port</title>
      <link>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603397#M34890</link>
      <description>&lt;P&gt;&lt;a href="https://us.community.samsung.com/t5/user/viewprofilepage/user-id/29126516"&gt;@Fklein23&lt;/a&gt;&amp;nbsp;I think you would need to find and post in a developers discussion area. This discussion area is for users of Samsung devices and services. The odds of getting the help here that you are seeking, is going to be low.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 11:16:19 GMT</pubDate>
      <guid>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603397#M34890</guid>
      <dc:creator>LongHiker</dc:creator>
      <dc:date>2023-07-21T11:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the virtual serial port</title>
      <link>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603428#M34891</link>
      <description>&lt;P&gt;&lt;A href="https://forum.developer.samsung.com" target="_blank"&gt;https://forum.developer.samsung.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 12:25:19 GMT</pubDate>
      <guid>https://us.community.samsung.com/t5/Tablets/Accessing-the-virtual-serial-port/m-p/2603428#M34891</guid>
      <dc:creator>bill-e</dc:creator>
      <dc:date>2023-07-21T12:25:19Z</dc:date>
    </item>
  </channel>
</rss>

