Issue Related to wait heartbeat

Hello Guys, I don’t know if this is the right place to ask but I am facing problem the heartbeat after connecting to usb0 port.

The connection goes as following: Pixhawk 6X (Telem 1) → TTL2USB → My PC via usb port (detected on /dev/ttyUSB0)

The code is the basic example given on the website which is:
from pymavlink import mavutil

Start a connection listening on a UDP port

#the_connection = mavutil.mavlink_connection(‘/dev/ttyUSB0’, baudrate=921600)
the_connection = mavutil.mavlink_connection(‘/dev/ttyUSB0’)

Wait for the first heartbeat

This sets the system and component ID of remote system for the link

the_connection.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_ONBOARD_CONTROLLER, mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0)
print(“Heartbeat Sent”)
the_connection.wait_heartbeat()
print(“Heartbeat from system (system %u component %u)” % (the_connection.target_system, the_connection.target_component))

Once connected, use ‘the_connection’ to get and send messages

I have tried changing the baudrate also not giving any baudrate as well. What could be the issue and how can I solve it. Do I need to write some additional lines? What could they be?