Python Agent
Installation

Installation

Install the base agent:

pip install plexus-agent

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-agent[sensors]
pip install plexus-agent[sensors,can,camera]
pip install plexus-agent[all]
ExtraInstallsUse Case
sensorssmbus2I2C sensors (IMU, temperature, pressure, ADC)
canpython-can, cantoolsCAN bus via SocketCAN
mavlinkpymavlinkMAVLink protocol (drones, autopilots)
mqttpaho-mqttMQTT broker integration
cameraopencv-python, numpyUSB camera capture
picamerapicamera2Raspberry Pi CSI camera (Pi 4/5)
serialpyserialSerial port (RS-232, UART, GPS receivers)
tuirichLive terminal dashboard (plexus run --live)
systempsutilSystem health (CPU temp, memory, disk)
allAll of the above (except picamera)Install 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
picameraRaspberry Pi OSlibcamera libraries, CSI camera connected
cameraLinux / macOSUSB camera at /dev/video0 or equivalent
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-agent[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-agent[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_ENDPOINTNoCustom endpoint URL. Defaults to https://app.plexus.company. Use this for self-hosted deployments.
export PLEXUS_API_KEY=plx_xxxxx
 
# Optional: self-hosted endpoint
export PLEXUS_ENDPOINT=https://plexus.internal.company.com

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