Installation
pip, system deps, CAN bus setup.
SDK
pip install 'reflex-sdk[webrtc]'| Install | What you get |
|---|---|
pip install reflex-sdk | CLI, target.kind: edge (local HTTP) and target.kind: platform (platform-routed) transports. |
pip install 'reflex-sdk[webrtc]' | Above + target.kind: webrtc (DataChannel to hosted GPU workers). Adds aiortc, av, msgpack, numpy, Pillow. |
Requires Python ≥ 3.9. Tested on 3.10–3.12.
Hardware drivers
The SDK ships connectors for:
| Connector kind | Hardware | Driver dep |
|---|---|---|
subprocess | Anything — script-based connector via stdin/stdout JSON | none |
yam_bimanual | i2rt YAM bimanual arms over SocketCAN | i2rt |
YAM bimanual
i2rt isn't on PyPI; clone + install editable. From a fresh Ubuntu 22.04+ machine:
sudo apt update && sudo apt install -y \
build-essential python3-dev linux-headers-$(uname -r) \
can-utils iproute2 git curl
# uv (Astral) is the recommended Python toolchain.
curl -LsSf https://astral.sh/uv/install.sh | sh
# i2rt — YAM connector + motor drivers.
git clone https://github.com/i2rt-robotics/i2rt.git ~/i2rt
cd ~/i2rt
uv venv --python 3.11 .venv
source .venv/bin/activate
uv pip install -e .
# Reflex SDK into the same venv.
uv pip install 'reflex-sdk[webrtc]'
# CAN bus — one-time per host. Adjust interfaces to match your canable2 setup.
sudo ip link set can0 up type can bitrate 1000000
sudo ip link set can1 up type can bitrate 1000000
# Auto-enable on boot:
cd ~/i2rt && sudo sh devices/install_devices.shVerify:
ip -br -c link show | grep can # can0 UP, can1 UP
which reflex # ~/i2rt/.venv/bin/reflex
reflex whoami # exercises the CLI end-to-endCameras
| Camera kind | Source | Notes |
|---|---|---|
v4l2 (alias: webcam) | /dev/video* USB cameras | cv2.VideoCapture under the hood |
realsense | Intel RealSense via pyrealsense2 | Install RealSense SDK + udev rules separately |
shm | Pre-broadcast frames from /dev/shm/reflex_cam_* | Multi-consumer-safe; useful when several workers read the same camera |
The SHM source is read-only — the broadcaster (not part of the Reflex SDK)
publishes frames. Typical setup is a camera_broadcaster.py you author that
grabs from RealSense / V4L2 and writes raw HxWxC uint8 into a memory-mapped
segment per camera. See the YAM rig setup notes for a reference broadcaster.
macOS
i2rt is Linux-only (evdev is gated on sys_platform == 'linux', and the
CAN-over-USB drivers are different on macOS). The Reflex SDK itself works on
macOS — you can run reflex login, reflex whoami, hit edge workers, drive an
SO-101 via the subprocess connector — but the yam_bimanual connector won't
import.
ARM Linux (Jetson, etc.)
aiortc wheels are x86_64 only. On ARM, pip will try to compile PyAV from
source, which needs ffmpeg dev headers:
sudo apt install -y libavcodec-dev libavformat-dev libavutil-dev \
libswscale-dev libavfilter-dev libavdevice-dev libswresample-dev \
libsrtp2-dev libssl-devConfiguration
reflex resolves URLs in this order:
| Slot | Backend | Platform |
|---|---|---|
--convex-url / --site-url flag | ✓ | ✓ |
REFLEX_CONVEX_URL env | ✓ | — |
REFLEX_PLATFORM_URL env | — | ✓ |
~/.config/reflex/credentials.json (set by reflex login) | ✓ | ✓ |
| Default | https://api.tryreflex.ai | https://app.tryreflex.ai |
A fresh install does not need any env var set. Defaults cover the production deployment; flags / env override for staging / self-hosted.
Troubleshooting
| Symptom | Likely cause |
|---|---|
API key is required | Run reflex login first, or set REFLEX_API_KEY. |
Convex URL must start with http:// or https://. | A --convex-url / REFLEX_CONVEX_URL override isn't a full URL. Use https://.... |
ModuleNotFoundError: No module named 'aiortc' | Install with [webrtc] extra: pip install 'reflex-sdk[webrtc]'. |
RuntimeError: WebRTC signaling timeout on first connect | Worker cold-start exceeded the budget. Bump connect_timeout_s to 180 in your yaml. |
| ICE never completes | UDP egress blocked. Try a different network; check firewall for outbound UDP. |
For non-obvious failures, run with --verbose:
reflex connect --config robot.yaml --verbose