<?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[Issue with UART Communication from UnitV2 to Raspberry Pi]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I’ve been trying to send simple data from the UnitV2 to the Raspberry Pi using UART on the ttyAMA0 port.</p>
<pre><code>import serial
import time

#  M5Stack UnitV2
uart = serial.Serial('/dev/ttyAMA0', 115200) 

while True:
    uart.write(b'Hello from M5stack\n')
    time.sleep(1) 

</code></pre>
<p dir="auto">While the Pi itself can successfully utilize ttyAMA0, the UnitV2 is unable to communicate through this port. Despite updating the firmware as recommended, I still can’t establish communication between the UnitV2 and Pi via UART.</p>
<pre><code>
#pi
import serial
import time

try:
    ser = serial.Serial('/dev/ttyAMA0', 115200, timeout=1)  
    print("Serial port opened successfully")
    ser.write(b'Hello from Raspberry Pi!\n')

    while True:
        if ser.in_waiting &gt; 0: 
            data = ser.read(ser.in_waiting).decode('utf-8').strip()
            print(f'Received: {data}')
        time.sleep(1) 
except serial.SerialException as e:
    print(f'Error: {e}')
finally:
    ser.close()
</code></pre>
<p dir="auto">Any advice on how to resolve this?</p>
<p dir="auto">Thank you for your help.</p>
]]></description><link>https://community.m5stack.com/topic/6788/issue-with-uart-communication-from-unitv2-to-raspberry-pi</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:22:37 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6788.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Sep 2024 07:50:01 GMT</pubDate><ttl>60</ttl></channel></rss>