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

Getting every time DFU DEVICE DISCONNECTED error #128

Open
leelaprasadsahu22 opened this issue Mar 4, 2021 · 3 comments
Open

Getting every time DFU DEVICE DISCONNECTED error #128

leelaprasadsahu22 opened this issue Mar 4, 2021 · 3 comments

Comments

@leelaprasadsahu22
Copy link

Getting every time DFU DEVICE DISCONNECTED error 10-20 seconds after calling NordicDFU.startDFU function.
Not getting only state Failed
DFUEmitter.addListener("DFUStateChanged", (state) => {
console.log("DFU State:", state);
})

@AshirbadGudu
Copy link

I'm also Getting Same Error

Here I'm showing one video what is the exact issue so that everyone can check

DFUErrorVideo.mp4

Explaining my code step wise

Step-1: Enable Bluetooth Connection via BleManager
  const enableBluetooth = () => {
    BleManager.enableBluetooth()
      .then(() => {     
        Alert.alert('Success', 'Bluetooth enabled successfully');
      })
      .catch((error) => {
        console.log(error);
      });
  }
Step-2: Connect with sensor by its mac ID via BleManager
const connectWithSensor = () => {
    BleManager.connect(sensorMacId)
        .then(() => {          
          Alert.alert('Success', 'Sensor Connected Successfully');
        })
        .catch((error) => {
          console.log(error);
        });
  }
Step-3: Select Firmware File and Strat DFU process
const sendFileFromYourDevice = async () => {
    try {
      const firmwareFile = await DocumentPicker.pick({
        type: DocumentPicker.types.zip,
      });
      const destination = RNFS.CachesDirectoryPath + '/firmwareFile.zip';
      await RNFS.copyFile(firmwareFile.uri, destination);
      NordicDFU.startDFU({deviceAddress: sensorMacId, filePath: destination});
    } catch (error) {
      console.log(error);
    }
  }

Please Share Any Solution If Any One Has

@xanderdeseyn
Copy link

Did you find any solution to this? We are seeing the same thing.

@JoeRippee
Copy link

I was hitting this issue, and a co-worker helped me find that the issue was advertising/connection interval differences.

The firmware I had running had a different advertising/connection interval than the boot loader. The react-native-nordic-dfu would connect to my device successfully, and then put the device into boot loader mode. It would then try to connect, and fail (likely due to BLE advertising/connection setting differences).

After modifying my firmware's BLE advertising/connection intervals to match the boot loader's, I have had no issues.

It is worth pointing out that the Pixel 2 had no issue DFUing, however the Pixel 7 would not work (until applying the fix above).

It is also worth pointing out that this solve should only apply if you are able to put the device into boot loader mode, but then get the "DFU DEVICE DISCONNECTED" error.

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

4 participants