Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## v1.8.0 — Serial Capability (Bluetooth + USB)

> Requires Android 10+ (API 29)

### New: Serial Communication (#21)

- **Bluetooth Classic Serial** — Connect to HC-05, Micro:bit, and any SPP/RFCOMM device via `flutter_bluetooth_classic_serial`
- **USB Serial** — Connect to Arduino, Micro:bit, FTDI, CH340, CP210x via USB OTG using `flutter_serial_communication`
- **Unified API** — Single `serial` capability with `transport` parameter ("bluetooth" or "usb"); 6 commands: `scan`, `connect`, `write`, `read`, `disconnect`, `list`
- **64KB Read Buffer** — Incoming data is buffered per connection with delimiter-based and timeout-based reads
- **Smart Permission Gating** — Bluetooth permissions requested only for BT commands; USB requires no runtime permissions
- **Simultaneous Transports** — One USB and one BT connection can be active at the same time

### Node Commands Added

| Command | Description |
|---------|-------------|
| `serial.scan` | Discover USB devices or paired Bluetooth devices |
| `serial.connect` | Open a persistent serial connection |
| `serial.write` | Send data (utf8 or base64 encoded) |
| `serial.read` | Read buffered data with timeout and delimiter support |
| `serial.disconnect` | Close one or all connections |
| `serial.list` | List active connections with buffer sizes |

### Android Permissions Added

- `BLUETOOTH`, `BLUETOOTH_ADMIN` (Android 11 and below)
- `BLUETOOTH_CONNECT`, `BLUETOOTH_SCAN` (Android 12+)
- `android.hardware.usb.host` feature (optional)

---

## v1.7.1 — Background Persistence & Camera Fix

> Requires Android 10+ (API 29)
Expand Down
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ OpenClaw brings the [OpenClaw](https://github.com/anthropics/openclaw) AI gatewa
- **One-Tap Setup** — Downloads Ubuntu rootfs, Node.js 22, and OpenClaw automatically
- **Built-in Terminal** — Full terminal emulator with extra keys toolbar, copy/paste, clickable URLs
- **Gateway Controls** — Start/stop gateway with status indicator and health checks
- **Node Device Capabilities** — 7 capabilities (15 commands) exposed to AI via WebSocket node protocol
- **Node Device Capabilities** — 9 capabilities (21 commands) exposed to AI via WebSocket node protocol
- **Token URL Display** — Captures auth token from onboarding, shows it with a copy button
- **Web Dashboard** — Embedded WebView loads the dashboard with authentication token
- **View Logs** — Real-time gateway log viewer with search/filter
Expand Down Expand Up @@ -93,8 +93,34 @@ The Flutter app connects to the gateway as a **node**, exposing Android hardware
| **Screen** | `screen.record` | MediaProjection consent |
| **Sensor** | `sensor.read`, `sensor.list` | Body Sensors |
| **Haptic** | `haptic.vibrate` | None |
| **Serial** | `serial.scan`, `serial.connect`, `serial.write`, `serial.read`, `serial.disconnect`, `serial.list` | Bluetooth (BT only) |

The gateway's `openclaw.json` is automatically patched before startup to clear `denyCommands` and set `allowCommands` for all 15 commands.
The gateway's `openclaw.json` is automatically patched before startup to clear `denyCommands` and set `allowCommands` for all registered commands.

#### Serial Capability

The serial capability enables AI agents to communicate with physical hardware over **Bluetooth Classic** (RFCOMM/SPP) and **USB serial** (CDC-ACM, FTDI, CH340, CP210x) — perfect for controlling Arduino, Micro:bit, HC-05, and similar devices.

**Supported transports:**
| Transport | Package | Supported Chips |
|---|---|---|
| USB Serial | `flutter_serial_communication` | CDC-ACM, FTDI, CH340, CP210x |
| Bluetooth Classic | `flutter_bluetooth_classic_serial` | Any SPP/RFCOMM device |

**Usage flow:**
```
serial.scan transport:"usb" # Discover USB devices
serial.connect transport:"usb" deviceId:3 baudRate:9600 # Connect
serial.write connectionId:"usb_3" data:"Hello\n" # Send data
serial.read connectionId:"usb_3" timeoutMs:2000 # Read response
serial.disconnect connectionId:"all" # Clean up
```

**Notes:**
- USB devices are detected automatically via USB OTG — no permissions required
- Bluetooth devices must be paired via Android Settings first, then `serial.scan transport:"bluetooth"` lists them
- One active connection per transport (USB and BT can be connected simultaneously)
- Incoming data is buffered (64KB per connection) and read on demand with optional delimiter matching

### Termux CLI
- **One-Command Setup** — Installs proot-distro, Ubuntu, Node.js 22, and OpenClaw
Expand Down Expand Up @@ -193,7 +219,7 @@ openclawx gateway --verbose
│ ┌─────────────────┴────────────────────────────┐ │
│ │ Node Provider (WebSocket) │ │
│ │ Camera · Flash · Location · Screen │ │
│ │ Sensor · Haptic · Canvas │ │
│ │ Sensor · Haptic · Canvas · Serial │ │
│ └─────────────────┬────────────────────────────┘ │
└────────────────────┼──────────────────────────────┘
Expand All @@ -204,7 +230,7 @@ openclawx gateway --verbose
│ │ ┌─────────────────────────────────────┐ │ │
│ │ │ OpenClaw AI Gateway │ │ │
│ │ │ http://localhost:18789 │ │ │
│ │ │ ← Node WS: 15 device commands │ │ │
│ │ │ ← Node WS: 21 device commands │ │ │
│ │ └─────────────────────────────────────┘ │ │
│ │ Optional: Go, Homebrew │ │
│ └────────────────────────────────────────────┘ │
Expand Down Expand Up @@ -256,6 +282,7 @@ flutter_app/lib/
│ ├── location_capability.dart # GPS with timeout + fallback
│ ├── screen_capability.dart # Screen recording via MediaProjection
│ ├── sensor_capability.dart # Accelerometer, gyroscope, etc.
│ ├── serial_capability.dart # Bluetooth Classic + USB serial
│ └── vibration_capability.dart # Haptic feedback
└── widgets/
├── gateway_controls.dart # Start/stop, URL display, copy button
Expand Down
Loading