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

Connecting directly to known peripheral under Python #306

Open
ullix opened this issue May 11, 2024 · 4 comments
Open

Connecting directly to known peripheral under Python #306

ullix opened this issue May 11, 2024 · 4 comments

Comments

@ullix
Copy link

ullix commented May 11, 2024

I do know the adapter, I have, and from my peripheral I do know both identifier and address. Is there a way do connect to it directly without having to go via get_adapters and scan_get_results?

@eriklins
Copy link
Contributor

Cannot comment on get_adapters, but it’s not possible to connect to a peripheral without prior scanning. A BLE advert is considered the invitation for engaging a connection. Without the central does not know about the peripheral and open time slots for connecting.

@ullix
Copy link
Author

ullix commented May 12, 2024

Well, I do not really know how others are doing it, but at least in these 2 cases the address suffices (plus perhaps the relevant *UUID):
sercona/Owon-Multimeters#4 (comment)
sercona/Owon-Multimeters#4 (comment)

@eriklins
Copy link
Contributor

eriklins commented May 12, 2024

Then the advert scanning is done somehow/somewhere automagically in lower code layers there. This is not a limitation of SimpleBLE but it's how BLE works and how it has been defined in the BT/BLE spec.

@ullix
Copy link
Author

ullix commented May 12, 2024

When I run stand-alone code based on your simplepyble notify example, it runs well and fast for hours on end with no issues.

However, when I put this (rather simple) code into my "big code", it lasts for only 1 ... 100 sec before it crashes with a Segmentation fault!

The big code uses PyQt5, often the culprit for SegFaults. Any suggestion what to look for? There is no PyQt5 stuff in the part of the simplepyble code.

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

No branches or pull requests

2 participants