unable to connect metawear C with some Android mobiles

Hi
We have an app that connects metawear C with android mobile. We began the pilot with 10 sensors and 10 terminals. Only 3 sensors connected to the corresponding mobile.
The others have fault , 3 of them weren't recognised by the BLE, they were'n't listed, the others restarted frequently.
I have been searching in this community and I found that the frequency and interval is important for that incidence. We adjusted the frequency but not the interval .
ok my question: Is it important to adjust the interval for connecting the terminal to the sensor? I don't know what android version the users had.
Can anyone help me please?

Comments

  • You'll need to provide more information:

    • What is the model and OS of the Android devices that can connect with the boards?

      • What about the devices that can't connect?
    • What code are you running on the boards once they are connected?

    • Are you using fresh batteries?
    • Are the boards running the latest firmware (v1.3.6 at the time of this post)?
    • Can you scan and connect to the devices when using another BLE app, such as the nRF Connect app?
  • i collect this information and send you again. thank you

  • Hi,
    model Android devices and OS:
    Samsung Galaxy J3 (2016) SM-J320F, Android V5
    Galaxy s5 neo, Android V6.0
    Wolder Wian 65 Android V5.1.1 or 6
    Batteries ok
    Metawear update firmaware v.1.3.6
    nRF connect it found Metawear

    Code running when are connected
    public Task actuallyConnectMetawear()
    {
    updateSensorStatus(SensorStatus.CONNECTING);

       connectionAttempts++;
    
       return board.connectAsync().continueWithTask(new Continuation<Void, Task<Void>>() {
      @Override
      public Task<Void> then(Task<Void> task) throws Exception {
         if (task.isFaulted()) {
            Log.i("WalkAtWork", "Failed:"+task.getError());
         } else {
            Log.i("WalkAtWork", "Connected");
                   connectionAttempts = 0;
            startMetawearStreaming();
         }
         if(connectionAttempts < 10) {
                   return task.isFaulted() || task.isCancelled() ? actuallyConnectMetawear() : task;
               }
               else{
                   connectionAttempts = 0;
            discoverBluetooth();
            return null;
               }
      }
    

    });
    }

    thank you

    • Which one of those devices fails to connect / discover the board?
    • What does startMetawearStreaming do?
    • Are you resetting the boards before stopping the app?
    1. all of this devices fails connect / discover the board. All
    2. code startMetamwearStreaming:
      **_public void startMetawearStreaming()
      {
      board.readDeviceInformationAsync()
      .continueWith(new Continuation<DeviceInformation, Void>() {
      @Override
      public Void then(Task task) throws Exception {
      Log.i("WalkAtWork", "Device Information: " + task.getResult());
      updateSensorStatus(SensorStatus.CONNECTED);
      return null;
      }
      });

      accBmi160 = board.getModule(AccelerometerBmi160.class);

      accBmi160.stepDetector().configure()
      .mode(AccelerometerBmi160.StepDetectorMode.SENSITIVE)
      .commit();

      accBmi160.stepDetector().addRouteAsync(new RouteBuilder() {
      @Override
      public void configure(RouteComponent source) {
      source.stream(new Subscriber() {
      @Override
      public void apply(Data data, Object... env) {
      if(status==Status.WALK || status==Status.STAND){
      status = Status.WALK;
      sitCounter = 0;
      standCounter = 0;
      Log.i("WalkAtWork", "Walking");
      }
      }
      });
      }
      }).continueWith(new Continuation<Route, Void>() {
      @Override
      public Void then(Task task) throws Exception {
      accBmi160.stepDetector().start();
      accBmi160.start();
      return null;
      }
      });

      accelerometer= board.getModule(Accelerometer.class);
      accelerometer.configure()
      .odr(12.5f) // Set sampling frequency to 25Hz, or closest valid ODR
      .range(4f) // Set data range to +/-4g, or closet valid range
      .commit();
      accelerometer.acceleration().addRouteAsync(new RouteBuilder() {
      @Override
      public void configure(RouteComponent source) {
      source.stream(new Subscriber() {
      @Override
      public void apply(Data data, Object... env) {

             connectionTimeout.set(0);
      
             float x = data.value(Acceleration.class).x();
             float y = data.value(Acceleration.class).y();
             float z = data.value(Acceleration.class).z();
      
             double modulo = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2));
             if(Math.abs(z) > 0.8) {
                sitCounter++;
                if(sitCounter > 25){
                   status = Status.SIT;
                   standCounter = 0;
                }
             }else{
                standCounter++;
                if(standCounter > 25){
                   status = Status.STAND;
                   sitCounter = 0;
                }
             }
          }
       });
      

      }
      }).continueWith(new Continuation<Route, Void>() {
      @Override
      public Void then(Task task) throws Exception {
      accelerometer.acceleration().start();
      accelerometer.start();
      return null;
      }
      });
      }

    3. metawear was reset before connect.

    4. nrf launch this error: 133 error while connecting

    thk

  • If all of these devices also fail to connect when using the nRF Connect app, then you'll want to test on another platform, like iOS or Windows 10. It could be the devices you are using have poorly implemented Bluetooth stacks so you should see if the boards work fine on other platforms.

This discussion has been closed.