MCPcopy Create free account
hub / github.com/ESPARGOS/pyespargos

github.com/ESPARGOS/pyespargos @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
758 symbols 2,100 edges 41 files ⚖ LGPL 227 documented · 30% ● updated 7d ago2026-10-20 · 2026-10-20★ 1,0474 open issues

Browse by type

⨍ Functions 691◇ Types & classes 66↳ Endpoints 1
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ESPARGOS Python Client Library + Demos

Documentation Python ≥ 3.11 License: LGPLv3

pyespargos is the Python library for working with ESPARGOS, a low-cost digital phased array built from Espressif ESP32 chips. An ESPARGOS array contains eight phase-synchronized ESP32 radio front-ends, one per antenna, that are orchestrated by a central controller. The current hardware, ESPARGOS One, is a 4 × 2 array of dual-polarized patch antennas for the 2.4 GHz band and is controlled and powered over Ethernet (PoE) or USB-C. Multiple arrays can be combined into one larger phase-coherent aperture.

With pyespargos, you can use ESPARGOS to

  • measure WiFi channels: ESPARGOS passively extracts channel state information (CSI) from received 802.11g/n/ax packets in real time, phase-coherent across all antennas and arrays. Supported formats are L-LTF, HT-LTF (20 and 40 MHz) and HE-LTF.
  • receive Bluetooth LE: discover advertisers, record packet IQ and estimate arrival direction from the same packet received across several antennas. See BLE reception.
  • capture raw I/Q samples: ESPARGOS can record synchronized complex baseband samples from all antennas, bypassing WiFi decoding (see ESP-SDR). This is useful for non-WiFi signals and radar-like measurements.
  • transmit (requires transmit authorization): send WiFi packets on a schedule, replay stored IQ waveforms, or feed live samples and digital symbols into a beam. See IQ Transmit Streaming.

The library handles device communication, clustering of measurements across sensors and boards, and phase/timing calibration, and provides array-processing utilities such as angle-of-arrival estimation. It also ships with a collection of demo applications, listed below. Full documentation, including runnable examples and the API reference, is available at espargos.net/docs.

ESPARGOS One: Digital Phased Array for 2.4 GHz

Release 0.2.0

This release adds Bluetooth LE packet capture, WiFi IQ reception, continuous IQ receive streaming and IQ transmit streaming. These features are experimental and under development. Their demos are unstable and their APIs will change without notice.

For release 0.2.0, the matching ESPARGOS One versions are 0770317 for the controller and fd96575 for the sensors. You can check the installed versions on the firmware update page in the controller’s web interface.

Installation

pyespargos requires Python 3.11 or newer. Follow the instructions for your operating system below.


Linux / Raspberry Pi

Click to expand Linux instructions

1. Install Python

Most Linux distributions ship with Python pre-installed. Verify by running:

python3 --version

Install Python and the build tools for the native packet decoder using your package manager:

# Debian / Ubuntu / Raspberry Pi OS (Raspbian)
sudo apt update && sudo apt install python3 python3-venv python3-pip python3-dev build-essential

# Fedora
sudo dnf install python3 python3-pip python3-devel gcc

# Arch Linux
sudo pacman -S python python-pip base-devel

2. Clone the repository

git clone --recurse-submodules https://github.com/ESPARGOS/pyespargos.git

3. Create and activate a virtual environment

cd pyespargos
python3 -m venv .venv
source .venv/bin/activate

Note: You need to run source .venv/bin/activate (from the pyespargos directory) every time you open a new terminal before using pyespargos.

4. Install pyespargos

pip install -e .

5. Install demo dependencies (optional)

If you want to run the demo applications:

pip install -e ".[demos]"

The 3D radiation pattern demo also uses Qt Quick 3D and its Assimp asset importer to load the antenna model. The demo README lists the packages for system Qt installations.

Demos such as camera and azimuth-delay use shaders, which are shipped in pre-compiled form (.qsb files) in this repository, so normally no additional steps are required. Only if these demos do not work should you re-compile the shaders yourself using the compile_shader.sh scripts, which requires the Qt Shader Baker (qsb):

# Debian / Ubuntu / Raspberry Pi OS (Raspbian)
sudo apt install qt6-shader-baker

# Fedora
sudo dnf install qt6-qtshadertools

# Arch Linux
sudo pacman -S qt6-shadertools

Note: The compile_shader.sh scripts currently expect qsb at /usr/lib/qt6/bin/qsb. If your distribution installs it elsewhere, update the script accordingly.


Windows

Click to expand Windows instructions

1. Install Python

If you don't have Python installed yet:

  1. Go to python.org/downloads and download the latest Python installer.
  2. Run the installer. Important: Check the box "Add python.exe to PATH" at the bottom of the first installer screen before clicking "Install Now".
  3. After installation, open a new Command Prompt (not PowerShell) window and verify:
python --version

The native packet decoder requires Microsoft C++ Build Tools. In the Visual Studio Installer, select Desktop development with C++.

2. Clone the repository

git clone --recurse-submodules https://github.com/ESPARGOS/pyespargos.git

3. Create and activate a virtual environment

Open a Command Prompt window (not PowerShell):

cd pyespargos
python -m venv .venv
.venv\Scripts\activate

Note: You need to activate the virtual environment every time you open a new terminal before using pyespargos.

4. Install pyespargos

pip install -e .

5. Install demo dependencies (optional)

If you want to run the demo applications:

pip install -e ".[demos]"

The 3D radiation pattern demo also uses Qt Quick 3D and its Assimp asset importer to load the antenna model. The demo README lists the packages for system Qt installations.

Demos such as camera and azimuth-delay use shaders, which are shipped in pre-compiled form (.qsb files) in this repository, so normally no additional steps are required. Only if these demos do not work should you re-compile the shaders yourself using the .bat scripts, which requires Qt 6 so that qsb.exe (Qt Shader Baker) is available. The simplest option is to use the Qt Online Installer and install a desktop Qt 6 kit.

Note: The shader batch scripts currently default to C:\Qt\6.10.2\mingw_64\bin\qsb.exe. If your Qt installation is in a different location, either update the QSB path in the .bat scripts or add the Qt bin directory to PATH.


macOS

Click to expand macOS instructions

1. Install Python

The recommended way to install Python on macOS is via Homebrew:

# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install the command-line compiler tools for the native packet decoder
xcode-select --install

# Install Python
brew install python

Important: After installing Python with Homebrew, close and re-open your terminal so that the Homebrew-installed Python is used instead of the older macOS system Python.

Verify the installation:

python3 --version

Alternative: You can also download the installer from python.org/downloads.

2. Clone the repository

git clone --recurse-submodules https://github.com/ESPARGOS/pyespargos.git

3. Create and activate a virtual environment

cd pyespargos
python3 -m venv .venv
source .venv/bin/activate

Note: You need to run source .venv/bin/activate (from the pyespargos directory) every time you open a new terminal before using pyespargos.

4. Install pyespargos

pip install -e .

5. Install demo dependencies (optional)

If you want to run the demo applications:

pip install -e ".[demos]"

The 3D radiation pattern demo also uses Qt Quick 3D and its Assimp asset importer to load the antenna model. The demo README lists the packages for system Qt installations.

Demos such as camera and azimuth-delay use shaders, which are shipped in pre-compiled form (.qsb files) in this repository, so normally no additional steps are required. Only if these demos do not work should you re-compile the shaders yourself using the compile_shader.sh scripts, which requires the Qt Shader Baker (qsb). One option is:

brew install qt

Then verify that qsb is available:

qsb --version

Note: If qsb is not on your PATH, use the full path from your Qt installation when running compile_shader.sh.

Demo Applications

Camera Overlay Camera Overlay preview MIMO Radar MIMO Radar preview Azimuth-Delay Diagram Azimuth-Delay Diagram preview
MUSIC Spatial Spectrum MUSIC Spatial Spectrum preview Phases by Antenna Phases by Antenna preview Instantaneous Frequency-Domain CSI Instantaneous Frequency-Domain CSI preview
Instantaneous Time-Domain CSI Instantaneous Time-Domain CSI preview Received Phases over Time Received Phases over Time preview Time of Arrival Time of Arrival preview

pyespargos comes with a selection of demo applications for testing ESPARGOS. The demos are organized by radio mode. Each application selects the controller profile and sensor roles it needs at startup.

  • WiFi measures CSI from the modem.
  • WiFi IQ estimates CSI from captured WiFi packet waveforms.
  • Bluetooth uses BLE packet IQ.
  • IQ supports raw sampling, transmission, and mixed TX/RX arrays.

The demos share Qt controls, configuration and pool management in demos/common. See the application framework guide when adding a demo. Use demos/custom for local experiments.

Most demos support both single ESPARGOS arrays and combined multi-board setups via command-line arguments or YAML configuration files.

Running a Demo

After installing pyespargos and the demo dependencies (steps above), you can run a demo. Make sure the virtual environment is activated, then run the following from the pyespargos directory.

For example, to run the Instantaneous CSI demo with an ESPARGOS controller at 192.168.1.2:

Linux / macOS:

./demos/wifi/instantaneous-csi/main.py 192.168.1.2

Windows (Command Prompt):

python demos\wifi\instantaneous-csi\main.py 192.168.1.2

If you have multiple ESPARGOS boards, pass their addresses separated by commas:

python demos/wifi/instantaneous-csi/main.py 192.168.1.2,192.168.1.3

Other demos may ask for different command line arguments. Run any demo with --help to see the available options.

Connecting over USB / UART tunnelling

ESPARGOS can also tunnel its control and CSI traffic over the USB serial connection. This is useful if you do not have Ethernet available, or if you want to configure ESPARGOS network settings through USB before putting it on a network.

There are two ways to use the USB UART connection:

Access the web interface over

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 593
Function 98
Class 66
Route 1

Languages

Python100%

Modules by API surface

espargos/csi.py77 symbols
espargos/cluster.py52 symbols
espargos/board.py50 symbols
demos/common/espargos_application.py48 symbols
espargos/uart.py46 symbols
espargos/pool.py44 symbols
demos/stochastic-fading/stochastic-fading.py32 symbols
espargos/util.py31 symbols
espargos/backlog.py30 symbols
demos/camera/camera.py30 symbols
demos/power-over-time/power-over-time.py28 symbols
demos/radar-schedule-check/radar-schedule-check.py26 symbols

For agents

$ claude mcp add pyespargos \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page