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

Separate timeout option for BT Classic commands #179

Closed
mKeRix opened this issue Apr 22, 2020 · 4 comments
Closed

Separate timeout option for BT Classic commands #179

mKeRix opened this issue Apr 22, 2020 · 4 comments

Comments

@mKeRix
Copy link
Owner

mKeRix commented Apr 22, 2020

Is your feature request related to a problem? Please describe.
Pis share Bluetooth and WiFi on a single chip, which means Bluetooth communication blocks WiFi communication. The default interval of 6s leaves only very little time for network calls and leads to sluggish SSH sessions and Pis going unavailable. See also #178 for an example.

Describe the solution you'd like
At the moment the timeout for hcitool is set based on the interval and some leeway. If we could set the timeout as a separate option we could reduce the actual communication time down to what is realistically needed in most cases (about 2-3s) to leave some more room for the WiFi packets to come through.

Describe alternatives you've considered

  • Increasing the interval - solves the issue, but at the cost of detection speed

Additional context
Shortening the timeout to below the default timeout of hcitool requires forceful kills of the process, which might mess up the Pi or the integration when left running for some time. This needs to be tested before a release to the public.

github-actions bot pushed a commit that referenced this issue Aug 16, 2020
# [2.9.0-beta.1](v2.8.2...v2.9.0-beta.1) (2020-08-16)

### Features

* **bluetooth-classic:** add option for preserving sensor state ([7cd2afe](7cd2afe)), closes [#156](#156)
* **bluetooth-classic:** add scan time limit option ([ae40009](ae40009)), closes [#179](#179)
* **home-assistant:** refresh states after broker re-connect ([85064e6](85064e6)), closes [#218](#218)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.9.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bensuffolk
Copy link

bensuffolk commented Aug 20, 2020

Is there any additional configuration needed to set this lower timeout, or is there a default that will just work after installing the beta?

Edit: I found it in the commit notes, the config is scanTimeLimit and looks like it has a default of 2 seconds

@bensuffolk
Copy link

Just wanted to say this seems to be working well for me. Typically before this unless there was at least one device in range the pi zero w might as well have not been on the network. no response to pings, no ssh access until you gave it a device.

No it seem fine (only tested for about 8 hours so far, so not sure of any long term ill effects, but looking good!).

@mKeRix mKeRix closed this as completed in ae40009 Aug 23, 2020
github-actions bot pushed a commit that referenced this issue Aug 23, 2020
# [2.9.0](v2.8.2...v2.9.0) (2020-08-23)

### Bug Fixes

* **bluetooth-classic:** exclude old measurements from preservation ([10b0e21](10b0e21))

### Features

* **bluetooth-classic:** add option for preserving sensor state ([7cd2afe](7cd2afe)), closes [#156](#156)
* **bluetooth-classic:** add scan time limit option ([ae40009](ae40009)), closes [#179](#179)
* **home-assistant:** refresh states after broker re-connect ([85064e6](85064e6)), closes [#218](#218)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants