Open
Description
Draft proposal for adding mobile support
Given
- We use Vite for PWA and Vue3 event handlers for port events and serial connections.
- Android USB serial support is plugin-fragmented and brittle.
- iOS blocks USB serial.
- Firmware uses Dyad (raw TCP socket, not WebSockets).
- We do not develop BLE code.
- Only few boards available with wireless connectivity.
Questions
- How do we add zip support on host?
- Do we prefer BLE or WIFI?
- is there a USB dongle we could use on FC?
- We could use ELRS hardware?
- How about mDNS?
✅ Connection Methods to Support
Feature | Android | iOS | Approach |
---|---|---|---|
BLE (GATT) | ✅ | ✅ | Capacitor plugin + GATT profile |
Wi-Fi (Dyad) | ✅ | ✅ | Raw TCP socket (needs plugin) |
DFU over BLE | ✅ | ✅ | Nordic-style (or custom) |
DFU over Wi-Fi | ✅ | ✅ | Raw TCP DFU (if supported) |
🔧 Plugin Strategy
- 🌐 Wi-Fi / TCP Support (Dyad)
Capacitor has no built-in support for raw TCP, but you can use a plugin like:
capacitor-plugin-socket (unofficial)
Or build a minimal custom plugin to open TCP sockets to the firmware IP on a fixed port.
❗ WebSockets won’t work with Dyad, so fetch / browser APIs are out.
Sample plugin code (Android/iOS) would use:
- Android: java.net.Socket
- iOS: GCDAsyncSocket (via CocoaAsyncSocket)
- 🧬 BLE SupportUse @capacitor-community/bluetooth-le:
npm install @capacitor-community/bluetooth-le
npx cap sync
Works on both Android and iOS.
You'll need to define a BLE GATT profile that:
- Accepts commands from the client.
- Sends responses / telemetry back.
If DFU is supported over BLE (Nordic DFU-like), we can also handle that here.
- 🧪 DFU Support Options
Transport | Approach | Notes |
---|---|---|
Wi-Fi | Raw TCP transfer over known port | Custom protocol handler for DFU |
BLE | Nordic DFU or custom GATT service | If your firmware supports BLE DFU |
You’ll need to implement matching upload logic in the app for DFU:
- Chunking firmware.
- Progress UI.
- Verifying upload and applying reset.
Capacitor can help wrap native file access and socket APIs needed here.
🧱 Suggested Stack
🔗 Wi-Fi
- Custom Capacitor TCP socket plugin
- Connect via local IP
- Protocol:
- Command/control
- Optional DFU
🔗 BLE
- Capacitor BLE plugin
- Custom GATT service (you define)
- BLE DFU (if available)
Tasks
- Generate a custom Capacitor plugin for TCP sockets (Dyad) - Add custom Capacitor plugin-socket for raw TCP support #4471
- Provide a DFU upload service that can handle Wi-Fi targets
- Provide a BLE service scaffold and how to structure the GATT commands
- Provide a DFU upload service that can handle BLE targets
- DFU transfer should use zip format to decrease transfer time.