Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround to disable bluetooth on NRF52 #4055

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

todd-herbert
Copy link
Contributor

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:

  • the device does not show in scans
  • it is not possible to connect to the device using Bluetooth

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
Copy link
Contributor

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.

@todd-herbert todd-herbert marked this pull request as draft June 9, 2024 17:00
@todd-herbert todd-herbert marked this pull request as ready for review June 12, 2024 07:44
@thebentern thebentern merged commit d60d1d7 into meshtastic:master Jun 12, 2024
83 of 84 checks passed
@todd-herbert todd-herbert deleted the nrf-bluetooth-workaround branch June 28, 2024 07:11
slash-bit pushed a commit to slash-bit/meshtastic-echo-echo that referenced this pull request Jul 4, 2024
* Workaround to allow bluetooth disable on NRF52

* Use miminum tx power for bluetooth

* Reorganize

* Instantiate nrf52Bluetooth correctly..

* Change log message
@mike6789
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants