Workaround to disable bluetooth on NRF52 #4055
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.