dji-sdk / Mobile-SDK-Android-V5

MSDK V5 Sample
Other
281 stars 145 forks source link

Mini3 Pro keeps disconnecting when running sample App. #427

Open petered opened 1 month ago

petered commented 1 month ago

I'm running the sample app on the RC-Pro with the Mini3 Pro.

The drone keeps disconnecting and reconnecting approximately every 5 seconds (see screenshots). I can open the "Default Layout" - but the video will freeze every few seconds. So the Sample app is unusable.

Interesting observation: The Sample app DOES stay connected if you run it AFTER running DJI-Fly.

20240922_141522 20240922_141552

dji-dev commented 1 month ago

Agent comment from SHENRONG.LE in Zendesk ticket #117875:

Dear developers, Hello, thank you for contacting DJI Innovation.

The Mini 3 Pro has frequent disconnection problems when running the sample application on RC Pro, the possible causes and solutions are as follows: 1, application port conflict: The DJI Pilot application on the RC Pro remote may occupy the port, causing the sample application to not connect properly. 2, remote control and application compatibility issues: There may be compatibility issues between the RC Pro remote control and the sample application, resulting in an unstable connection. 3,It is necessary to forcibly stop the DJI Pilot app in the setting interface to use the MSDK app, otherwise the port of MSDK will be preempted by the DJI Pilot app, resulting in the MSDK V5 app failing to recognize the remote control. Restart the sample application after forcibly stopping the DJI Pilot app. This problem is caused by the design of the remote control firmware.

I hope our solution can help you, thank you for your email, wish you a happy life! Best Regards, Dji innovation SDK technical support

°°°

petered commented 1 month ago

Thank you for your reply.

Re: 1/3: To be clear - The bug happens when running the MSDK Sample app ALONE - without DJI-Fly running in the background. So there shouldn't be a conflict between apps - because there is only one application running at a time.

Re: 2: Maybe - but the connection works fine just after running DJI fly - so in principle the RC-Pro and Mini3 Pro can work together running the sample app. There is just a bug somewhere which keeps interrupting the connection (unless you run the app right after running DJI-Fly).

Here is a video where I reproduce the issue: https://photos.app.goo.gl/4HJfSm1jZqhPJDzz5

dji-dev commented 1 month ago

Agent comment from SHENRONG.LE in Zendesk ticket #117875:

Dear developers, Hello, thank you for contacting DJI Innovation.

I picked up a known inclusion issue, which is currently documented, that DJI FLY and MSDK are in conflict

I hope our solution can help you, thank you for your email, wish you a happy life! Best Regards, Dji innovation SDK technical support

°°°

petered commented 1 month ago

Thank you for your reply - but it looks like there has been some miscommunication of the issue.

The problem is not about conflict between the Sample App and DJI Fly.

If you look at the video, you'll see that:

Running DJI-Fly before the Sample App actually makes it work.

--- 来自ChatGPT的翻译 - 请原谅任何错误。 ---

问题不在于Sample App和DJI Fly之间的冲突。

如果你看视频,你会发现:

在运行Sample App之前运行DJI Fly,实际上会让它工作。

dji-dev commented 1 month ago

Agent comment from SHENRONG.LE in Zendesk ticket #117875:

Dear developers, Hello, thank you for contacting DJI Innovation.

About the conflict between msdk and DJI Fly, here is the feedback first

I hope our solution can help you, thank you for your email, wish you a happy life! Best Regards, Dji innovation SDK technical support

°°°

petered commented 1 month ago

Added notes on this - I'll update this comment as I debug. I'm trying to understand what controls this "hidden state" that makes the Sample app work or not work.

Hypothesis: DJI Fly, on exit, puts RC-Controller in working state, and Sample App leaves it in broken state.

Experiments (I've disabled auto-startup of DJI fly on the RC-Pro for these)

  1. Restart both drone and controller, run sample app: NO PROBLEM [surprising - we didn't previously run DJI fly]
  2. -> Stop sample app and run it again: NO PROBLEM [surprising - Sample app didn't put it in problem-state]
  3. -> Stop sample app and run it again: still NO PROBLEM [interesting - it stays in working state]
  4. -> Run DJI fly, close DJI Fly, run Sample app again: NO PROBLEM
  5. -> Run Sample app again, now there's the PROBLEM
  6. -> Run Sample app again, PROBLEM
  7. -> Run Sample app again, PROBLEM
  8. -> Restart Drone, run Sample app again, PROBLEM
  9. -> Run Sample app again, PROBLEM
  10. -> Run DJI fly, close DJI Fly, run Sample app again: NO PROBLEM
  11. -> Run Sample app again, PROBLEM
  12. -> Restart controller, run sample app again PROBLEM
  13. -> Restart both drone and controller, run sample app: PROBLEM [surprising - state seemed the same as in (1) but different result - maybe state persists across restarts]
  14. -> Run DJI fly, close DJI Fly, run Sample app again: NO PROBLEM
  15. -> Run Sample app again, PROBLEM
  16. -> Run DJI Fly, restart controller, run Sample app again PROBLEM [lesson - "fixed" state left by DJI fly did not persist across restart]
  17. -> Run DJI Fly, restart drone and controller, run sample app again PROBLEM

Hypothesis was proven wrong on experiment 1, but it holds true from experiments 4 on...

What we've discovered so far..

So - I'm currently baffled. Will update this as more evidence trickles in...

antonymarion commented 1 month ago

Hi @petered, we have a RC Pro and a mini 3 Pro using Last Dji Sample release.

As far as I remember, on Last release the was no stability issue. I will ask for people in team to check it twice for you.

Regards,

petered commented 1 month ago

Ah thanks Antony, that's good info - so going back one release may fix the problem. Ok - will post any discoveries to this thread.

antonymarion commented 1 month ago

I am not sure which release you are using, but on last release (5.10), I noticed only that: https://github.com/dji-sdk/Mobile-SDK-Android-V5/issues/411

So basically, it seems to me that crash/instability issues were fixed when drone was flying and not connected to a pc with USB.

But when testing with USB it was as chaotic as before.

Since the mini 3 PRO is now with a member of our team, I will let him test it again to confirm this.

dji-lyt commented 1 month ago

@petered I have reviewed the video mentioned earlier. You might want to try the method for disabling DJI FLY shown in the video below, as the method you are currently using does not completely turn off DJI FLY. https://pan-sec.djicorp.com/s/aD8zY3qAK3rBC6Z

petered commented 1 month ago

https://github.com/user-attachments/assets/d3deef72-1615-4e29-a239-0101f3f3e67b

Very Interesting. Thank you @dji-lyt for taking the time to make that video and share it.

I have confirmed that "Force Stop" of DJI fly fixes the connection problem. But please don't close this ticket because this is still a weird bug!

What is strange is that even if DJI Fly has never been started since turning on the RC-Pro, the Sample app still gets a connection error and Force Quitting DJI Fly still fixes it.. See video https://photos.app.goo.gl/wg2eYj5ipJNZw9Jr8 (or download attached video - since Github does not play it correctly)

So, how can we fix this programatically? How can we ensure that DJI Fly is fully terminated without having to instruct our users to go "Settings -> Apps and Notifications -> See all Applications -> DJI Fly -> Force Stop"?

Can this fix be made to the Sample App?
Or must we wait for a fix to DJI fly?
Or must there be a software fix for the RC-Pro?

--- 来自ChatGPT的翻译 - 请原谅任何错误。 ---

我已经确认,强制停止(“Force Stop”)DJI Fly 确实能解决连接问题。不过,这个工单先别急着关啊,毕竟这问题还是挺奇怪的!

奇怪的是,即便 RC-Pro 开机后从来没启动过 DJI Fly,Sample app 依然会报连接错误,而强制退出 DJI Fly 依然能解决问题。看这里的视频:https://photos.app.goo.gl/wg2eYj5ipJNZw9Jr8 .(或者下载附件视频,因为 Github 无法正确播放)

所以,咱们要怎么通过程序来修复这个问题呢?怎么确保 DJI Fly 是彻底退出的,而不用麻烦用户自己去 "Settings -> Apps and Notifications -> See all Applications -> DJI Fly -> Force Stop" 操作?

这个问题能在 Sample App 里解决吗? 还是我们得等 DJI Fly 修复? 或者是不是还得等 RC-Pro 来个软件修复?

dji-dev commented 1 month ago

Agent comment from yating.liao in Zendesk ticket #117875:

After I set the launch application for the RC PRO to empty, it seems that using the sample app on startup did not present similar issues. I have added my latest test video in the this link: https://pan-sec.djicorp.com/s/XmqqwrrikmQct9r

As for confirming whether DJI FLY has completely exited, I think you can check if the DJI FLY process is still active. This is not a feature of MSDK, but you should be able to implement it on your own.

°°°

petered commented 1 month ago

Well... now I cannot reproduce the problem at all, under any circumstances. It definitely did happen a few times after restarting the RC-Pro, without opening DJI-Fly (see my last video). It may depend on phase of the moon.

Ok - thank you for your time dji-dev. I ask that we leave this issue open until we understand what causes it. I will update this issue with any future findings.

Thank you for sharing the tip about Force Quitting the DJI Fly app - that was helpful.


嗯……现在无论什么情况下我都无法重现这个问题了。之前确实在重启 RC-Pro 后发生过几次,而且没有打开 DJI Fly(请参见我上次的视频)。也许这取决于月亮的相位。

好的,感谢你们的时间,DJI 开发团队。我请求我们先保持这个问题的开放状态,直到我们弄清楚问题的原因。我会在有新的发现时更新此问题。

感谢你分享关于强制退出 DJI Fly 应用的建议——这真的很有帮助。

antonymarion commented 1 month ago

Maybe the dark side of the moon ;) Few countries have spatial explorations there :)

@petered, We will try to reproduce with our model and let you know, since this bug is interesting too !

dji-dev commented 1 month ago

Agent comment from yating.liao in Zendesk ticket #117875:

We will keep this issue open. However, if there are no updates long time, we may proactively close it. You are welcome to submit the issue again whenever you have new findings.

°°°

antonymarion commented 3 weeks ago

@petered For your information, our dev has reproduced your bug using the mini 3 Pro.

But after exiting the dji Fly App, it stopped disconnecting/reconnecting.

So exiting the background process app (Dji Fly) seems to do the trick

petered commented 3 weeks ago

Yep - I've observed the same. Thing I don't quite understand yet is what causes the DJI Fly background process to start up again (on RC-Pro). It seems it can restart without actually ever opening the DJI Fly app...

antonymarion commented 3 weeks ago

Yep - I've observed the same. Thing I don't quite understand yet is what causes the DJI Fly background process to start up again (on RC-Pro). It seems it can restart without actually ever opening the DJI Fly app...

A daemon maybe? @dji-dev

dji-dev commented 2 weeks ago

Agent comment from yating.liao in Zendesk ticket #117875:

We don't have much knowledge about DJI FLY either. However, we haven't encountered any instances of DJI FLY automatically starting when using the forced stop method.

°°°