Point setup at docs/BUILD.md, add repo layout

This commit is contained in:
2026-09-01 22:44:05 +10:00
parent 6f93f938cb
commit f2645ce729
+16 -16
View File
@@ -6,6 +6,10 @@ BLE, both on the same Bluetooth stack.
This is the harder of the two routes. If you want the boring one that works This is the harder of the two routes. If you want the boring one that works
first go, see `ps4-lego-bridge` — two boards and a UART between them. first go, see `ps4-lego-bridge` — two boards and a UART between them.
**Build and deploy instructions: [docs/BUILD.md](docs/BUILD.md).** This will not
compile out of the box — the board package ships the BTstack headers but does
not put them on the include path, and that has to be fixed first.
## How it avoids the stack collision ## How it avoids the stack collision
The reason the obvious sketch fails is that Bluepad32 (BTstack) and Legoino The reason the obvious sketch fails is that Bluepad32 (BTstack) and Legoino
@@ -38,19 +42,14 @@ then `BP32.enableNewBluetoothConnections(true)` opens up for the pad. Bluepad32'
inquiry and LE scan otherwise run at the same time as our LE create-connection inquiry and LE scan otherwise run at the same time as our LE create-connection
and the hub connects unreliably or not at all. and the hub connects unreliably or not at all.
## Setup ## Layout
1. Preferences → Additional board manager URLs: ```
`https://raw.githubusercontent.com/ricardoquesada/esp32-arduino-lib-builder/master/bluepad32_files/package_esp32_bluepad32_index.json` ps4_lego_onebrain/ps4_lego_onebrain.ino the sketch
2. Boards Manager → install **esp32_bluepad32**. docs/BUILD.md install, include-path fix, first run
3. Tools → Board → **esp32_bluepad32** → ESP32 Dev Module. Must be the original docs/platform.local.txt the include-path override, for restoring
ESP32 (WROOM/WROVER) — S3/C3/C6/H2 have no Bluetooth Classic. after a Bluepad32 package update
4. Partition scheme: **Huge APP**. BTstack with both transports plus the GATT ```
client will not fit the default.
5. Put your hub addresses in `HUB_ADDR_STR`, flash, watch the serial monitor.
Do not install Legoino or NimBLE-Arduino. If they end up in the build you are
back to two host stacks.
## The protocol, in full ## The protocol, in full
@@ -81,11 +80,12 @@ Full spec: https://lego.github.io/lego-ble-wireless-protocol-docs/
## What to expect on the bench ## What to expect on the bench
Verified from documentation: the Bluepad32 board-package install, the threading Verified: the Bluepad32 board-package install, the threading contract and
contract and `btstack_run_loop_execute_on_main_thread()`, the BTstack GATT `btstack_run_loop_execute_on_main_thread()`, the BTstack GATT client call
client call signatures, and the LWP3 message encoding above. signatures, the LWP3 message encoding above, and — on Jess's machine — that
package 4.1.0 ships every header this needs under `tools\sdk\esp32\include\`.
Not verified, because it needs your hardware: Not verified, because it needs the hardware powered up:
* **Address type.** LEGO's OUI is `90:84:2B`, a public range, so the sketch uses * **Address type.** LEGO's OUI is `90:84:2B`, a public range, so the sketch uses
`BD_ADDR_TYPE_LE_PUBLIC`. If the connect times out repeatedly with no LE `BD_ADDR_TYPE_LE_PUBLIC`. If the connect times out repeatedly with no LE