roscopetracula / hindenburgFights

11 stars 1 forks source link

Add device scanning to client. #25

Closed jef-pearlman closed 9 years ago

jef-pearlman commented 9 years ago

Devices announce themselves often (maybe 100ms by default), and I believe this is configurable. We could make the client only attempt a connection if a device has been seen in the last x ms (maybe about a second). This should eliminate even the existing timeout/delay except for a brief time period after the blimp has stopped responding.

Initial tests indicate that you cannot scan and connect at the same time, so we may need a secondary bluetooth dongle to do this.

You also need special permissions to run hcitool not as root. I'll probably make an overall setup script (that also does things like build bluepy-helper) if this becomes part of the regular process.

Ideally the code should work whether or not the software fix and/or dongle are present, and operate correctly without scanning capability.

jef-pearlman commented 9 years ago

The code appears to work. Note that it does still require multiple bluetooth dongles, but it will fall back gracefully if not present. If for some reason the scanning is causing problems, the command line option "--scan-devices -" should effectively disable it.