T-Beam serial module not working properly

Hello everyone,
Currently I am reading some sensor data using a Raspberry Pi Pico running MicroPython. I am then trying to transmit that data to a T-beam V1.1 using the serial module.

I am following the instruction mentioned in the link. I have set the Baud rate on the T-beam to 38400. I am also powering the Pico using the 5V pin of the T-Beam. This is the micropython code I am running.

import machine
from machine import UART, Pin
import utime
analog_value = machine.ADC(28)
uart = UART(1, baudrate=38400, tx=Pin(8), rx=Pin(9))
uart.init(bits=8, parity=None, stop=1)
while True:
reading = analog_value.read_u16()
#print("ADC: ",reading)
uart.write(str(reading))
utime.sleep(5)

Yet when I run tio with > tio -e -b 38400 -f none /dev/ttyS2 I just get weird garbage on the terminal as if the baudrate is wrong.

If anyone has any clue why it is acting like that any help would be appreciated.

Edit: After switching the GND pin around, I am getting the correct values on the screen of my receiving mesh. I still get garbage on the serial but at least I am getting some correct stuff on the receivers.

What is the configuration you used for the SerialModule?

When running tio you have the T-Beam connected via USB? By default that will just show the debug logs that uses a baud rate of 115200. The SerialModule works with separate UART pins that you configure, unless you use the Override Console Serial Port option.

If you were using it with UART pins, you have to write MicroPython code to read the received messages over serial via the Pico.

Serial Module config:

baud: BAUD_38400
echo: true
enabled: true
mode: TEXTMSG
rxd: 13
txd: 14

I was using the RXD and TXD pins as set up (I was not using GPIO1 and GPIO3 pins if thats what you mean).

So when I changed the baud rate 115200, I started getting the debug log over the serial monitor. Is there any way to just retrieve the message and display it on the serial monitor?

You could try the setting the Override Console Serial Port option I mentioned before to true, but the idea of the TXTMSG mode is that you send and receive over the RXD and TXD pins using an external microcontroller.

" I am also powering the Pico using the 5V pin of the T-Beam. "
That is NOT a good idea!