Skip to main content

Python protocol definition for the Blueye Pioneer

Project description



This repository contains a python library that defines how to communicate with the Blueye Pioneer. The Blueye Pioneer is an underwater drone made by Blueye Robotics, see for more information.

The protocol itself is defined in two json files, one for UDP and one for TCP. These are stored as a submodule in this repository, and the python code is generated from these definitions.

This package requires Python 3.7 or newer.

The blueye.protocol package's main use is in the blueye.sdk. The SDK implements a layer of convenience on top of the TCP and UDP clients found here in blueye.protocol, to make interacting with the Pioneer easier. If you want to interact with the Pioneer in your own project we recommend using the blueye.sdk package, not blueye.protocol directly.


pip install blueye.protocol


Install poetry

We use Poetry for package management, install it like this

curl -sSL | python

for more instructions see the Poetry repository.

Install the necessary Python version

We require Python v3.7 or newer, and many operating systems package an older version of Python the easiest (for Linux/OS X) is to use pyenv. Pyenv manages multiple Python versions in parallel for you.

The instructions below are for Linux (Ubuntu), but pyenv exist both for macOS and Windows and the instructions should be fairly similar.

Install pyenv, for more instructions see the pyenv-installer

curl -L | bash
pyenv update

Install the needed dependencies for building python 3.7.4

apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl

Then build python with pyenv

pyenv install 3.7.4

Create a virtual environment and install the dependencies

Using a virtual environment is not strictly necessary, but it greatly simplifies the development of Python packages.

Since we already have pyenv installed we'll use it to create a virtual environment,

pyenv virtualenv 3.7.4 blueye_protocol
pyenv activate blueye_protocol

Now we're ready to install the python packages needed, by running poetry in the projects root directory

poetry install

Code generators

Important: This repository includes generated code. If the protocol definitions are changed the generated files need to be updated and committed. The generated protocol files are updated using the generators in the generators folder. They can be run with invoke generate-udp or invoke generate-tcp. The generators are run automatically before testing with.

invoke test


Test for the TCP client are written using pytest. Test for UDP client are written using unittest. All tests are run using pytest. The tests can be run using invoke (to ensure that the protocol files are updated)

invoke test

or directly using pytest (if you don't want to generate the definitions)


Since bitbake doesn't have support for pyproject.toml files yet, we need to include a file to specify the dependencies needed. There's an invoke task for generating the file that can be run with

invoke generate-setup-py

Be sure to run this script and commit the file when the dependencies have changed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for blueye.protocol, version 1.4.0
Filename, size File type Python version Upload date Hashes
Filename, size blueye.protocol-1.4.0-py3-none-any.whl (16.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size blueye.protocol-1.4.0.tar.gz (16.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page