A command-line tool for configuring SenseCAP Watcher devices via Bluetooth Low Energy (BLE).
- Device Discovery: Scan for nearby SenseCAP Watcher devices
- Device Information: View device details, battery status, firmware versions
- WiFi Configuration: Connect the device to WiFi networks
- WiFi Scanning: View available WiFi networks from the device
- Local Services: Configure local server endpoints for offline operation
- Audio Task Composer
- Image Analyzer
- Training Service
- Notification Proxy
- Device Settings: Configure brightness, sound, RGB LED, screen timeout, timezone
- Cloud Service: Enable/disable cloud connectivity
- Task Flow: View current task flow status and progress
- System Actions: Reboot or factory reset the device
- Bluetooth 4.0+ hardware
- macOS 10.13 or later
- Xcode command line tools (for building)
- Bluetooth 4.0+ hardware
- BlueZ Bluetooth stack
- Required packages:
sudo apt-get install bluetooth bluez libbluetooth-dev
- Bluetooth 4.0+ hardware
- Windows 10 or later (with BLE support)
# Clone the repository
git clone https://github.com/brianhealey/sensecap-server.git
cd sensecap-server
# Build the application from project root
go build -o cmd/cli/watcher-config ./cmd/cli
# Run the application
./cmd/cli/watcher-config# macOS (Intel)
GOOS=darwin GOARCH=amd64 go build -o watcher-config-macos ./cmd/cli
# macOS (Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -o watcher-config-macos-arm ./cmd/cli
# Linux
GOOS=linux GOARCH=amd64 go build -o watcher-config-linux ./cmd/cli
# Windows
GOOS=windows GOARCH=amd64 go build -o watcher-config.exe ./cmd/cli./watcher-configUpon starting, you'll see the main menu:
========================================
SenseCAP Watcher Configuration Tool
========================================
Status: Not Connected
----------------------------------------
1. Scan and Connect to Device
2. View Device Information
3. Configure WiFi
4. Scan WiFi Networks
5. Configure Local Services
6. Configure Device Settings
7. Configure Cloud Service
8. View Task Flow Status
9. Exit
----------------------------------------
- Scan and Connect: Start by scanning for devices and selecting one to connect
- View Info: Check device information to verify connection
- Configure: Use the menu options to configure various settings
- Exit: Gracefully disconnect and exit when done
Select option: 3
Enter SSID: MyHomeNetwork
Enter Password: mypassword123
Configuring WiFi...
✓ WiFi configured successfully
For local server integration (e.g., sensecap-server):
Select option: 5
Configure which service?
1. Audio Task Composer
2. Image Analyzer
3. Training
4. Notification Proxy
Select: 1
Enable service? (y/n): y
Enter service URL: http://192.168.1.100:8080/v2/watcher/talk/audio_stream
Enter token (optional):
Configuring local service...
✓ Local service configured successfully
Adjust brightness, sound, and other settings:
Select option: 6
=== Device Settings ===
1. Set Brightness
2. Set Sound Volume
3. Toggle RGB LED
4. Set Screen Timeout
5. Set Timezone
6. Reboot Device
7. Factory Reset
8. Back
Select: 1
Enter brightness (0-100): 75
Applying settings...
✓ Settings applied successfully
- Scan and connect to device
- Configure WiFi to connect device to network
- Configure local services (if using local server)
- Adjust device settings (brightness, sound, etc.)
- Connect to device
- Configure Local Services (option 5)
- Enable Audio Task Composer with your local server URL
- Enable Image Analyzer with your local server URL
- Enable Notification Proxy for alerts
- Optionally disable Cloud Service (option 7)
- View Device Information to check battery and firmware
- Scan WiFi Networks to verify connectivity
- View Task Flow Status to check current operation
- Reboot device if needed
0= 15 seconds1= 30 seconds2= 1 minute3= 2 minutes4= 5 minutes5= 10 minutes6= Never
When using the sensecap-server project:
- Audio Task Composer:
http://<server-ip>:8080/v2/watcher/talk/audio_stream - Image Analyzer:
http://<server-ip>:8080/v1/watcher/vision - Training:
http://<server-ip>:8080/v1/training(if implemented) - Notification Proxy:
http://<server-ip>:8080/v1/notification/event
Replace <server-ip> with your local server's IP address.
- Ensure the Watcher device is powered on
- Check that Bluetooth is enabled on your computer
- Verify the device is in pairing mode (check device documentation)
- Move closer to the device
- Make sure no other device is connected to the Watcher
- Try power cycling the Watcher device
- Restart the CLI application
- Check Bluetooth permissions on your system
If you get permission errors:
# Add your user to the bluetooth group
sudo usermod -a -G bluetooth $USER
# Reload group membership (or log out/in)
newgrp bluetooth
# Run the application with capabilities
sudo setcap 'cap_net_raw,cap_net_admin+eip' ./watcher-configGrant Bluetooth permissions:
- System Preferences → Security & Privacy → Privacy → Bluetooth
- Add Terminal (or your terminal emulator) to the allowed apps
- Device may be processing previous command
- Check device battery level
- Ensure WiFi configuration hasn't caused disconnect
- Try disconnecting and reconnecting
cmd/cli/
├── main.go # Application entry point and menu system
└── README.md # This file
internal/watcher/ # BLE functionality package
├── ble.go # BLE scanning and connection handling
├── commands.go # AT command builders
└── types.go # Shared type definitions
The CLI application uses the internal/watcher package for all Bluetooth Low Energy operations. This package is shared between the CLI tool and other parts of the sensecap-server project.
# From project root
go build -o cmd/cli/watcher-config ./cmd/cli
# Or from anywhere
go build -o watcher-config github.com/brianhealey/sensecap-server/cmd/cli- Add command builder to
internal/watcher/commands.go:
func BuildMyCommand(param string) (string, error) {
return fmt.Sprintf("AT+mycommand=%s", param), nil
}- Add menu handler in
cmd/cli/main.go:
func (m *Menu) handleMyCommand() error {
cmd, err := watcher.BuildMyCommand("value")
if err != nil {
return err
}
resp, err := m.ble.SendCommand(cmd)
// Handle response
}- Add to main menu switch statement in
Run()method
See the main project LICENSE file.
- BLUETOOTH_API.md - Complete Bluetooth API reference
- Main README - SenseCAP Server project documentation
For issues and questions:
- Check the BLUETOOTH_API.md documentation
- Review troubleshooting section above
- Check device is powered and in range