Python Agent
Installation

Installation

Install the base agent:

pip install plexus-python

The base package includes the Plexus client, CLI, buffering, and HTTP transport. Add optional extras for hardware-specific capabilities.

Extras

Install extras by appending them in brackets:

pip install plexus-python[sensors]
pip install plexus-python[sensors,can]
pip install plexus-python[all]
ExtraInstallsUse Case
sensorssmbus2I2C sensors (IMU, temperature, pressure, ADC)
canpython-can, cantoolsCAN bus via SocketCAN
mavlinkpymavlinkMAVLink protocol (drones, autopilots)
mqttpaho-mqttMQTT broker integration
modbuspymodbusModbus TCP/RTU (PLCs, industrial sensors)
opcuaasyncuaOPC-UA (industrial automation)
serialpyserialSerial port (RS-232, UART, GPS receivers)
blebleakBluetooth Low Energy relay
tuirichLive terminal dashboard (plexus start --live)
systempsutilSystem health (CPU temp, memory, disk)
allAll of the aboveInstall everything

System Requirements

Base Package

  • Python 3.8 or later
  • Works on Linux (x86_64, ARM64), macOS, and Windows

Platform-Specific Requirements

ExtraOSRequirements
sensorsLinuxI2C enabled (sudo raspi-config on Raspberry Pi)
canLinuxSocketCAN kernel module, can-utils
serialAllUSB-to-serial adapter or UART pins
systemAllNo additional requirements

Raspberry Pi Quick Setup

# Enable I2C
sudo raspi-config nonint do_i2c 0
 
# Install with sensors
pip install plexus-python[sensors]
 
# Verify I2C is working
plexus scan

CAN Bus Setup (Linux)

# Load the SocketCAN kernel module
sudo modprobe can
sudo modprobe can_raw
 
# Bring up the CAN interface
sudo ip link set can0 type can bitrate 500000
sudo ip link set can0 up
 
# Install with CAN support
pip install plexus-python[can]

Environment Variables

Set these before running the agent:

VariableRequiredDescription
PLEXUS_API_KEYYesYour API key (starts with plx_). Get it from app.plexus.company (opens in a new tab) → Settings → Developer.
PLEXUS_GATEWAY_URLNoGateway HTTP ingest URL. Defaults to https://plexus-gateway.fly.dev.
PLEXUS_GATEWAY_WS_URLNoGateway WebSocket URL. Defaults to wss://plexus-gateway.fly.dev.
export PLEXUS_API_KEY=plx_xxxxx

Verify Installation

# Check the installed version
plexus --version
 
# Diagnose any missing dependencies
plexus doctor
 
# Scan for connected hardware
plexus scan

Next Steps

  • Configuration — Configure the agent with a config file or constructor parameters
  • Quickstart — Send your first data point in under a minute