Implements the only architecture that can relay iPhone audio to two BT
speakers at once (one ESP32 cannot be A2DP sink+source, and a source holds
only one link):
iPhone ))BT)) [Board A: A2DP sink -> I2S master]
==I2S bus==> [Board B: I2S slave -> A2DP source] ))BT)) JBL
==I2S bus==> [Board C: I2S slave -> A2DP source] ))BT)) Cardo
- src/board_sink.cpp : A2DP sink "BikeAudio", forwards decoded PCM to an
I2S master bus (BCK=5, WS=25, DATA=23); follows negotiated sample rate.
- src/board_source.cpp : I2S slave (BCK=19, WS=18, DATA=22) -> A2DP source,
target speaker via TARGET_SPEAKER build flag; pads silence on underrun.
- platformio.ini : 3 envs (sink, source_jbl, source_cardo) sharing an
[env] base; sources differ only by TARGET_SPEAKER. build_src_filter selects
the per-board source file. Libs pinned as before.
- README_RELAY.md : wiring table, I2S bus topology, flash order, pairing,
and the speaker-sync limitation.
Replaces the single-board src/main.cpp (architecturally impossible). All
three envs build clean. Hardware flash + wiring next.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.5 KiB
INI
40 lines
1.5 KiB
INI
; BikeAudio — 3-board relay (iPhone -> Board A sink -> I2S -> Boards B/C sources -> JBL + Cardo)
|
|
;
|
|
; One ESP32 cannot be an A2DP sink and source at once, and an A2DP source can
|
|
; reach only one speaker — so the work is split across three boards that share
|
|
; an I2S bus. See README.md for wiring and the flash order.
|
|
;
|
|
; Build all: pio run
|
|
; Build one board: pio run -e sink | -e source_jbl | -e source_cardo
|
|
;
|
|
; Common specs preserved from the original sketch: ESP32 Arduino core 2.0.x via
|
|
; espressif32 ~6.6.0, esp32dev, huge_app partition (BT stack), 115200 monitor.
|
|
|
|
[platformio]
|
|
default_envs = sink, source_jbl, source_cardo
|
|
|
|
[env]
|
|
platform = espressif32 @ ~6.6.0
|
|
board = esp32dev
|
|
framework = arduino
|
|
board_build.partitions = huge_app.csv
|
|
monitor_speed = 115200
|
|
; pschatzmann libs pinned to exact commits (ESP32-A2DP 1.8.11, audio-tools 1.2.4)
|
|
lib_deps =
|
|
https://github.com/pschatzmann/ESP32-A2DP#42601717cd70d5300c9b519f3c2bf1d64d77ea2b
|
|
https://github.com/pschatzmann/arduino-audio-tools#64b64dcb9bde18a0a17766eeb6529c3a53d920a8
|
|
|
|
; --- Board A: A2DP sink (iPhone) -> I2S master --------------------------------
|
|
[env:sink]
|
|
build_src_filter = +<board_sink.cpp>
|
|
|
|
; --- Board B: I2S slave -> A2DP source -> JBL Charge 5 ------------------------
|
|
[env:source_jbl]
|
|
build_src_filter = +<board_source.cpp>
|
|
build_flags = '-DTARGET_SPEAKER="JBL Charge 5"'
|
|
|
|
; --- Board C: I2S slave -> A2DP source -> Cardo (Tangerine EDGE) --------------
|
|
[env:source_cardo]
|
|
build_src_filter = +<board_source.cpp>
|
|
build_flags = '-DTARGET_SPEAKER="Tangerine EDGE"'
|