Sending custom mavlink message from raspberry pi to pixhawk using pymavlink



i am trying to send a custom mavlink message from my companion raspberry pi to my pixhawk. In order to set this up on the pixhawk I followed the guide on the website (

This is the custom mavlink message I want to send to the pixhawk from the pi:

After following the guide the code compiles. If I understand the guide correctly I can now send the custom message from my pi to the pixhawk and it will receive it and publish it to the new uORB topic.
So I only have to send the message over mavlink. Here is the problem i think since I don’t really know how to send custom messages with pymavlink. Right now I am using this code:

# open connection to pixhawk
mavs = mavutil.mavlink_connection("/dev/ttyS0", baud=921600)

# wait for the heartbeat message to find the system id

# send auv data
        mavs.mav.command_long_send(mavs.target_system, mavs.target_component,

The codes executes fine so the message is being send I think but it does not seem to reach the pixhawk. I wrote a simple app to publish the uORB topic on the pixhawk and nothing seems to arrive there.
Can someone help me with this? Is the problem that the mav.command_long_send() function can not be used for this? Do i need to extend the pymavlink library by my own function and if so how do I do this?

Thanks for your help