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

Device Name Inaccurate #95

Closed
DavidYauUGA opened this issue Jul 26, 2019 · 5 comments · Fixed by #99
Closed

Device Name Inaccurate #95

DavidYauUGA opened this issue Jul 26, 2019 · 5 comments · Fixed by #99
Assignees
Labels
Backend: pythonnet Issues or PRs relating to the .NET/pythonnet backend

Comments

@DavidYauUGA
Copy link

  • bleak version: 0.4.3
  • Python version: 3.7.4
  • Operating System: Win 10

Description

I was trying to use to discover.py, but they all print out company's name of the bluetooth not the actual setup name for the device. For example, instead of showing "Micheal's Beats3", it will show "Microsoft".

What I Did

33:FB:D9:92:DE:FA: Microsoft (b'\x01\t \x029\xc5\xc7\xbf\xdb\x88\xe6\xd1\x1e\\\xean\x82U\xb1\xa9Eo\xdc\xf39e9')
@arasan90
Copy link

  • bleak version: 0.4.3
  • Python version: 3.7.4
  • Operating System: Win 10

I was about to open a similar issue:
Even if a set a name on the BLE server (on a ESP32 module), I can't see the right name in the "name" field of the discovered device. I tried using an iPhone app and it finds the correct name.

@DavidYauUGA
Copy link
Author

  • bleak version: 0.4.3
  • Python version: 3.7.4
  • Operating System: Win 10

I was about to open a similar issue:
Even if a set a name on the BLE server (on a ESP32 module), I can't see the right name in the "name" field of the discovered device. I tried using an iPhone app and it finds the correct name.

I got the same thing except when I use the discover_service.py it did find the right name in a really weird area, therefore i am not sure where is the issue. Maybe it's when I set up the name for my Bluetooth. I use the wrong variable or maybe bleak just does not have the ability to read the correct name?

@hbldh hbldh self-assigned this Jul 30, 2019
@hbldh hbldh added the Backend: pythonnet Issues or PRs relating to the .NET/pythonnet backend label Jul 30, 2019
@hbldh
Copy link
Owner

hbldh commented Jul 30, 2019

During the discover phase, not all information available on a device is presented. To receive the information from the device one has to connect to it; something Bleak does not do during discovery and it is operation which I have no intention of adding there either.

What your iPhone does in its API has no bearing on how Windows does it in its API, so there is no guarantee that bleak using the Windows UWP Bluetooth API will return the same information.

See #73 for more information as well.

hbldh added a commit that referenced this issue Aug 2, 2019
macOS support added (thanks to @kevincar)
Merged #80: macOS development
Merged #90 which fixed #89: Leaking callbacks in BlueZ
Merged #92 which fixed #91, Prevent leaking of DBus connections on discovery
Merged #96: Regex patterns
Merged #86 which fixed #83 and #82
Recovered old .NET discovery method to try for #95
@hbldh
Copy link
Owner

hbldh commented Aug 2, 2019

@DavidYauUGA @arasan90 In the version 0.5.0 which has just been release to PyPI, there is a "new" method to use for discovery:

from bleak.backends.dotnet.discovery import discover_by_enumeration

Use it the same as the from bleak import discover. It might see more names of your devices, but there is no guarantee.

It is the old method I had in versions <0.3.0. It uses older Windows namespaces and does not reveal Service UUIDs and manufacturer data, but I remember it as better at extracting names of devices. Give it a try.

@DavidYauUGA
Copy link
Author

@DavidYauUGA @arasan90 In the version 0.5.0 which has just been release to PyPI, there is a "new" method to use for discovery:

from bleak.backends.dotnet.discovery import discover_by_enumeration

Use it the same as the from bleak import discover. It might see more names of your devices, but there is no guarantee.

It is the old method I had in versions <0.3.0. It uses older Windows namespaces and does not reveal Service UUIDs and manufacturer data, but I remember it as better at extracting names of devices. Give it a try.

Let me try that one first. Thanks anyway !!!

hbldh added a commit that referenced this issue Sep 7, 2019
May improve #95 on Windows.

Merge branch 'andrewleech-scan_responses' into develop
@hbldh hbldh closed this as completed in #99 Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: pythonnet Issues or PRs relating to the .NET/pythonnet backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants