Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 14:20
    stonehippo edited #401
  • Jan 31 2019 14:17
    stonehippo opened #401
  • Jan 29 2019 18:49
    leo-tavares closed #400
  • Jan 29 2019 15:39
    leo-tavares edited #400
  • Jan 29 2019 15:37
    leo-tavares edited #400
  • Jan 29 2019 15:33
    leo-tavares edited #400
  • Jan 29 2019 15:31
    leo-tavares edited #400
  • Jan 29 2019 15:31
    leo-tavares opened #400
  • Jan 28 2019 19:17
    paulreimer closed #398
  • Jan 26 2019 19:05
    bhenav edited #399
  • Jan 26 2019 18:34
    bhenav edited #399
  • Jan 26 2019 18:33
    bhenav edited #399
  • Jan 26 2019 18:32
    bhenav edited #399
  • Jan 26 2019 18:25
    bhenav edited #399
  • Jan 26 2019 18:24
    bhenav edited #399
  • Jan 26 2019 18:21
    bhenav edited #399
  • Jan 26 2019 18:20
    bhenav opened #399
  • Jan 26 2019 00:03
    paulreimer opened #398
  • Jan 25 2019 23:46
    paulreimer opened #397
  • Jan 25 2019 23:20
    ChrisEdson opened #396
Bohdan Pomohaibo
@chocky335
@dariuszseweryn How we can get advertising data? It's required to identify the manufacturer of the device.
https://image.slidesharecdn.com/ibeaconworkshop-april2014-140430015502-phpapp01/95/build-your-own-ibeacon-12-638.jpg
Dariusz Seweryn
@dariuszseweryn
iBeacons are mentioned in the wiki
Simone Bianchin
@powext
Hi folks, after i remove a subscription from a notifications monitoring i always get "BleError: Operation was cancelled" and the device remains unavailable.
Bouvier
@fouv
Hi everyone, I need your help regarding disconnection error. To resume, i have a button to connect device and another one to disconnect it. I use the function manager.cancelDeviceConnection(device) and I have this error "Unable to disconnect from device [BleError: Device B5:36:C0:A4:4E:59 is not connected]". But it seems device is well connected if I check in the app BLE scanner. I don't know what is the pb. Need help ... this is my code export const disconnectFromDevice = async(newDevice) => {
device = newDevice.item.id
console.log('device disconnect',device)
manager.cancelDeviceConnection(device)

.then(() => {
setConnectedDeviceStatus(false)
})
.catch(error => {
console.log('Unable to disconnect from device', error);
})
}
bellow my function connectToDevice
//connect to select device
    const connectToDevice =  async(device) => {
    console.log('ok process ongoing to connectToDevice');
    console.log('device nme',device.name);
    console.log('deviceId',device.id)
    setDeviceId(device.id);

    //check connection state of a device
    /*if(manager.isDeviceConnected(deviceId) === true){
            console.log("cancelling");
               manager.cancelDeviceConnection(deviceId); // deconnexion
     }*/

    //setConnectedDeviceList([]);
    //connexion au device
        device.connect()
          .then((connectedDevice) => {
          console.log('device connected',connectedDevice)

     //Add device to connectedDeviceList
      //   setConnectedDeviceList([...connectedDeviceList, device])
     //processing double
          var newConnectedDevice = true
              //console.log('lenght device', deviceList.length)
                       for( let connectDevice of connectedDeviceList ) {
                          if( connectDevice.id === connectedDevice.id ) {
                          //console.log('connect device id',connectDevice.id)
                          //console.log('connected device id',connectedDevice.id)
                          //console.log("ok same devices")
                             newConnectedDevice = false
                             break;
                         } else {
                         console.log('break ?')
                         }
                      }
                      if( newConnectedDevice === true ) {
                      //console.log('device news')
                      setConnectedDeviceList([...connectedDeviceList, device])
                       }

          setConnectedDeviceName(device.name);
          setConnectedDeviceStatus(true);
          setConnectedDevice(device);

        //check deconnection
         //listenerDeviceDisconnect(deviceId);
         //store in AsyncStorage deviceId
         //storeDeviceConnected(device.id)
         //console.log('connectedDevice',connectedDevice)

         console.log('Discovering services and characteristics');
         device.discoverAllServicesAndCharacteristics()
         .then(device=>{ console.log('device discover',device.name)})
         .catch(c=>{console.log('error discover',c)})
         })
         .then((device) => {
         console.log('Setting notifications');
         //const services = device.services();
         })
         .catch(error => {
         if(error) {
         console.log('error connectToDevice',error)
         }
          })
        }
Stéphane Juban
@StephaneJuban

Hi !

Recently I have some iOS phone that failed to keep the connection active. I can connect to my device, but after some delay (it looks like every time, 30s after connecting), it gets automatically disconnected.
When I check with onDeviceDisconnected I have no error.

Any idea why ?

Prateek Sharma
@Sharma1220_twitter
Hi guys, I am using React-Native-Ble-Plx lib. I am always getting this error [BleError: Operation was cancelled] on manager.connectToDevice(device id) in iOS. it is working fine for Android. But somehow it is not working on iOS now. It was working on both platforms earlier.
Is anybody have an idea to solve this issue?
Datagrdn
@Datagrdn
Hello everyone, finally got my hands on a Samsung Galaxy to troubleshoot. All our customers with various models of this phone say they are unable to connect to our device. I'm not seeing any errors in the logs but it is not discovering my device. Does anyone know of why a Galaxy might be different from other Android devices? Thanks so much!
Datagrdn
@Datagrdn
Interesting, getting inconsistent results. Now I can discover devices but when I connect it immediately disconnections with 2021-02-18 22:45:41.863 18865-20061/com.datagarden.plantwaveandroid W/ReactNativeJS: Possible Unhandled Promise Rejection (id: 0): BleError: Characteristic 6e400002-b5a3-f393-e0a9-e50e24dcca9e write failed for device FC:F5:C4:08:98:6A and service 6e400001-b5a3-f393-e0a9-e50e24dcca9
unless I manually send a message to the peripheral via the app. Again this is the exact setup that works on Pixel and other Android devices
It seems like RxBLE doesn't get consistent access to the native Bluetooth functions
Datagrdn
@Datagrdn
Ah got this right before the above error now
2021-02-18 23:17:19.443 28788-30924/com.datagarden.plantwaveandroid W/RxBle#ConnectionOperationQueue: Queue's awaitRelease() has been interrupted abruptly while it wasn't released by the release() method.
    java.lang.InterruptedException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:442)
        at java.lang.Object.wait(Object.java:568)
        at com.polidea.rxandroidble.internal.serialization.QueueSemaphore.awaitRelease(QueueSemaphore.java:15)
        at com.polidea.rxandroidble.internal.serialization.ConnectionOperationQueueImpl$1.run(ConnectionOperationQueueImpl.java:73)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2021-02-18 23:17:19.597 28788-28788/com.datagarden.plantwaveandroid E/ViewRootImpl: sendUserActionEvent() mView returned.
Stéphane Juban
@StephaneJuban
Is this library still supported ? I am wondering since Polidea was acquired by snowflake
1 reply
Lucas Ramage
@lramage94_gitlab
2021-02-17 10:13:14.105 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 106  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B00-0000-1000-8000-00805f9b34fb): Error BleError: Characteristic 00002b00-0000-1000-8000-00805f9b34fb read failed for device 08:7C:BE:7F:1A:1F and service 0000181c-0000-1000-8000-00805f9b34fb
2021-02-17 10:13:14.111 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 107  BleError: Characteristic 00002b00-0000-1000-8000-00805f9b34fb read failed for device 08:7C:BE:7F:1A:1F and service 0000181c-0000-1000-8000-00805f9b34fb
2021-02-17 10:13:14.118 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 108  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B03-0000-1000-8000-00805f9b34fb): Error BleError: Device 08:7C:BE:7F:1A:1F is not connected
2021-02-17 10:13:14.119 -0500 EST warning RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 109  connection error: Device 08:7C:BE:7F:1A:1F is not connected, retry: 2
2021-02-17 10:13:14.131 -0500 EST warning RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 110  BleError: Device 08:7C:BE:7F:1A:1F is not connected
2021-02-17 10:13:16.405 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 122  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B00-0000-1000-8000-00805f9b34fb): Error BleError: Device 08:7C:BE:7F:1A:1F was disconnected
2021-02-17 10:13:19.725 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 133  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B00-0000-1000-8000-00805f9b34fb): Error BleError: Characteristic 00002b00-0000-1000-8000-00805f9b34fb read failed for device 08:7C:BE:7F:1A:1F and service 0000181c-0000-1000-8000-00805f9b34fb
2021-02-17 10:13:19.726 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 134  BleError: Characteristic 00002b00-0000-1000-8000-00805f9b34fb read failed for device 08:7C:BE:7F:1A:1F and service 0000181c-0000-1000-8000-00805f9b34fb
2021-02-17 10:13:19.733 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 135  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B03-0000-1000-8000-00805f9b34fb): Error BleError: Device 08:7C:BE:7F:1A:1F is not connected
2021-02-17 10:13:19.734 -0500 EST warning RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 136  connection error: Device 08:7C:BE:7F:1A:1F is not connected, retry: 2
2021-02-17 10:13:19.746 -0500 EST warning RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 137  BleError: Device 08:7C:BE:7F:1A:1F is not connected
2021-02-17 10:13:25.184 -0500 EST error RN Method.java:-2 java.lang.reflect.Method.invoke 20681_46fa990f-2e9b-5bc0-9823-5cbbdb28e927 4.15.15 1024605174 en 10 245213 159  Error while reading characteristic (service: 0000181c-0000-1000-8000-00805f9b34fb, characteristic: 00002B00-0000-1000-8000-00805f9b34fb): Error BleError: Characteristic 00002b00-0000-1000-8000-00805f9b34fb read failed for device 08:7C:BE:7F:1A:1F and service 0000181c-0000-1000-8000-00805f9b34fb
2021-02-17 10:13
4 replies
Tuanpm31
@Tuanpm31
anyone have an example of multiple connections? Thanks for helping
6 replies
spkteam
@spkteam
Hi everyone, I was trying to read the manufacturerData from my BLE device and it comes encoded. I looked up the documentation and see that the value is base64 encoded.
But when I decode it back, I get an entirely different string.
https://polidea.github.io/react-native-ble-plx/#devicemanufacturerdata
10 replies
Is there a specific method to parse it?
Bouvier
@fouv
Hi,
Bouvier
@fouv
I need to recover an acknowledgment in my function writeCharacteristicWithResponseForDevice..I use a promise in my function but as it is resolved, i see that my code continues to execute instead of waiting for the acknowledgment. How can I do to resolve this pb ?
2 replies
Semih Aydıntepe
@semihaydintepe
Hi everyone. We are developing a Bluetooth thermometer application. react-native-ble-plx library scannes every 10 seconds and connects to the thermometer with a 128 bit service uuid. As long as the thermometer is not disconnected, IOS continues to receive data in the background. If the thermometer connection is disconnected while the ios application is in the background, the thermometer can be connected again within 4 minutes. After 4 minutes, there is no connection again. Can you help with this situation?
4 replies
Maxcravo
@Maxcravo
I new user of this library, i need to configurate the IOS and android for the library proprerly work, even if i only want to test in android ? sorry if its a silly question.
1 reply
Spixz
@Spixz7_twitter
Hello everyone. I'm trying to enable notifications for one of my characteristic. I tried to write the CCCD but I could see from much older posts that the library handled the activation of notifications/indications for us through the "monitorCharacteristicForService" method. After trying it out, my CCCD value was set to 2 ([1, 0]). I would like to enable notifications rather than indications. If indication was chosen automatically, does that mean that the notifications "mode" is not available for this characteristic ? If not, how can I switch from indication to notification without writing to the CCCD (this method does not work). Thank you and have a nice day :)
1 reply
Bouvier
@fouv
Hi, I have an issue when I want to update the firmware from my phone to a card by BLE .I use function writeCharacteristicWithResponseForDevice() to send part of the binary file . At the beginning, response is ok but after 10 or 15mn, i have the error BleError : operation was cancelled. and then device is disconnected ! i don't understand what happening ?
1 reply
balazsdev
@mblasee

Hi All,
I am writing an application where I am firing notifications on a characteristic at every 25ms. I am successfully reading them in my app for a while when suddenly I am getting the following error:

Warning: Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code: {"3067":{"module":"BleClientManager","method":"monitorCharacteristicForDevice"},"20750":{"module":"BleClientManager","method":"readCharacteristic"},"20767":{},"20793":{"module":"BleClientManager","method":"readCharacteristic"},"20799":{"module":"BleClientManager","method":"readCharacteristic"},"20826":{"module":"BleClientManager","method":"readCharacteristic"},"20848":{"module":"BleClientManager","method":"readCharacteristic"},"20859":{},"20875":{"module":"BleClientManager","method":"readCharacteristic"},"....... and this goes on.

I guess I am firing up events faster than react is capable of handling them.

Do you guys see any errors in my code? Or is it fine and my options are to switch to native or decrease the notification frequency?

device.monitorCharacteristicForService(service, characteristic, (error, characteristic) => {
    if (error) {
        console.log(`registerNotifyReadCallback; error ${error}`);
        return;
    }
    const value = characteristic?.read().then(data => {
        console.log("value")
        const decodedResponse = base64.decode(data.value);
        console.log(decodedResponse)
        callback(decodedResponse);
    });
});

callback in this case is just simply a set method of a hook state
(const [remoteVal, setRemoteVal] = useState<string>("");)

5 replies
Ezran Bayantemur
@ezranbayantemur
Hi there everyone. I wanna contribute the documentation about background job on Android. But I couldn't find to send PR to wiki page. Anyone know how to do it?
2 replies
Jorge Rodriguez
@rodri0315
I'm trying to follow the documentation to setup a simulated device but I keep getting this error message.
Unhandled promise rejection TypeError: blemulatorModule.simulate is not a function
timmywilmot24
@timmywilmot24
Hello everyone. Is anyone having the issue when trying to import the BleManager() and getting the error: Invariant Violation: new NativeEventEmitter requires non-null argument
Vinicius Fiedler
@vfiedlerc
Hello everyone, did someone have a example of this code in react native? im facing some problems to create a RN layout based on this doc.
@shakogele can i see the repo of this?
cuongdo926
@cuongdo926
Is there any worked example of this lib with expo bare workflow? I tried to use this lib with expo bare in android, follow and double-check every step in the document but end up with an exception null is not an object (evaluating 'bleManager.start')
williamgoodhew
@williamgoodhew
Has anyone had any luck getting this library working with Android 12?
Siân McNeill
@smcneill-phlsci
Hi everyone. I’m having trouble getting the scan response on Android. Anyone seen this happening and know what’s going on?
Kaine
@scope2229
Hi, I'm trying to create a PR to add a method called pairedDevices. I'm getting an error with starting the application to test the pr. error: cannot find symbol bleAdapter.getBondedDevices( It looks like getBondedDevices is available in the blaAdapter

BleClientManager

@ReactMethod
    public void pairedDevices(final Promise promise) {
        bleAdapter.getBondedDevices(
            new OnSuccessCallback<Device[]>() {
                @Override
                public void onSuccess(Device[] data) {
                    WritableArray jsDevices = Arguments.createArray();
                    for (Device device : data) {
                        jsDevices.pushMap(deviceConverter.toJSObject(device));
                    }
                    promise.resolve(jsDevices);
                }
            }, new OnErrorCallback() {
                @Override
                public void onError(BleError error) {
                    promise.reject(null, errorConverter.toJs(error));
                }
            });
    }

BleManager.js

/**
   * Returns a list of paired devices.
   * @returns {Promise < Array < Device >>} List of paired devices.
                                    */
                                    async pairedDevices(): Promise<Array<Device>> {
    const nativeDevices = await this._callPromise(BleModule.pairedDevices())
    return nativeDevices.map((nativeDevice: NativeDevice) => {
      return new Device(nativeDevice, this)
    })
  }

BleModule

/**
   * Returns a list of paired peripherals by their identifiers.
   * @returns {Promise<Array<NativeDevice>>} List of paired devices.
   * @private
   */
  pairedDevices(): Promise<Array<NativeDevice>>;
Walaa Mohtaseb
@walaamedhat
Hi, I want to built react native app and connect with raspberry pi through react-native-ble-plx to send some commands to run.
but when I start Device Scan I cant find raspberry uuid/ name/ id
Any advices how I can doing that?
missaconstant
@missaconstant
Hi
Am using react-native-ble but am not able to connect barcode scanner and printer to my app.
After scanning and connect to one of devices, either printer or scanner, am not able to scan anymore and even when i try to connect the second one, it fails.
Can you help me ?
Hélio Guilherme
@HelioGuilherme66
Hello all,
I am getting errors on my react-native project for Android (for iOS all OK).
The error is:
Could not determine artifacts for com.github.Polidea:MultiPlatformBleAdapter:b0272c0fae040cc90f790481c54e8f2d45304339: Skipped due to earlier error (2 m 58 s 299 ms)
This is because the build.gradle in react-native-ble-plx module contains:
dependencies {
    implementation "com.facebook.react:react-native:+"
    implementation 'com.github.Polidea:MultiPlatformBleAdapter:b0272c0fae040cc90f790481c54e8f2d45304339'
}
Hélio Guilherme
@HelioGuilherme66
I am now attempting to build with the change to:
implementation 'com.github.dotintent:MultiPlatformBleAdapter:0.1.19'
Can anyone help me on this?
Hélio Guilherme
@HelioGuilherme66
Found an .aar with:
implementation 'com.github.dotintent:MultiPlatformBleAdapter:1.0.0-beta'
robal14
@robal14
Hello,
Does react-native-ble-plx support bluetooth 5.0 extended advertising ?
I'm trying to make an application that scans for a beacon that's sending both legacy and extended ble frames, but as of now im only getting the legacy one. I found an example of simillar application written in java that's uising a BluetoothDevice.PHY_LE_CODED statement in order to read the extended frame, but i can't find any mention of managing PHY layers in this library.
Any help will be much appreciated.
alan
@bsdemonio_twitter
Hello , I'm trying to disconnect a bluetooth device which as connected in a proper way and even send data to the device with no issues. but I'm not able to disconnect from the device in iOS .. In fact in Android visually it seems like the device is not connected but it does work.. but the disconnect method is not working at all and I'm constantly getting this error
3 replies
quy1403
@quy1403
hello
I face this issue when trying to monitor characterlistic: [BleError: Characteristic 000036f5-0000-1000-8000-00805f9b34fb notify change failed for device 2D6F5FBC-ACE7-7AB1-48C5-0D78465DA777 and service 0000fee7-0000-1000-8000-00805f9b34fb] null
please help
KingOfTNT10
@KingOfTNT10
Hi there! I'm having a problem. When I try to write data to the device it gives me the following exception: "Operation was rejected". I there something wrong with the device? (If you need me to give you more info let me know!)