# Sending Mavlink Messages on udp port 14552

**URL:** <https://discuss.cubepilot.org/t/sending-mavlink-messages-on-udp-port-14552/11231>\
**Category:** HereLink\
**Created:** [1 June 2023 23:31 UTC](https://discuss.cubepilot.org/t/sending-mavlink-messages-on-udp-port-14552/11231 "2023-06-01T23:31:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayparikh](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jayparikh](https://discuss.cubepilot.org/u/jayparikh)\
**Post date:** [1 June 2023 23:31 UTC](https://discuss.cubepilot.org/t/sending-mavlink-messages-on-udp-port-14552/11231/1 "2023-06-01T23:31:45Z")

</div>

Hello,

I’m able to read heartbeat messages and other stuff on udp port 14552 but not able to send my custom mavlink message. Trying to set mode to auto using this syntax (Kotlin),

 ![image](https://discuss.cubepilot.org/uploads/default/original/2X/7/7d109b24f244d358c0f1e5ce2b4a5bcc26f1dd32.png)

I made sure udpSocket is the same on which it connected to the port. Not sure where I’m going wrong.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![jayparikh](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jayparikh](https://discuss.cubepilot.org/u/jayparikh)\
**Post date:** [2 June 2023 19:25 UTC](https://discuss.cubepilot.org/t/sending-mavlink-messages-on-udp-port-14552/11231/3 "2023-06-02T19:25:45Z")

</div>

My bad. The byte array was made up of just payload and not the whole mavlink message

---

<div class="post-metadata">

**Author:** ![Ehsan\_Gh](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/ehsan_gh/32/7536_2.png) [@Ehsan\_Gh](https://discuss.cubepilot.org/u/Ehsan_Gh)\
**Post date:** [12 March 2024 18:22 UTC](https://discuss.cubepilot.org/t/sending-mavlink-messages-on-udp-port-14552/11231/5 "2024-03-12T18:22:34Z")

</div>

Hi.

Can I ask the IP address and PORT number that you’ve used to connect to MavLink?

I have a Python code using pymavlink, and it seems like it’s not getting the heartbeats.

```Python
from pymavlink import mavutil
from SKYRON import MAVLink, MAVLink_sensor_status_message
import time, os, threading

"""
Example of how to connect pymavlink to an autopilot via an UDP connection
"""

master = mavutil.mavlink_connection('udp:192.168.144.3:14550', baud=57600)

# Make sure the connection is valid
master.wait_heartbeat()

# Get some information !
while True:
    try:
        print(master.recv_match().to_dict())
    except:
        pass
    time.sleep(0.1)

```

Any help is highly appreciated!
