rbaron / b-parasite

🌱💧 An open source DIY soil moisture sensor
1.85k stars 143 forks source link

[ble] Make advertising non-connectable #120

Closed rbaron closed 1 year ago

rbaron commented 1 year ago

I've been debugging a Shelly BLE proxy feature, which didn't like b-parasite's advertising. It swallowed it before proxying it to HA.

I compared to the legacy b-parasite advertising (pre-nrf-connect, which does work with Shelly's BLE proxy) and found it to be related to the non-connectable/non-scannable settings. Until this PR, we were mistakenly setting the advertising to scannable, although with no scannable data. The Zephyr code that sets this parameter based on the scannable data is here, notably the || sd || clause.

My bet is that some scanners like ESPHome are okay with this, but Shelly is not. Either way, I believe this PR makes the advertisements more compliant.