-
Notifications
You must be signed in to change notification settings - Fork 121
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
Could not find device with deviceAddress [3.2.1] #160
Comments
I guess the error comes from here: https://github.com/Pilloxa/react-native-nordic-dfu/blob/master/ios/RNNordicDfu.m#L210 |
OK, this is probably a duplicate of: #121 (I am also using react-native-ble-plx ) |
To save people from having to follow various links and collate the information, here is the solution that works for me when using react-native-ble-plx... 1. Your AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
[RNNordicDfu setCentralManagerGetter:^() {
return [[CBCentralManager alloc] initWithDelegate:nil queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)];
}];
[RNNordicDfu setOnDFUComplete:^() {
}];
[RNNordicDfu setOnDFUError:^() {
}];
// ...
} Originally from here 2. Inside the react-native-nordic-dfu folder in node_modules - RNNordicDfu.m At line 200 or underneath the line: [NSThread sleepForTimeInterval: 2]; Originally from here Now everything works as expected. Apologies for duplicating this information but it took me 15mins to bring various bits from other issue comments together, hopefully this saves someone that time. Finally, here is the patch I generated to apply this on install using patch-package: diff --git a/node_modules/react-native-nordic-dfu/ios/RNNordicDfu.m b/node_modules/react-native-nordic-dfu/ios/RNNordicDfu.m
index ed58530..4c8b4a7 100644
--- a/node_modules/react-native-nordic-dfu/ios/RNNordicDfu.m
+++ b/node_modules/react-native-nordic-dfu/ios/RNNordicDfu.m
@@ -197,6 +197,7 @@ - (void)logWith:(enum LogLevel)level message:(NSString * _Nonnull)message
reject(@"nil_central_manager_getter", @"Attempted to start DFU without central manager getter", nil);
} else {
CBCentralManager * centralManager = getCentralManager();
+ [NSThread sleepForTimeInterval: 2];
if (!centralManager) {
reject(@"nil_central_manager", @"Call to getCentralManager returned nil", nil); |
OK, but there is a reason why this patch is not applied directly to the code? |
Yes, this should be a Pull Request or be added to the library |
@marcopiraccini Did you get around to preparing the PR? |
@marcopiraccini, I'm using the "react-native-ble-plx" too, but I don't know what parts are zip made of. Could you please put a zip file of yours here?
|
The zip file should be your firmware code compiled by Arduino or Platform.io with the upload_protocol in nrfutil |
I am having this issue when I
startDFU
on iOS (on Android it works).I already checked and the
deviceAddress
is the UUID of the device (at it should be).Any idea?
The text was updated successfully, but these errors were encountered: