Skip to content

Quick Start

Installation

The SDK requires Python 3.10 or higher. We recommend using uv to manage your Python versions and virtual environments. uv is an extremely fast Python package installer and resolver that simplifies project setup.

The instructions below show the necessary steps to get started with the SDK on a fresh install using uv.

Windows

Install uv

Open PowerShell and run the following command to install uv:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Changing the execution policy allows running a script from the internet. You may need to restart your terminal for the changes to take effect.

Create a virtual environment

Using a virtual environment is highly recommended to isolate project dependencies.

# Create a new project folder and navigate into it
mkdir drone_project
cd .\drone_project

# Create a virtual environment using Python 3.13 (uv will download it if needed)
uv venv -p 3.13
This will create a .venv folder in your project directory.

Activate the virtual environment:

.\.venv\Scripts\activate

Install the SDK

Now we're ready to install the SDK into our active virtual environment:

uv pip install blueye.sdk

Or, to include the dependencies required for running the examples:

uv pip install "blueye.sdk[examples]"
macOS and Linux

Install uv

Open your terminal and run the following command to install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh
After installation, follow the instructions on the screen to add uv to your shell's PATH, or simply restart your terminal.

Create a virtual environment

Using a virtual environment is highly recommended to isolate project dependencies.

# Create a new project folder and navigate into it
mkdir drone_project
cd drone_project

# Create a virtual environment using Python 3.13 (uv will download it if needed)
uv venv -p 3.13
This will create a .venv folder in your project directory.

Activate the virtual environment:

source .venv/bin/activate

Install the SDK

Now we're ready to install the SDK into our active virtual environment:

uv pip install blueye.sdk

Or, to include the dependencies required for running the examples:

uv pip install "blueye.sdk[examples]"

Connect to the drone

To use the SDK, your computer must be connected to the drone via the surface unit WiFi. For instructions on how to turn on the drone and surface unit, you can watch the quick start video.

Control the drone

Most of the functionality is controlled using getter and setter methods. We will illustrate their use by showing how to control the lights:

import time
from blueye.sdk import Drone

# When the Drone object is instantiated, a connection to the drone is established
myDrone = Drone()

# Setting the lights to 0.1 (10 %)
myDrone.set_lights(0.1)

time.sleep(2)

# We can also get the current brightness of the lights with the get_lights method
print(f"Current light intensity: {myDrone.get_lights()}")
myDrone.set_lights(0)

# Getter methods are also used for reading telemetry data from the drone
print(f"Current depth in meters: {myDrone.get_depth()}")
For an overview of the methods that are available for controlling and reading data from the drone, go to the Drone reference. Most functions are grouped under attributes of the Drone object, such as camera, motion, logs and telemetry; the reference lists them with links to their own pages, which give the valid input ranges.

When a script is done it should call disconnect. The drone keeps the last motion input it received until a new one arrives or its watchdog times out, so disconnect zeroes the thrusters before it tells the drone that the client is leaving. A with block does that for you, also when the script fails or is stopped with Ctrl-C, and a script that ends without either is disconnected when the interpreter exits:

from blueye.sdk import Drone

with Drone() as myDrone:
    myDrone.motion.set_surge(0.3)
    ...
# Thrusters zeroed and disconnected here

Tip

You can explore the methods of the drone interactively using an interactive Python interpreter like iPython, which can be installed with:

uv pip install ipython
By instantiating a Drone object and using the completion key (normally the tab-key ↹), you can get an interactive list of the available methods on the drone, making it easy to try setting and getting the different values. IPython: use Tab completion to discover motion methods and enable auto heading

Watching the video stream

The easiest way to open the RTSP video stream is by using VLC media player. Once VLC is downloaded, you can start the stream like this. The RTSP URL is: rtsp://192.168.1.101:8554/test. See Live video streams for the other streams and for OpenCV. VLC: open the drone's RTSP network stream

For lower latency streaming (on a PC), you can see the instructions on using Gstreamer, or if you just want to watch a low-latency stream, you can download the Blueye Observer app. (iOS / Android)

For video-only viewing alongside a controlling SDK script, use VLC or the Blueye Observer app. The normal Blueye app initially connects as an observer, but starting a dive requires control; if the SDK holds it, the app refuses to start the dive. For telemetry or log scripts alongside a pilot using the app, connect with Drone(connect_as_observer=True) so the script neither takes nor inherits control. See Connecting to the drone for connection options and control handover.

Try the command line interface

The SDK also installs a blueye command for common tasks straight from the terminal — for example, grabbing the newest dive log from the drone:

blueye logs download --latest 1 --dives-only

The drone is always writing a log while it is powered on, so --latest skips that open log and --dives-only leaves out the short logs from powering the drone on at the desk.

Run blueye --help to see everything it can do, or read more on the blueye CLI page.

Explore the examples

For how to move the drone, its axes, force levels and auto modes, see Control from a Python script.

Download the examples for this documentation version. The archive includes shared helpers and is also available in the SDK's installed, offline docs.

Remember to install the example dependencies before running the examples.

uv pip install "blueye.sdk[examples]"

Local documentation

Since the drone surface unit (usually) does not have internet access it can be a bit tricky to reference this documentation while developing on the drone. Luckily when you install the SDK from PyPI it includes a pre-built, local copy of this documentation. This documentation can be viewed by executing the following Python snippet:

import blueye.sdk

blueye.sdk.open_local_documentation()