Quickstart
Python Agent

Python Agent Quickstart

Get telemetry flowing from any Linux device — Raspberry Pi, edge compute, test rigs — to your Plexus dashboard.

Prerequisites

Step 1: Install the Agent

pip install plexus-agent

To include optional hardware support, install with extras:

pip install plexus-agent[sensors]    # I2C sensors (IMU, environmental)
pip install plexus-agent[can]        # CAN bus with DBC decoding
pip install plexus-agent[camera]     # USB cameras (OpenCV)
pip install plexus-agent[all]        # Everything

Step 2: Get Your API Key

  1. Go to app.plexus.company (opens in a new tab)
  2. Navigate to DevicesAdd Device
  3. Copy the API key (starts with plx_)

Step 3: Start Streaming

Run a single command to pair, detect hardware, and begin sending data:

plexus start --key plx_xxxxx

The agent scans for connected sensors, cameras, and interfaces. You see an interactive prompt like this:

Found 3 sensors on I2C bus 1:

  [1] BME280       temperature, humidity, pressure
  [2] MPU6050      accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z
  [3] INA219       bus_voltage, shunt_voltage, current_ma, power_mw

Stream all? [Y/n] or enter numbers to select (e.g., 1,3):

Select which sensors to stream, and the agent handles the rest.

Step 4: Alternative — Direct Python

If you want programmatic control instead of the managed agent, use the Plexus client directly:

from plexus import Plexus
 
px = Plexus(api_key="plx_xxxxx", source_id="test-rig-01")
 
# Send numeric telemetry
px.send("temperature", 72.5)
px.send("engine.rpm", 3450, tags={"unit": "A"})
 
# Send state and structured data
px.send("vehicle.state", "RUNNING")
px.send("motor.enabled", True)
px.send("position", {"x": 1.5, "y": 2.3, "z": 0.8})
 
# Batch send multiple points at once
px.send_batch([
    ("temperature", 72.5),
    ("pressure", 1013.25),
    ("vibration.rms", 0.42),
])

This sends data over HTTP to the Plexus API for storage, without going through the WebSocket relay.

Step 5: See Your Data

Open app.plexus.company (opens in a new tab). Your device appears on the Devices page, and metrics populate the dashboard in real time.

Next Steps

  • Sending Data — Learn about sessions, tags, and batch uploads
  • CLI Reference — Full list of plexus commands and flags
  • Adapters — Connect CAN bus, MQTT, MAVLink, serial, and more