forked from probablycorey/baudy
45 lines
1.7 KiB
Markdown
45 lines
1.7 KiB
Markdown
# Baudy Wi‑Fi Chirp Setup
|
||
|
||
A proof-of-concept for provisioning Wi‑Fi over sound with [ggwave](https://github.com/ggerganov/ggwave).
|
||
|
||
The phone and the server exchange short audio chirps to do a simple setup flow:
|
||
|
||
1. **Phone says hello** over audio.
|
||
2. **Server scans nearby Wi‑Fi networks** with `nmcli`.
|
||
3. **Server chirps the SSID list back** to the phone.
|
||
4. **Phone selects a network** and, if needed, enters the password.
|
||
5. **Phone chirps the password back** to the server.
|
||
6. **Server tries to join the network** and chirps the result.
|
||
|
||
This is aimed at Raspberry Pi / Linux-style setup flows where networking may not be available yet.
|
||
|
||
## Current assumptions
|
||
|
||
- Wi‑Fi scanning and joining are implemented for **Linux via `nmcli`**.
|
||
- The phone UI is still served as a normal web page for this repo's demo flow.
|
||
- Passwords are sent as **plaintext audio payloads** in this POC.
|
||
- Audio is **half-duplex**: only one side should chirp at a time.
|
||
|
||
## Run
|
||
|
||
```sh
|
||
bun install
|
||
bun run index.tsx
|
||
```
|
||
|
||
Open the shown URL on your phone.
|
||
|
||
For phone microphone access you need a secure origin:
|
||
|
||
- **macOS:** the app serves local HTTPS directly
|
||
- **Linux:** prefer `tailscale serve <port>` and open the resulting `https://...ts.net` URL
|
||
|
||
## Notes
|
||
|
||
- Nearby network lists are deduped by SSID and trimmed to the strongest entries.
|
||
- The browser uses WebAudio + ggwave WASM for chirp encode/decode.
|
||
- The server uses `sox` for audio capture/playback.
|
||
- The server waits for the phone to switch back into listening mode before replying.
|
||
|
||
See [docs/ggwave-gotchas.md](docs/ggwave-gotchas.md) for platform-specific lessons about iOS audio, macOS microphone permissions, Linux ALSA device selection, and ggwave WASM behavior.
|