issues regarding UART on TTGO-T-Call

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
minusplusminus
Posts: 4
Joined: Sun Feb 09, 2020 1:19 pm

issues regarding UART on TTGO-T-Call

Post by minusplusminus » Sun Feb 09, 2020 1:55 pm

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?

User avatar
Roberthh
Posts: 2441
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: issues regarding UART on TTGO-T-Call

Post by Roberthh » Sun Feb 09, 2020 2:21 pm

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.

minusplusminus
Posts: 4
Joined: Sun Feb 09, 2020 1:19 pm

Re: issues regarding UART on TTGO-T-Call

Post by minusplusminus » Sun Feb 09, 2020 9:11 pm

Okay, that's handy. Will do that then. Thanks!

User avatar
ciror00
Posts: 1
Joined: Sat Feb 15, 2020 4:51 pm
Location: Buenos Aires
Contact:

Re: issues regarding UART on TTGO-T-Call

Post by ciror00 » Tue Jan 05, 2021 2:09 pm

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?

User avatar
Roberthh
Posts: 2441
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: issues regarding UART on TTGO-T-Call

Post by Roberthh » Tue Jan 05, 2021 3:00 pm

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.

Post Reply