chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
791 stars 479 forks source link

[Help]: Unstable connection #882

Closed smithFlutter closed 6 months ago

smithFlutter commented 6 months ago

Requirements

Have you checked this problem on the example app?

No

FlutterBluePlus Version

1.31.14

Flutter Version

3.7.12

What OS?

All

OS Version

IOS 16.7

Bluetooth Module

unknown

What is your problem?

Hello everyone, when connecting the device, after the scanner, it takes a long time or it is random for it to work. Or if I use Auto connect it never stays in the connected state, I have tried everything but it is still unstable, has this happened to anyone?

await device.connectAndUpdateStream(); It works randomly

await device.connect(autoConnect: true, mtu: null); It doesn't stay connected, if I add a delay sometimes yes.

Logs

No log.
chipweinberger commented 6 months ago

FBP cannot control the connection quality. This is controlled by system bluetooth driver, wireless quality, etc.

without logs, I don't even know what you are talking about really.

you can look at the device.disconnectReason

smithFlutter commented 6 months ago

Thanks for your response, the problem is that it runs immediately and remains disconnected

await device.connect(autoConnect: true, mtu: null, timeout: Duration(seconds: 90));

The connection code is in Main.dart. Sometimes it works well and sometimes it doesn't, how can I send the log?

chipweinberger commented 6 months ago

read the README about autoconnect....

this is explained in multiple places.

smithFlutter commented 6 months ago

Thanks for the help, I will look for that README to be able to solve my problem, something so simple has been so complicated and delayed.

smithFlutter commented 6 months ago

I have not been able to solve the problem, I read the readme but it does not help me much, I will evaluate changing the component, I have been doing this for a long time and it should be simple. Thanks for the help.