A Python-based Bluetooth Low Energy (BLE) controller for managing and monitoring a Sandbox Smart coffee roaster. This project aims to create a bridge the device and Artisan Scope, the popular open-source coffee roasting software.
The main objective of this project is to enable seamless integration between the device and Artisan Scope. While the current implementation provides direct control through a command-line interface, the end goal is to create a compatible driver that will allow Artisan Scope to:
- Monitor roasting temperatures in real-time
- Control roaster parameters directly from the Artisan interface
- Record and reproduce roasting profiles
- Leverage all of Artisan's advanced roasting features
Current Status: Manual roasting using Artisan Scope works, profile and status management upcoming.
- Real-time control of roaster parameters:
- Heat power adjustment (0-100%)
- Drum speed control (0-100%)
- Fan speed control (0-100%)
- Light control (on/off)
- Temperature monitoring
- Preheating configuration
- Cooling cycle management
- Automated safety shutdown
- Status handling
- Python 3.7+
bleak
library for BLE communicationwebsockets
library for managing the communications with Artisan Scope- Sandbox Smart home coffee roaster (tested with R1 but it should work with R2 as well)
- Clone this repository:
git clone https://github.com/jzarca01/artisan-sandboxsmart
cd artisan-sandboxsmart
- Install the required dependencies:
pip install -e ".[dev]"
# Using device name
python3 cli.py --name <device-name>
# Using device address
python3 cli.py --address <device-address>
# For macOS users
python3 cli.py --address <device-address> --macos-use-bdaddr
--name <name>
: Connect to device by name--address <address>
: Connect to device by Bluetooth address--macos-use-bdaddr
: Use Bluetooth address instead of UUID on macOS-d, --debug
: Enable debug logging
Once connected, you can use the following commands through the interactive menu:
HEAT 0-100
- Set heat powerDRUM 0-100
- Set drum speedDRAW 0-100
- Set fan speedLIGHT ON
/LIGHT OFF
- Control lightsHPTEMP
- Get current temperatureHSTOP
- Stop the roasterCOOLING
- Activate cooling cycleHPSTART 1200 200
- Start preheating (time / temperature)HSTART
- Start roastingEXIT
- Exit the application
# Device infos are set directly in the main function
python3 server.py
python3 cli_ws.py --url ws://localhost:8765
- Config > Device
- Config > Port > Websocket
- Config > Sampling
- Config > Events > Config
Here you can change preheating parameters with the following syntax HPSTART 1200 200
- Start preheating (time (in seconds no need to change) / temperature)
- Config > Events > Sliders
- Make sure Config > Temperature is set to
Celsius Mode
- Start the websocket server
- Press the
ON
button in Artisan, Websocket should connected - Start preheating by pressing the
START
button - When preheating is finished, start roasting by pressing the
CHARGE
button - You can set the
Air
(Fan),Burner
(Heat) andDrum
settings value directly from the interface - The
DROP
button stops the roasting - The
COOL END
button starts the cooling
The application uses the following BLE characteristics:
- Notification UUID:
0000ffa1-0000-1000-8000-00805f9b34fb
- Roaster Control UUID:
0000ffa0-0000-1000-8000-00805f9b34fb
The controller implements an asynchronous architecture using:
- Asyncio for BLE communication
- Threading for user interface
- Queue for command processing
- Basic BLE communication and device discovery
- Command-line interface structure
- Pre-heating
- Start/Stop roasting commands
- Light control
- Cooling cycle command
- Temperature reading
- Manual Heat power control
- Manual Drum speed control
- Manual Fan speed control
- Websockets server management
- Temperature data formatting for Artisan
- Status management
- Profile management
The application includes comprehensive error handling for:
- BLE connection issues
- Command processing errors
- Device communication failures
Contributions are welcome! Please feel free to submit a Pull Request.
[Add your license information here]
This software is provided as-is. Please ensure you understand the implications of controlling heating equipment remotely before using this controller.