Files
firmware/src
James RichandClaude Opus 5 ef1d0f571d Add a TX-only switch and NimBLE bond recovery; ESP32 ext-adv is the real blocker
Two isolation aids and a conclusion.

BLE_MESH_TX_ONLY skips the scan. Useful in its own right for a broadcast-only
node, and it is what localised the boot loop: with it set the ESP32 build is
stable, without it the node resets every ~3s with "BLE mesh started" as the last
line. So the fault is in ble_gap_ext_disc(), not in the pump or the readiness
poll.

clearCorruptBondStoreOnce() is reinstated from thebentern's branch, which I
dropped during the merge as unrelated. It is not - a stored bond blob that
crashes NimBLE during populate_db_from_nvs produces exactly the symptom seen
here. It did not fix it, but it belongs with this work either way.

The conclusion, evidenced rather than guessed: CONFIG_BT_NIMBLE_EXT_ADV=y is
incompatible with the PhoneAPI's advertising as this tree does it.

 - ble_gap_adv_stop returns rc=8, BLE_HS_ENOTSUP: under ext-adv the legacy
   advertising API the Arduino BLE wrapper calls is simply not there.
 - On one boot the diagnostic caught nimbleBluetooth->isActive() true while a
   BLE scan from the host saw no connectable advertisement at all - setup()
   completing, advertising silently not.
 - On most boots isActive() is false and no advertisement of any kind appears,
   so setup() is not completing.
 - The RAK4631 sitting beside it advertises normally throughout, so this is the
   ESP32 stack, not the environment or the scanner.

Porting the PhoneAPI advertisement onto ext-adv instance 0 is therefore a
prerequisite for ESP32 BLE mesh, not a later tidy-up - which is what
thebentern's "#if defined(NIMBLE_TWO) || CONFIG_BT_NIMBLE_EXT_ADV" guard change
was doing for the NimBLE version his branch targeted, and which I wrongly
dismissed as targeting a stack this tree no longer uses.

nRF52 is unaffected: it reaches extended advertising through the SoftDevice
directly and never touches the legacy API.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 14:49:23 -05:00
..
2026-08-20 12:28:57 +00:00
2026-08-20 12:28:57 +00:00
…
…
…
…
…
…