meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.35k stars 816 forks source link

Workaround to disable bluetooth on NRF52 #4055

Closed todd-herbert closed 3 months ago

todd-herbert commented 3 months ago

Not a fix, but a workaround for #2885. Implements a suggestion discussed on the Meshtastic Discord server:

If config.bluetooth.enabled is false, Bluefruit is setup as normal, then advertising is stopped, and the tx power is reduced to minimum. This means that the SoftDevice, and the brown-out-detection, are enabled as usual.

With this workaround, and Bluetooth disabled:

This workaround seems to avoid the issue of #2885, and RadioLib -706 errors (discussed in #NRF52 on Discord). I have not experienced any lock-ups or crashes during testing, even with uptime > 3 days. It would be good to get more test time on this before rolling out.

I don't have equipment to measure the power consumption over time, but crude current measurement with a digital multimeter suggests that the workaround is similar to running with Bluetooth completely uninitialized. The workaround is at most a few perfect more efficient than running normally, with Bluetooth at idle.

thebentern commented 3 months ago

Looks good. I want to hold this one till the release after this upcoming alpha though, just in case we encounter lockups on stop advertising.

mike6789 commented 2 months ago

I will test this soon with power monitoring equipment, hope it fixes my issue