Skip to content

Commit

Permalink
Add back mtu and retries capabilities for android
Browse files Browse the repository at this point in the history
  • Loading branch information
manualexSP committed Jun 28, 2023
1 parent bbcbadd commit 4ffc30e
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public void startDFU(String address, String name, String filePath, int packetRec
starter.setPacketsReceiptNotificationsValue(packetReceiptNotificationParameter);
} else {
starter.setPacketsReceiptNotificationsValue(1);
starter.setPacketsReceiptNotificationsEnabled(false);
}
starter.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true);
if (filePath.endsWith(".bin") || filePath.endsWith(".hex")) {
Expand Down

8 comments on commit 4ffc30e

@cn-johndpope
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Manual,

I'm keen to use this library - can you try to use example?

cd example/
yarn

For me it blows up with

Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "iOSDFULibrary":
  In snapshot (Podfile.lock):
    iOSDFULibrary (= 4.4.1, ~> 4.4.0)

  In Podfile:
    react-native-nordic-dfu (from `../../`) was resolved to 3.3.0, which depends on
      iOSDFULibrary (~> 4.13.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `iOSDFULibrary` inside your development pod `react-native-nordic-dfu`.
   You should run `pod update iOSDFULibrary` to apply changes you've made.

[!] CocoaPods could not find compatible versions for pod "React-Core":
  In Podfile:
    react-native-nordic-dfu (from `../../`) was resolved to 3.3.0, which depends on
      React-Core

Specs satisfying the `React-Core` dependency were found, but they required a higher minimum deployment target.

@manualexSP
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cn-johndpope Hi, unfortunately, the example folder wasn't been updated for a long time and I don't expect the example to work. If you want to try it, you should add it to your project. We do not plan to update the example folder too soon. Keep in mind that this is a fork and we do as much as we can. If you want to help feel free to open a PR and update the example folder. Sorry.

@cn-johndpope
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @manualexSP - my (painful) experience upgrading react-native tells me - we should chuck this example in the bin - and create fresh react-native 72.1 project.
can salvage a few files. I have ios now building on my own project - compiling fine for ios. the updates on the readme have helped. But we should definitely delete example.

stepping back from this specific project - I arrived here because I'm looking to use react with nordic-ble - and they pointed me here.
but this seems very specific to flashing the firmware. Did you use react + nordic ble together? is there code in these repos that can allow / faciliate GAT communication?
or is that a separate project? Bit lost. I actually don't have hardware so well - I'm completely in the dark at the moment.

@AshlandWest
Copy link

@AshlandWest AshlandWest commented on 4ffc30e Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cn-johndpope I have also had issues getting this library to work, as far back as RN 69. I think the issues I was experiencing were related to expo, even though I pre-built. It seems like Facebook is moving away from Expo now, which gives me high hopes. Unfortunately, debugging is busted on React-Native 72 at the moment, so it will be hard to test this right now. The PR from the commit referenced in that thread was not approved but hopefully this one will be.

If I get it running in my project, I might take a stab at updating the example project as well.

On another note, @manualexSP, could we turn on Issues for this repo? Reporting problems is difficult without it and, although it is a fork, the original repo now directs people here.

@manualexSP
Copy link
Author

@manualexSP manualexSP commented on 4ffc30e Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cn-johndpope So we are using this fork on a real project that has been live for about 2-3 years. The project is built on an older version of react-native 0.63.5 so we didn't have too many problems because we are running on older architecture.
And the reason why we created this fork is because we need it for the project.
And the reason why I started updating this library again is that we have some possible new projects with ble devices.
So our availability on this repo is based on how important a fix is for our projects.

In terms of testing so far, I tested:

  • If this fork is still working on the older project
  • If I can link this fork to a new react-native (0.71.8) project
  • I did not test how this fork actually works on a new project

In terms of what this library can do, this library can only update the firmware. So to connect to a device in DFU mode, you will have to use another package, ble-manager or ble-plx. But the ble-plx is not maintained anymore :( so the ble-manager is a better option

@AshlandWest, I added the issue tab :D

So that being said, I might consider updating the example since I have a ble device and I have a few examples and also make sure that the flow remains the same on new projects.

@manualexSP
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR with a new project and with the nordic-dfu setup. I tested on ios and android. All good. coming back later with the example too.

@manualexSP
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AshlandWest & @cn-johndpope #7
Done. So this is a very basic example. Now I'm expecting that the download file flow to not be exactly the same for everyone or the connect to device flow. But feel free to update the code and test your solutions.
At least now I'm confident that this fork works on newer versions of react native too.

@manualexSP
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also @AshlandWest install Flipper if you want to debug :D and you can't on the news versions of RN

Please sign in to comment.