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

Can't get this app to work #7

Open
MathiasHaudgaard opened this issue Apr 19, 2018 · 15 comments
Open

Can't get this app to work #7

MathiasHaudgaard opened this issue Apr 19, 2018 · 15 comments

Comments

@MathiasHaudgaard
Copy link

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?

@dostalleos
Copy link

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.

@alainpimentel
Copy link
Contributor

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

@MathiasHaudgaard
Copy link
Author

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

@alainpimentel
Copy link
Contributor

@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!

@flyboyhoward
Copy link

flyboyhoward commented Aug 24, 2018

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.

@alainpimentel
Copy link
Contributor

@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?

@michaelsheets88
Copy link

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.

@ChangeQSW
Copy link

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
Copy link

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

@ChangeQSW
Copy link

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

@laomi4569
Copy link

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();


            } 

@fernando-s97
Copy link

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;
}

@siddutgikar
Copy link
Contributor

@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?

@fernando-s97
Copy link

@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

@petered
Copy link

petered commented Jun 2, 2022

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)

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

10 participants