Skip to content

Update connection strings #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ from mavsdk import System
...

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")
```

Note: `System()` takes two named parameters: `mavsdk_server_address` and `port`. When left empty, they default to `None` and `50051`, respectively, and `mavsdk_server -p 50051` is run by `await drone.connect()`. If `mavsdk_server_address` is set (e.g. to "localhost"), then `await drone.connect()` will not start the embedded `mavsdk_server` and will try to connect to a server running at this address. This is useful for platforms where `mavsdk_server` does not come embedded, for debugging purposes, and for running `mavsdk_server` in a place different than where the MAVSDK-Python script is run.
Expand Down
2 changes: 1 addition & 1 deletion examples/all_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
async def run():
# Connect to the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# Get the list of parameters
all_params = await drone.param.get_all_params()
Expand Down
2 changes: 1 addition & 1 deletion examples/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
async def run():

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("-- Starting gyroscope calibration")
async for progress_data in drone.calibration.calibrate_gyro():
Expand Down
2 changes: 1 addition & 1 deletion examples/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/camera_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

asyncio.ensure_future(observe_current_settings(drone))
asyncio.ensure_future(observe_camera_mode(drone))
Expand Down
2 changes: 1 addition & 1 deletion examples/do_orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/failure_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/firmware_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/follow_me_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/geofence.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def run():

# Connect to the Simulation
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# Wait for the drone to connect
print("Waiting for drone to connect...")
Expand Down
2 changes: 1 addition & 1 deletion examples/gimbal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def fetch_gimbals():
async def run():
# Init the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

gimbals = await get_gimbals(drone)

Expand Down
2 changes: 1 addition & 1 deletion examples/goto.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/highres_imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
async def get_imu_data():
# Connect to the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# Wait for the drone to connect
print("Waiting for drone to connect...")
Expand Down
2 changes: 1 addition & 1 deletion examples/logfile_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/manual_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def manual_controls():
"""Main function to connect to the drone and input manual controls"""
# Connect to the Simulation
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# This waits till a mavlink based drone is connected
print("Waiting for drone to connect...")
Expand Down
2 changes: 1 addition & 1 deletion examples/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/mission_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/mission_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def px4_connect_drone():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_attitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def run():
""" Does Offboard control using attitude commands. """

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_from_csv/offboard_from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def run():

# Connect to the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# Wait for the drone to connect
print("Waiting for drone to connect...")
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_position_ned.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def run():
""" Does Offboard control using position NED coordinates. """

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_position_velocity_ned.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_velocity_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def run():
""" Does Offboard control using velocity body coordinates. """

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/offboard_velocity_ned.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def run():
""" Does Offboard control using velocity NED coordinates. """

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/px4_ev_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def print_mode(drone):

async def main():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/px4_ev_automation_keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def set_params(system, params, announcement):

async def main():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/send_status_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
async def run():

drone = System(sysid=1)
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

asyncio.ensure_future(observe_shell(drone))

Expand Down
2 changes: 1 addition & 1 deletion examples/takeoff_and_land.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
async def run():

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

status_text_task = asyncio.ensure_future(print_status_text(drone))

Expand Down
2 changes: 1 addition & 1 deletion examples/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
async def run():
# Init the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

# Start the tasks
asyncio.ensure_future(print_battery(drone))
Expand Down
2 changes: 1 addition & 1 deletion examples/telemetry_flight_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def print_flight_mode():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/telemetry_is_armed_is_in_air.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

asyncio.ensure_future(print_is_armed(drone))
asyncio.ensure_future(print_is_in_air(drone))
Expand Down
2 changes: 1 addition & 1 deletion examples/telemetry_status_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def print_status_text():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/telemetry_takeoff_and_land.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def run():

# Init the drone
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
async def run():

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
2 changes: 1 addition & 1 deletion examples/upload_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"connection",
help="Connection string (e.g. udp://:14540)")
help="Connection string (e.g. udpin://0.0.0.0:14540)")
parser.add_argument(
"param_file", help="Param file to be uploaded with .params format")

Expand Down
2 changes: 1 addition & 1 deletion examples/winch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
Expand Down
10 changes: 5 additions & 5 deletions mavsdk/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The package contains ``mavsdk_server`` already (previously called "backend"), wh
from mavsdk import System
...
drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")


Note: ``System()`` takes two named parameters: ``mavsdk_server_address`` and ``port``. When left empty, they default to ``None`` and ``50051``, respectively, and ``mavsdk_server -p 50051`` is run by ``await drone.connect()``. If ``mavsdk_server_address`` is set (e.g. to "localhost"), then ``await drone.connect()`` will not start the embedded ``mavsdk_server`` and will try to connect to a server running at this address. This is useful for platforms where ``mavsdk_server`` does not come embedded, for debugging purposes, and for running ``mavsdk_server`` in a place different than where the MAVSDK-Python script is run.
Expand Down Expand Up @@ -76,7 +76,7 @@ For this case, let's assume the example was like this:
.. code:: python

drone = System()
await drone.connect(system_address="udp://:14540")
await drone.connect(system_address="udpin://0.0.0.0:14540")


The mavsdk_server binary is installed using ``pip``. If installed with ``python -m pip install --upgrade mavsdk`` it is usually (at least for Linux) to be found in ``~/.local/lib/python3.10/site-packages/mavsdk/bin/`` (of course depending on the Python version used).
Expand All @@ -85,21 +85,21 @@ It can then be run in a separate console with the ``system_address`` as an argum

.. code:: bash

~/.local/lib/python3.10/site-packages/mavsdk/bin/mavsdk_server udp://:14540
~/.local/lib/python3.10/site-packages/mavsdk/bin/mavsdk_server udpin://0.0.0.0:14540

Without an autopilot connecting, the output will look something like:

.. code:: bash

[02:36:31|Info ] MAVSDK version: v1.4.16 (mavsdk_impl.cpp:28)
[02:36:31|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
[02:36:31|Info ] Waiting to discover system on udpin://0.0.0.0:14540... (connection_initiator.h:20)

Once an autopilot is discovered, something like this should be printed:

.. code:: bash

[02:38:12|Info ] MAVSDK version: v1.4.16 (mavsdk_impl.cpp:28)
[02:38:12|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
[02:38:12|Info ] Waiting to discover system on udpin://0.0.0.0:14540... (connection_initiator.h:20)
[02:39:01|Info ] New system on: 127.0.0.1:14580 (with sysid: 1) (udp_connection.cpp:194)
[02:39:01|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:484)
[02:39:01|Debug] Component Autopilot (1) added. (system_impl.cpp:355)
Expand Down
Loading