A modular client-server application for remote control and data acquisition from laboratory equipment (Rigol and BK Precision scopes, power supplies, and loads).
LabLink enables remote control of lab equipment through a Raspberry Pi server, providing an intuitive graphical client for equipment management, data acquisition, and visualization.
- Server: Python-based server running on Raspberry Pi, connected to lab equipment via USB/Serial/Ethernet
- Client: Cross-platform desktop GUI for equipment control, monitoring, and data visualization
- Communication: WebSocket for real-time data streaming, REST API for control commands
-
Modular driver architecture for equipment
-
REST API for equipment control and management
-
Complete WebSocket integration (real-time streaming across all components)
- Client-side WebSocket streaming (Equipment, Acquisition, Alarm, Scheduler panels)
- Server-side event broadcasting (Alarm events, Scheduler job events)
- Equipment and acquisition data streaming
- <100ms latency for real-time events (vs 5-10s polling)
- 80% reduction in server load (event-driven vs polling)
-
Equipment discovery & connection (async VISA scanning with responsive UI)
- Non-blocking async discovery (UI remains responsive during 10-30s scans)
- Multi-interface support (TCPIP, USB, GPIB, Serial)
- Real-time connection dialog with equipment type/model selection
- Automatic device identification and classification
- BK Precision power supply support (1685B, 9130B, 9205B, 9206B, 1902B)
-
Multi-device connection management
-
Equipment readings endpoint (voltage, current, power, status)
-
Configurable data buffering and formats
-
Complete equipment drivers for Rigol and BK Precision devices
-
Comprehensive configuration management (65+ settings)
-
Error handling with auto-reconnect and health monitoring
-
Equipment profile system (save/load configurations)
-
Safety limits and interlocks (voltage/current/power limits, emergency stop)
-
Equipment lock/session management (multi-user access control, exclusive/observer modes)
-
Equipment state management (capture/restore/compare states, versioning)
-
Data acquisition & logging system (continuous/triggered modes, 26 API endpoints)
- Multiple acquisition modes (continuous, single-shot, triggered)
- Advanced statistics (FFT, trend detection, data quality assessment)
- Multi-instrument synchronization
- Real-time WebSocket streaming
- Multiple export formats (CSV, NumPy, JSON, HDF5)
-
Advanced logging system (structured logging, rotation, metrics)
- Structured JSON logging with multiple formatters
- Automatic log rotation and compression
- Performance metrics logging
- Audit trail and access logs
- Equipment event logging
-
Alarm & notification system (threshold monitoring, multi-channel alerts)
- 8 alarm types (threshold, deviation, rate-of-change, equipment error, etc.)
- 4 severity levels (info, warning, error, critical)
- Multi-channel notifications (email, SMS, WebSocket)
- Real-time WebSocket event broadcasting (alarm triggered, updated, cleared)
- Automatic alarm monitoring and lifecycle management
- Alarm history and statistics
- 16 alarm management API endpoints
-
Scheduled operations (automated tasks with APScheduler)
- 6 schedule types (acquisition, state capture, measurement, command, test, script)
- 6 trigger types (cron, interval, date, daily, weekly, monthly)
- Real-time WebSocket event broadcasting (job created, started, completed, failed)
- Job execution history and statistics
- Job pause/resume/manual trigger
- Maximum execution limits and date ranges
- 14 scheduler API endpoints
-
Equipment diagnostics (health monitoring and performance benchmarking)
- Comprehensive health checks (connection, communication, performance, functionality)
- Equipment health scoring (0-100) with status levels
- Performance benchmarking and command latency measurement
- Communication statistics (success rate, response times, error tracking)
- System-wide diagnostics and resource monitoring
- Diagnostic report generation
- 143 comprehensive unit and integration tests (~95% coverage)
- Statistics recording integration (connection events, command metrics)
- 11 diagnostics API endpoints
-
Remote server updates (one-click server management from client GUI)
- Git-based version tracking and update checking
- One-click server updates with progress monitoring
- Automatic Docker container rebuild after updates
- Scheduled update checks (configurable 1-168 hour intervals)
- Update notification banner in client GUI
- Rollback to previous version capability
- Real-time update logs and progress tracking
- System Management panel with intuitive controls
- 11 system management API endpoints
-
Waveform capture & analysis (professional oscilloscope functionality)
- High-speed waveform acquisition with averaging and decimation
- 30+ enhanced automatic measurements (voltage, time, signal quality, statistical)
- Cursor measurements (horizontal/vertical with delta calculations)
- 15 math operations (add, subtract, FFT, integrate, differentiate, etc.)
- Persistence mode (infinite, envelope, variable decay)
- Histogram analysis (voltage/time distributions with statistics)
- XY mode (channel vs channel plots)
- Continuous acquisition (up to 100 Hz)
- 25+ waveform API endpoints
-
Advanced waveform analysis tools (professional signal analysis and characterization)
- Spectral analysis (spectrograms, cross-correlation, transfer functions)
- Comprehensive jitter analysis (TIE, period, cycle-to-cycle, half-period, N-period)
- Eye diagram generation and analysis (serial data quality assessment)
- Mask testing framework (polygon, standard, and auto-generated masks)
- Waveform search and event detection (edges, pulses, runts, glitches, patterns)
- Reference waveform comparison (golden unit testing with tolerances)
- Parameter trending (long-term monitoring with drift analysis)
- 20+ advanced analysis API endpoints
-
Data analysis pipeline (comprehensive signal processing and quality control)
- Signal filtering (Butterworth, Chebyshev, Bessel, Elliptic, FIR filters)
- Filter types: lowpass, highpass, bandpass, bandstop/notch
- Specialized filters: Moving Average, Savitzky-Golay, Median
- Data resampling and interpolation (linear, cubic, spline, Fourier methods)
- Anti-aliasing for downsampling, missing data interpolation
- Curve fitting (8 fit types: linear, polynomial, exponential, logarithmic, power, sinusoidal, Gaussian, custom)
- Comprehensive fit statistics (RΒ², RMSE, residuals)
- Statistical Process Control (6 chart types: X-bar/R, X-bar/S, Individuals, P, C, U)
- Western Electric rules detection for out-of-control points
- Process capability analysis (Cp, Cpk, Pp, Ppk, Cpm indices)
- Automated report generation (HTML, Markdown, JSON, PDF formats)
- Batch processing engine (parallel/sequential file processing)
- 30+ analysis API endpoints
-
Database integration (centralized SQLite storage for historical data)
- Command history logging (all SCPI commands with timestamps, execution time, status)
- Measurement archival (all measurements with metadata and session tracking)
- Equipment usage statistics (session duration, command/measurement counts, errors)
- Data acquisition session tracking (complete session lifecycle and statistics)
- Historical data query API (filtering, pagination, aggregation, trend analysis)
- Automatic cleanup of old records (configurable retention period)
- Database health monitoring and statistics
- 15+ database API endpoints
-
Enhanced calibration management (comprehensive calibration workflows and tracking)
- Calibration procedures (step-by-step workflows with validation)
- Procedure execution tracking (real-time progress, step completion, results)
- Digital calibration certificates (ISO/IEC 17025, traceability, digital signatures)
- Calibration corrections (linear, polynomial, lookup table, custom functions)
- Automatic correction application to measurements
- Reference standards management (calibration tracking, usage recording)
- Standards due date monitoring and alerts
- 20+ enhanced calibration API endpoints
-
Automated test sequences (comprehensive test automation and validation)
- Test sequence creation and management (9 step types)
- Automated execution with real-time progress tracking
- Parameter sweeping for characterization (linear/log scales)
- Pass/fail validation (6 operators, tolerance support)
- Test result archival and trending
- Template library for common tests (voltage accuracy, frequency response)
- Multi-equipment coordination
- 15+ test automation API endpoints
-
Backup & restore system (production-grade data protection and disaster recovery)
- Automatic scheduled backups (configurable interval)
- Multiple backup types (full, config, profiles, data, database, incremental)
- Compression support (gzip, zip, tar.gz)
- SHA-256 checksum verification
- Selective restore (granular control over what to restore)
- Pre-restore safety backups
- Retention policy (automatic cleanup of old backups)
- Backup statistics and monitoring
- 10+ backup management API endpoints
-
Equipment discovery system (automatic device discovery and smart connection management)
- mDNS/Bonjour discovery (automatic network device discovery)
- VISA resource scanning (TCPIP, USB, GPIB, Serial)
- Automatic device identification (*IDN? query)
- Connection history tracking with statistics
- Smart connection recommendations based on success rates
- Device aliases and friendly names
- Last-known-good configuration tracking
- Auto-discovery with configurable intervals
- Device caching for fast access
- 15+ discovery API endpoints
-
Advanced security system (enterprise-grade security for multi-user environments)
- JWT authentication (secure token-based authentication with access/refresh tokens)
- Role-based access control (RBAC with granular permissions)
- User management (complete lifecycle with password policies)
- API key management (programmatic access with scoped permissions)
- IP whitelisting/blacklisting (network-level access control)
- Security audit logging (comprehensive audit trail for compliance)
- Session management (track and manage active user sessions)
- Account lockout protection (brute-force attack prevention)
- Password policies (complexity requirements, expiration, change enforcement)
- Three default roles (admin, operator, viewer) with custom role support
- 30+ security configuration settings
- 25+ security API endpoints
- Compliance support (NIST CSF, ISO 27001, FDA 21 CFR Part 11, GDPR)
-
Desktop GUI client (PyQt6-based cross-platform application)
- Equipment control and monitoring
- Data acquisition interface
- Alarm monitoring and acknowledgment
- Scheduler management interface
- Diagnostics and health monitoring dashboard
- Server connection management
-
MVP Web Dashboard (responsive browser-based interface)
- JWT-based authentication with login page
- Real-time equipment status display with auto-refresh
- Quick equipment control (connect/disconnect/send commands)
- SCPI command interface with history
- Dark mode with system detection
- Responsive design (mobile/tablet/desktop)
- 11 new files (~2,000+ lines)
-
OAuth2 authentication (social login integration)
- Google OAuth2 provider
- GitHub OAuth2 provider
- Microsoft OAuth2 provider
- Automatic user provisioning
- Account linking for existing users
- OAuth2 configuration management
- 8 OAuth2 API endpoints
-
Enhanced Web Dashboard (real-time monitoring and visualization)
- WebSocket real-time updates with exponential backoff reconnection
- Chart.js live data visualization (4 real-time charts with 50-point rolling buffer)
- Equipment profile management UI (CRUD operations, JSON validation)
- Alarm notifications panel with severity levels
- User settings page (profile editing, password change, MFA setup)
- Dark mode support for all new components
- 6 new files and significant updates (~1,200+ lines)
-
Multi-Factor Authentication (MFA/2FA) (enhanced security)
- TOTP-based two-factor authentication (RFC 6238 compliant)
- QR code generation for authenticator apps
- 10 one-time backup codes (bcrypt-hashed)
- MFA setup wizard in user settings
- Enhanced login flow with MFA verification
- 5 MFA API endpoints
- Complete frontend integration
-
Real-time data visualization (pyqtgraph integration)
- Real-time plotting widget with circular buffer
- Multi-channel support with auto-coloring
- Pause/resume and clear controls
- Statistics display (points plotted, update rate)
- Auto-ranging and manual range control
- Integrated into acquisition panel and equipment panels
-
SSH deployment wizard (automated server deployment)
- Multi-step wizard interface
- SSH connection testing
- Password and SSH key authentication
- Automatic file transfer via SCP
- Remote dependency installation
- Systemd service setup for auto-start
- Progress tracking and logging
- Integrated into Tools menu
-
Multi-server connection management
- Server configuration storage (JSON)
- Add/remove/update server profiles
- Server selector widget in main toolbar
- Connection status indicators
- Quick server switching
- Remember last connected server
- Per-server connection history
-
Remote firmware update system (centralized firmware management and deployment)
- Firmware package upload and storage with integrity verification
- Multiple checksum algorithms (SHA-256, SHA-512, MD5, CRC32)
- Compatibility checking (model, version constraints)
- Multi-stage update pipeline with progress tracking
- Automatic rollback on failure
- Update history and audit trail
- Firmware statistics and monitoring
- 11 firmware management API endpoints
- Equipment-specific update support (extensible framework)
-
Automated test sequence builder (visual GUI for creating and managing test sequences)
- Visual sequence builder with step editor
- Support for all 9 step types (setup, command, measurement, delay, validation, sweep, conditional, loop, cleanup)
- Template-based sequence creation (voltage accuracy, frequency response)
- Real-time execution monitoring with progress tracking
- Results display with pass/fail status
- Step management (add, edit, delete, reorder)
- Sequence export to JSON
- 8 test sequence API methods in client
-
Equipment Control Panel (professional real-time equipment control interface)
- Voltage and current control with synchronized dials and spinboxes
- Professional analog gauges with variable-radius labels (realistic lab equipment appearance)
- Three display modes: Digital readouts, Analog gauges, Time-series graph
- Real-time graph visualization with clear functionality
- Dynamic control scaling based on equipment capabilities
- Unified timer architecture for efficient serial communication
- Serial port locking and buffer management for reliable communication
- Output enable/disable toggle with visual mode indicators (CV/CC/OFF)
- Configurable update rate (0.1-10.0 Hz) for all display types
- Equipment lock integration (exclusive/observer modes)
- Additional equipment driver support (new manufacturers and models)
- Rigol MSO2072A Oscilloscope
- Rigol DS1104 Oscilloscope
- Rigol DS1102D Oscilloscope (100 MHz, 1 GSa/s, 2 channels)
- Rigol DL3021A DC Electronic Load
- BK Precision 9206B Multi-Range DC Power Supply
- BK Precision 9205B Multi-Range DC Power Supply
- BK Precision 9130 DC Power Supply
- BK Precision 1902B DC Electronic Load
- BK Precision 1685B DC Power Supply
- Language: Python 3.11+
- Server: FastAPI, PyVISA
- Client: PyQt6, pyqtgraph
- Communication: WebSockets, REST API
- Data Formats: CSV, HDF5, NumPy binary
The easiest way to get started with LabLink is using the new GUI Launcher.
Ubuntu 24.04+ Users - Fully automated setup:
git clone https://github.com/X9X0/LabLink.git
cd LabLink
python3 lablink.pyThe launcher will automatically handle everything, including installing system packages with your permission!
Other Systems - Install system dependencies first:
# Ubuntu/Debian
sudo apt update && sudo apt install -y python3 python3-pip python3-venv git \
libusb-1.0-0 libxcb-xinerama0 libxcb-icccm4 libxcb-keysyms1 libgl1-mesa-glx
# Then clone and launch
git clone https://github.com/X9X0/LabLink.git
cd LabLink
python3 lablink.pyThe LabLink Launcher will:
- β Check your environment automatically
- β Detect and install missing system packages (Ubuntu 24.04+)
- β Show LED indicators for system status (Green = OK, Yellow = Warning, Red = Error)
- β Install missing Python dependencies with one click
- β Launch server or client with dedicated buttons
For Ubuntu 24.04 users: See the detailed Ubuntu 24.04 Setup Guide for more information.
-
Install dependencies:
cd server python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Run the server:
python main.py
-
Access API documentation:
- Open browser to
http://localhost:8000/docs
- Open browser to
Windows Users - Automated Installation:
- Download or clone the repository
- Double-click
install-client.bat(or run in PowerShell):powershell -ExecutionPolicy Bypass -File .\install-client.ps1
Note: Windows blocks PowerShell scripts by default. If you get a security error, see Windows Installation Guide for detailed instructions.
Linux/macOS Users:
- Run the installation script:
./install-client.sh
Manual Installation (All Platforms):
-
Install dependencies:
cd client python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Run the GUI client:
python main.py
-
Connect to server:
- Click "Connect to Server..." or press Ctrl+N
- Use "Localhost" quick connect for local server
- Or enter custom hostname/IP and ports
For detailed setup instructions:
- Windows: See Windows Installation Guide
- Linux/macOS: See Getting Started Guide
- General: See Client README
- Windows Installation Guide - Complete Windows installation guide (fixes execution policy errors)
- Ubuntu 24.04 Setup Guide - Step-by-step guide for Ubuntu 24.04 users
- Getting Started Guide - Installation and setup
- API Reference - Complete API documentation with examples
- Data Acquisition System - Comprehensive guide to data acquisition features
- Advanced Logging System - Logging configuration and best practices
- Alarm & Notification System - Alarm configuration and notification setup
- Scheduled Operations - Job scheduling and automation
- Equipment Diagnostics - Health monitoring and performance diagnostics
- Waveform Capture & Analysis - Advanced oscilloscope functionality
- Advanced Waveform Analysis Tools - Spectral analysis, jitter, eye diagrams, masks
- Data Analysis Pipeline - Signal processing, curve fitting, SPC, and reporting
- Firmware Update System - Remote firmware management and deployment
- Test Coverage Improvement Plan - Comprehensive test coverage roadmap and progress
- Development Roadmap - Planned features and enhancements
Current Version: v1.2.4 (Production Ready) π
Release Date: December 09, 2025
Development Phases Complete:
- β REST API operational (90+ endpoints)
- β WebSocket streaming functional
- β All equipment drivers working
- β Configuration management system
- β Error handling & recovery
- β Equipment profiles
- β Safety limits & interlocks
- β Equipment lock/session management
- β Equipment state management
Phase 2 Complete: Data acquisition & advanced features
- β Continuous, single-shot, and triggered acquisition modes
- β Advanced statistics (FFT, trend detection, data quality)
- β Multi-instrument synchronization
- β Real-time WebSocket streaming
- β Multiple export formats (CSV, NumPy, JSON, HDF5)
- β 26 acquisition API endpoints
Phase 2.5 Complete: Operations & monitoring (Logging, Alarms, Scheduling, Diagnostics)
- β Advanced logging system (JSON, rotation, audit trails, performance metrics)
- β Alarm & notification system (8 types, multi-channel, 16 endpoints)
- β Scheduled operations (6 schedule types, 6 triggers, 14 endpoints)
- β Equipment diagnostics (health checks, benchmarking, 11 endpoints)
- β Comprehensive documentation for all systems
Phase 3 Complete: GUI Client (PyQt6 desktop application)
- β Full-featured desktop GUI with tabbed interface
- β Equipment control panel with SCPI command interface
- β Data acquisition interface with configuration
- β Alarm monitoring with color-coded severity
- β Scheduler management interface
- β Diagnostics dashboard with health scoring
- β Server connection management
- β 40+ API client methods
- β 2,200+ lines of GUI code
Phase 4 Complete: Web Dashboard & Authentication
- β MVP Web Dashboard with responsive design
- β OAuth2 authentication with 3 providers (Google, GitHub, Microsoft)
- β Enhanced Web Dashboard with real-time features
- β Multi-Factor Authentication (TOTP-based 2FA)
- β WebSocket real-time updates
- β Chart.js live data visualization
- β Equipment profile management UI
- β 3,200+ lines of web interface code
Phase 5 Complete: One-Click Deployment & Raspberry Pi Imaging
-
β Real-time data visualization (pyqtgraph integration)
- β Real-time plotting widget with circular buffer
- β Multi-channel support with auto-coloring
- β Zoom, pan, and measurement tools
-
β SSH deployment wizard (automated server deployment)
- β Multi-step wizard interface
- β Automatic file transfer via SCP
- β Remote dependency installation
- β Systemd service configuration
- β Real-time deployment progress
-
β Multi-server connection management
- β Save and manage multiple server profiles
- β Quick server switching from toolbar
- β Connection history tracking
- β Persistent JSON configuration
-
β One-click installation scripts
- β install-server.sh (Linux/macOS/Raspberry Pi)
- β install-client.sh (Linux/macOS)
- β install-client.ps1 (Windows PowerShell)
- β Automatic Docker and dependency installation
- β JWT secret generation
- β Desktop shortcut creation
-
β Raspberry Pi image builder & SD card writer
- β GUI wizard for building custom Pi images
- β Pre-configured images with LabLink pre-installed
- β Wi-Fi and SSH configuration
- β Auto-expanding filesystem
- β First-boot automation script
- β Cross-platform SD card writer (Linux/macOS/Windows)
- β Image verification after writing
- β build-pi-image.sh automation script
- β Zero command-line knowledge required
-
β Docker Compose stack (production-ready deployment)
- β Profile-based service activation (default, caching, postgres, monitoring, full)
- β Health checks and auto-restart
- β Volume persistence
- β Resource limits
- β nginx reverse proxy
- β Optional Redis, PostgreSQL, Grafana, Prometheus
-
β Mobile Architecture Validation (v1.0.0 mobile-readiness assessment)
- β Complete API validation for mobile compatibility
- β REST API assessment (200+ endpoints, platform-agnostic)
- β JWT authentication validation (works perfectly on mobile)
- β OAuth2 flow validation (minor redirect URI support needed)
- β WebSocket reconnection strategy for mobile
- β Response size analysis (all within mobile limits)
- β React Native SDK design
- β Advanced visualization spike results
- β Conclusion: API is 100% mobile-ready, no breaking changes needed
- β
Documentation:
docs/MOBILE_API_REQUIREMENTS.md(500+ lines) - β
Summary:
MOBILE_ARCHITECTURE_VALIDATION.md(295 lines)
v1.0.0 Production Release:
- β Phase 1-3: Core features, UI, deployment automation
- β Phase 2: Test Coverage Sprint (137 passing tests, 26% overall, 70%+ critical paths)
- β Phase 3: Production Hardening (security fixes, performance benchmarks, profiling)
- β Phase 4: v1.0.0 Release (CHANGELOG, documentation, release notes)
- β Phase 1 Test Coverage (November 2025): 362 new tests, 52-54% overall coverage, 85%+ critical paths
Security & Quality:
- β All critical vulnerabilities fixed (FastAPI, Starlette upgraded)
- β Security scans BLOCKING in CI/CD
- β Type hints on critical functions (PEP 484)
- β Performance benchmarked (10 benchmarks established)
- β Comprehensive documentation (2,500+ lines)
Next Versions:
- v1.1.0: Mobile app (React Native for iOS/Android) - API 100% ready
- v1.2.0: Advanced visualization (3D waveforms, FFT waterfalls, SPC charts)
- v1.3.0+: Enterprise features (See ROADMAP.md)
This project is in active development. Contributions, feature requests, and bug reports are welcome!
TBD