Page 1 of 1

issues regarding UART on TTGO-T-Call

Posted: Sun Feb 09, 2020 1:55 pm
by minusplusminus
Hi,

I've successfully compiled and put the firmware on this board https://github.com/Xinyuan-LilyGO/TTGO-T-Call. But i've had some issues related to UART. When I connect an GPS module (gy-neo6mv2) , the OS hangs. But when I put the power off, OS goes further again. When I put it back in I see GPS data appearing in REPL. So I have the idea that the TX and RX are REPL pins to console. How do I disable this and allocate the pins to GPS?

Re: issues regarding UART on TTGO-T-Call

Posted: Sun Feb 09, 2020 2:21 pm
by Roberthh
Indeed, UART0 is used for REPL. And the pins which are labelled TX and RX are typically links to UART0 at the default GPIO pins 1 an 3. But you can instead use UART1 or UART2 on almost any pin pair.
Like:

Code: Select all

from machine import UART
uart = UART(1, 9600, rx=4, tx=5)
Thus code snippet will create the uart instance, with RX at pin 4 and TX at pin 5. Do NOT use the default pin settings for UART1 and UART2. That will crash your device and is an open issue.

Re: issues regarding UART on TTGO-T-Call

Posted: Sun Feb 09, 2020 9:11 pm
by minusplusminus
Okay, that's handy. Will do that then. Thanks!

Re: issues regarding UART on TTGO-T-Call

Posted: Tue Jan 05, 2021 2:09 pm
by ciror00
Hi!

I have a similar problem. I was able to perfectly compile the firmware https://github.com/Xinyuan-LilyGO/LilyG ... ython_LoBo in TTGO T CALL . I directly connected the NEO-M6 module (on pins 15 and 12) and started the UART2

Code: Select all

uart = machine.UART(2, rx=12, tx=15, baudrate=9600, bits=8, parity=None, stop=1, timeout=1500, buffer_size=1024, lineend='\r\n')
When I use the comment to read, the module always answers me empty

Code: Select all

>>>uart.readline()
b''
>>>uart.any()
0
Somebody could help me?

Re: issues regarding UART on TTGO-T-Call

Posted: Tue Jan 05, 2021 3:00 pm
by Roberthh
uart.read() does not block. It returns immediately with the data being present, or None if no data is available.
Ar you sure that data has been sent? An easy test is to connect tx and rx, write data first and then read it back.