juliansteenbakker / flutter_ble_peripheral

A Flutter package for advertising BLE data in peripheral mode
BSD 3-Clause "New" or "Revised" License
72 stars 50 forks source link

General question: What devices were used for testing? #149

Open amasuke55 opened 1 year ago

amasuke55 commented 1 year ago

Hello,

I am currently trying to use flutter_ble_peripheral with two devices: Samsung A72 and S20. both can not seem to advertise data despite other apps like LightBlue stating that the phones should have that BLE feature. No other app worked for testing, so I tried to use this but it also just does not advertise the data. I have a feeling it might be the Samsung devices so it would be helpful to know what devices were used to test flutter_ble_peripheral.

microgeniusz80 commented 1 year ago

I/BluetoothLeAdvertiser(15672): startAdvertising is called I/BluetoothAdapter(15672): isLeEnabled(): ON I/BluetoothLeAdvertiser(15672): startAdvertisingSet, calling package name = dev.steenbakker.flutter_ble_peripheral_example I/BluetoothAdapter(15672): isLeEnabled(): ON I/FlutterBlePeripheral(15672): onStartSuccess() mode: 2, txPOWER 1 I/BLE Peripheral state (15672): advertising I/BluetoothLeAdvertiser(15672): stopAdvertising is called I/BluetoothLeAdvertiser(15672): stopAdvertisingSet, calling package name = dev.steenbakker.flutter_ble_peripheral_example V/AudioManager(15672): querySoundEffectsEnabled... I/BluetoothLeAdvertiser(15672): stopAdvertising is called

does it appear like this in your debug console? as soon as advertising started, stop advertising is called. tested on both Samsung A52, and Samsung S23 Ultra.... not working

feel free to contact me at ilyas.ukm@gmail.com so that we can discuss this further. thank you.

amasuke55 commented 1 year ago

For me it looks similar - like this when I try to Start advertising with the example code:


4 I/BluetoothAdapter( 9136): STATE_ON

D/BluetoothLeAdvertiser( 9136): onAdvertisingSetStarted(0, -15, 0)

I/FlutterBlePeripheral( 9136): onStartSuccess() mode: 2, txPOWER 1

I/BLE Peripheral state ( 9136): advertising

2 I/BluetoothAdapter( 9136): STATE_ON

D/BluetoothLeAdvertiser( 9136): Stop AdvertingSet

D/BluetoothLeAdvertiser( 9136): onAdvertisingSetStopped(0)```
microgeniusz80 commented 1 year ago

so obviously, something is stopping the advertisement, as soon as advertisement started...

For me it looks similar - like this when I try to Start advertising with the example code:

4 I/BluetoothAdapter( 9136): STATE_ON

D/BluetoothLeAdvertiser( 9136): onAdvertisingSetStarted(0, -15, 0)

I/FlutterBlePeripheral( 9136): onStartSuccess() mode: 2, txPOWER 1

I/BLE Peripheral state ( 9136): advertising

2 I/BluetoothAdapter( 9136): STATE_ON

D/BluetoothLeAdvertiser( 9136): Stop AdvertingSet

D/BluetoothLeAdvertiser( 9136): onAdvertisingSetStopped(0)```
Secret29 commented 9 months ago

I have the same issue!

/BluetoothLeAdvertiser( 5681): Start AdvertisingSet D/BluetoothLeAdvertiser( 5681): onAdvertisingSetStarted(1, -15, 0) I/FlutterBlePeripheral( 5681): onStartSuccess() mode: 2, txPOWER 1 I/BLE Peripheral state ( 5681): advertising I/BluetoothAdapter( 5681): STATE_ON I/BluetoothAdapter( 5681): STATE_ON D/BluetoothLeAdvertiser( 5681): Stop AdvertingSet D/BluetoothLeAdvertiser( 5681): onAdvertisingSetStopped(1)

Secret29 commented 9 months ago

I resolved the issue by setting the timeout to 0. AdvertiseSettings({ this.connectable = false, this.timeout = 0, this.advertiseMode = AdvertiseMode.advertiseModeLowLatency, this.txPowerLevel = AdvertiseTxPower.advertiseTxPowerLow, });