UART eats my 15th char!
Posted: Sat Oct 05, 2019 5:59 pm
Hi! I'm New here, so hello to everybody!
I'm trying to read data from GPS module (GY-GPSV3-NEO). As you probably know it communicates via UART.
So first I tied to simulate any UART communication and catch some words.
I found and modified this code:
and every time I send a string longer than 15 character it "eats" the 15th character. I don't know how exactly describe it.
hm..
I send "01234567890123456789"
And as answer I get the string without second five, so it is: "012346789012346789"
I've tried with
with buf declaration, or
and always the same.
Where do I fail? Where is the problem?
I'm trying to read data from GPS module (GY-GPSV3-NEO). As you probably know it communicates via UART.
So first I tied to simulate any UART communication and catch some words.
I found and modified this code:
Code: Select all
uos.dupterm(None, 1)
uart = UART(0, 115200)
ch = b""
while ch != b"quit":
if uart.any():
ch = uart.read()
uart.write(ch)
uos.dupterm(UART(0, 115200), 1)
hm..
I send "01234567890123456789"
And as answer I get the string without second five, so it is: "012346789012346789"
I've tried with
Code: Select all
uart.readinto(buf)
Code: Select all
ch = uart.readline()
Where do I fail? Where is the problem?