Android-Bridge-App icon indicating copy to clipboard operation
Android-Bridge-App copied to clipboard

Can't get this app to work

Open MathiasHaudgaard opened this issue 6 years ago • 15 comments

I'm calling the method DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP("192.168.1.126"); in the sdk app but there's no connection. I followed the guide in the readme. I'm not quite sure what to do now. Can anyone help me out?

MathiasHaudgaard avatar Apr 19 '18 09:04 MathiasHaudgaard

I'm experiencing similar issue. I'm able to connect to the Bridge app (connection indicator turns green) but my app with SDK is not connected to the drone at all.

Second issue: Bridge app show wrong IP address, I had to use IP address from device status.

dostalleos avatar May 01 '18 11:05 dostalleos

@MathiasHaudgaard @dostalleos Do you have more information on what version and platform of the DJI SDK you were using?

alainpimentel avatar May 20 '18 22:05 alainpimentel

I'm using the dji-uxsdk:4-5. @dostalleos If you're just interested in getting the log out of your app you can use the program adb.exe that android provides if you're using windows. This program lets you connect remotely to your phone so you can run the and debug your app as usual. I used this program instead of this app. The following link provides a more detailed description of adb https://developer.android.com/studio/command-line/adb

MathiasHaudgaard avatar May 23 '18 11:05 MathiasHaudgaard

@MathiasHaudgaard I'm trying to figure out the issue but so far it has worked in my tests. I've been testing with version 1.2.4 of the bridge app and dji-uxsdk 4.5. Are you using version 1.2.4? If so have you tried using the previous version? It would help point to where the bug is. Thanks!

alainpimentel avatar May 30 '18 22:05 alainpimentel

I am having the same issue. My bridge app is working correctly(both indicators turn green). But my second device was not able to connect to the aircraft(I assume startConnnectionToProduct() in DJISDKManager is not working). I am running GSDemo (SDK version 4.5.1) and bridge app version is 1.2.4.

flyboyhoward avatar Aug 24 '18 11:08 flyboyhoward

@flyboyhoward I've updated the documentation of this repo, so make sure you are calling DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP() in the right place, that is after the SDK registers. If you are still having issues, does it work if you use your application without the bridge app?

alainpimentel avatar Aug 27 '18 17:08 alainpimentel

I'm having similar experience as @flyboyhoward

image

Both indicators on the bridge app show green, but the device running the app cannot connect to device.

michaelsheets88 avatar Sep 23 '18 15:09 michaelsheets88

Hello, I'm having similar experience as @flyboyhoward. The top left and top right of the bridge app are green, but the Demo of the DJI-SDK shows that the device cannot be connected, and there is no preview image. The DJI SDK is 4.7.1, Android Studio is 3.0, and Android devices are xiaomi 5s and huawei honor V8. The Demo is Mobile-UXSDK-Android-master.

ChangeQSW avatar Oct 11 '18 04:10 ChangeQSW

@hpimentel The task is urgent. I hope you can help me answer it. Thank you very much.

ChangeQSW avatar Oct 11 '18 04:10 ChangeQSW

@hpimentel When using Bridge App, can device 2 be previewed to video?

ChangeQSW avatar Oct 11 '18 06:10 ChangeQSW

Hello, I'm having similar experience as @flyboyhoward. Both indicators on the bridge app show green, but the device running the app cannot connect to drone. public void onRegister(DJIError error) {

            if(error == DJISDKError.REGISTRATION_SUCCESS) {

                Handler handler = new Handler(Looper.getMainLooper());
                handler.post(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(getApplicationContext(), "SDK!", Toast.LENGTH_LONG).show();
                    }
                });

               DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP("192.168.43.1");
               boolean result = DJISDKManager.getInstance().startConnectionToProduct();
               if (result)
                   Toast.makeText(getApplicationContext(),"connected,8888",Toast.LENGTH_LONG).show();


            } 

laomi4569 avatar Dec 29 '18 06:12 laomi4569

Any updates on that? I'm facing the same issue as everyone.

Which DJI Product you are using? Phantom 4 Pro.

Which Android Device and Android System version you are using? Asus Zenfone ZE620KL - Android 9.0

Which Android Studio version you are using? 4.1.1

The bridge app left and right top icons are both green, but no communication with the RC or the aircraft is possible.

@NonNull
@Override
public Either<InitializeApiFailure, Void> initializeApi(
  @NonNull final Context context,
  final boolean showLogs,
  final boolean saveLogs,
  @Nullable final String bridgeAppIp
) throws InterruptedException {
  UavApiPlugin.setMustLog(showLogs);
  UavApiPlugin.setSaveLogs(saveLogs);
  
  Logger.v("initializeApi()");
  
  final Either<InitializeApiFailure, Void> result;
  
  DJISDKManager.getInstance().registerApp(context, this);
  synchronized (djiSdkRegistrationFinishedSignal) {
    djiSdkRegistrationFinishedSignal.await();
  }
  
  if (registerDjiSdkResult == null) {
    result = left(InitializeApiFailure.failed);
  } else if (registerDjiSdkResult.equals(DJISDKError.REGISTRATION_SUCCESS)) {
    result = right(null);
    
    DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP(bridgeAppIp);
  } else {
    result = left(InitializeApiFailure.fromDji(registerDjiSdkResult));
  }
  
  return result;
}

fernando-s97 avatar Jan 28 '21 13:01 fernando-s97

@fernando-s97 Hi Fernando, We can definitely try to find a solution for the problem you are facing. Quick follow up questions which will help us investigate further.

  1. Have you tried using the Bridge app along with the https://github.com/dji-sdk/Mobile-UXSDK-Beta-Android app? Does that work for your current setup?
  2. You mentioned you are using Asus Zenfone ZE620KL. Is that for the bridge app? Which device are you using for your DJI application?

siddutgikar avatar Jan 29 '21 21:01 siddutgikar

@siddutgikar

  1. I have not
  2. The Asus is running my application. The bridge app is running under a Galaxy Tab S3.

I've just tested the same code and setup right now, with the latest version of this repo and DJI MSDK 15, and everything seem to be working

fernando-s97 avatar Jul 19 '21 17:07 fernando-s97

My issue (not sure if it was same as yours) - my phone running bridge-app was connecting to remote controller (top left light was green), but it could not be connected to by the other device running DJI SDK (top right wifi-symbol was red, and app running on other phone did not connect).

Turned out I needed to Turn off Mobile data on the phone connected to the remote controller, then restart the bridge app - it then gives you a different IP, which you enter in the onRegister callback as described on the Bridge app GitHub.

Edit: Well, it worked for a while, but now I have the same issue as everyone else. Both remote-connection and wifi-connection are Green in bridge app - but device running DJI SDK is unable to connect to drone. It still connects fine with WIFI debugging (so long as I comment out the DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP(bridge_ip) line).

Edit 2 - Weirdly it started working again.... Not sure exactly why - I was running app and it wasn't connecting. I restarted controller, phone, ran app, failed to connect, ran app in with debugger and it worked, now running app normally also works. The fact that it first started working when running in debug mode makes me wonder if there's some kind of race condition at work.

Edit 3 - Once again, when I moved to a new wifi network, it failed to connect (both RC and wifi green in bridge app, but no connection from app to drone). It kept failing until I restarted the remote controller, and now it connects.

Edit 4 I have just observed the "RC Light" (top left) going PURPLE. Was able to connect to bridge-phone but not drone. Restarting the bridge app solved that problem - light is now green and it connects.

Edit 5 It mostly works but just gets "moody" sometimes, and I still can't figure out a reliable way to get it out of its moods. More observations:

  • Recently, it worked, but only if you ran in Debug mode and only if you initiated the bridge connection very quickly after app start. It may be related to the fact that the app automatically tried direct-connection on startup and you had to ask for a bridge connection before the direct connection attempt failed. In this case if the wifi-light went green (in bridge app), you could be sure it was going to connect.
  • Just now, it stopped working (with wifi-light green, just not connecting to drone), but then started working again when I turned off and on the wifi of both the app-phone and the bridge-phone (I'm not sure which one mattered)

petered avatar Jun 02 '22 05:06 petered