A modern Electron-based desktop application for monitoring GPIO states from ESP32 devices via Bluetooth Low Energy (BLE).
streamdeck-project/
├── README.md # This file
├── package.json # Root workspace configuration
├── run.bat # Quick start script for Windows
├── app/ # Electron application (React + TypeScript + Vite)
│ ├── package.json
│ ├── electron/ # Electron main process
│ ├── src/ # React frontend source
│ └── dist/ # Built application
├── backend/ # Python BLE backend
│ ├── requirements.txt
│ ├── bluetooth_scanner.py
│ ├── volume_control.py
│ └── volume_config.json
├── firmware/ # ESP32 Arduino firmware
│ └── streamdeck.ino
└── assets/ # Shared project assets
- Node.js 16+ and npm
- Python 3.11+
- Arduino IDE with ESP32 support and ArduinoJson library
-
Clone the repository:
git clone https://github.com/joan-code6/Streamdeck/
-
Run the setup script:
.\setup.ps1
-
Navigate to the project root (if not already there):
cd ..
-
Start the development environment:
npm run dev
cd app
npm run dev # Development with hot reload
npm run build # Build for production
npm run electron:dev # Run electron in developmentcd backend
python bluetooth_scanner.py # Start BLE scanner- Located in
firmware/streamdeck.ino - Use Arduino IDE to modify and upload to ESP32
- Install dependencies:
npm install
- Open
esp32-side/esp32-side.inoin Arduino IDE - Install required libraries (ArduinoJson)
- Change the
DEVICE_IDfor each device (e.g., "ESP32_001", "ESP32_002") - Upload the code to your ESP32
- The device will advertise as "ESP32_Streamdeck_[DEVICE_ID]"
# Install dependencies
npm install
# Run the desktop application
npm startOr use the convenience script:
run.batpython main.pyThe system now runs continuously and:
- Scans every 10 seconds for new ESP32 devices
- Maintains persistent connections to all discovered devices
- Automatically reconnects if a device disconnects
- Handles multiple devices simultaneously
- Never exits unless manually stopped (Ctrl+C)
- Auto-discovery: Finds devices advertising as "ESP32_Streamdeck_[ID]"
- Connection verification: Sends verification on first connect
- Keep-alive monitoring: Regular heartbeat checks
- GPIO state tracking: Real-time updates of all 24 pins
- Error recovery: Automatic reconnection on failures
- Start the Application: Run
npm start - Automatic Operation: The system will continuously scan and connect to devices
- Monitor GPIOs: Watch real-time GPIO states with visual indicators
- View Logs: Check the activity log for connection status and data
- Multi-Device: Add more ESP32 devices with different DEVICE_IDs
The ESP32 monitors these GPIO pins by default:
- GPIO 0-11, 13-19, 21-23, 25 (24 pins total)
- ADC pins (32-39) automatically read analog values
- Other pins read digital values
Modify the gpioPins array in the ESP32 code to change pin assignments.
- ESP32: Sends structured JSON data via BLE notifications
- Python Script: Handles BLE communication using bleak library
- Electron App: Provides beautiful UI and spawns Python process
- Communication: JSON-based protocol with verification and keep-alive
- Problem: Python script exits with code 0
- Solution: The script now runs continuously. If it exits, check:
- BLE permissions (run as administrator on Windows)
- bleak library installation:
pip install bleak - ESP32 device is powered and advertising
- Check: ESP32 is powered on and BLE is enabled
- Check: Device name matches "ESP32_Streamdeck_*"
- Check: Bluetooth is enabled on host computer
- Check: No other BLE connections interfering
- Note: System scans every 10 seconds automatically
- Problem: Devices connect then disconnect
- Solution: Check ESP32 battery/power supply
- Solution: Reduce distance between devices
- Solution: Check for BLE interference
- Note: System automatically retries connections
- Problem: Python output not reaching Electron
- Solution: Check Python process is running in Electron logs
- Solution: Restart the Electron application
- Solution: Check console for JavaScript errors
- Problem: Keep-alive messages flooding logs
- Solution: Keep-alive messages are filtered out to reduce spam
- Note: Only important events are logged
- Problem: Only one device connects
- Solution: Ensure each ESP32 has a unique DEVICE_ID
- Solution: Check Bluetooth adapter capacity
- Note: System supports multiple simultaneous connections
- Use
npm run devto run with DevTools open - Modify
renderer.jsfor UI changes - Modify
main.pyfor BLE communication logic - Modify ESP32 code for hardware changes
MIT License - feel free to use and modify!