Pixhawk doesn't respond to mavlink code's

we are gonna use pixhawk for a UUV project and we have a nvidia jetson which will run a path finding algorithm on python and jetson has to communicate pixhawk in order to set certain servo motors to some voltage to move the device.

so i am trying this code just to see it will work.

from pymavlink import mavutil

Connect to the Pixhawk via MAVLink

Replace ‘COM_PORT’ with your Pixhawk’s serial port or connection method

connection = mavutil.mavlink_connection(‘COM8’, baud=115200)

Wait for the heartbeat to confirm connection

connection.wait_heartbeat()
print(“Heartbeat received from system (system %u component %u)” %
(connection.target_system, connection.target_component))

Function to set servo output

def set_servo_output(channel, pwm_value):
“”"
Send MAVLink command to set servo output for a specific channel.
:param channel: Servo channel number (1-16 for main and aux ports)
:param pwm_value: PWM value (1000 to 2000 microseconds, or 0 to disable)
“”"
connection.mav.command_long_send(
connection.target_system, # Target system
connection.target_component, # Target component
mavutil.mavlink.MAV_CMD_DO_SET_SERVO, # Command
0, # Confirmation
channel, # Servo channel (e.g., 2 for MAIN OUT 2)
pwm_value, # PWM value
0, 0, 0, 0, 0 # Unused parameters
)
print(f"Set channel {channel} to PWM {pwm_value}")

Set MAIN OUT port 2 to 5V (1900µs) and others to 0 (1000µs)

set_servo_output(2, 1900) # Channel 2 to 5V
set_servo_output(1, 1000) # Channel 1 to 0V
set_servo_output(3, 1000) # Channel 3 to 0V
set_servo_output(4, 1000) # Channel 4 to 0V

Close the connection

connection.close()

it connects, i receive the heartbeat but literally nothing happens on its output pins.

I have already red the document of pymavlink from ardusub and tried lots of different options but nothing ever happens on my pixhawk’s output pins regardless of the code. Any leads ?