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

Phantom 4 Pro problem with MAVLINK commands #218

Open
angel-ayala opened this issue Jul 22, 2024 · 11 comments
Open

Phantom 4 Pro problem with MAVLINK commands #218

angel-ayala opened this issue Jul 22, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@angel-ayala
Copy link
Contributor

Describe the bug

After source code compilation and installing RD, the APK crashed when after tap the Drone button.
I changed two lines of code, and I was able to use it, however, I still facing some problems.

I already set the RD and QGC settings, and I can arm the drone from my smartphone and through QGC, nevertheless, no success with other MAVLINK commands.
With QGC I can read some sensor data, but I can't send the home location or other MAVLINK related commands with success.

On the logcat from android studio, after open RD I get some some error log, then when I tap the Drone button I get other error messages.

When I start the DroneKit's python script to read the vehicle state, I can see the captured state until the armed info, after that, the script keeps waiting set the home location command, which never happens.

There are some LDM related error, but on the DJI's site appears that is not mandatory, maybe because is a chinese smartphone?
I don't know, can you help me?

Steps To Reproduce

  1. Install following the installation instructions.
  2. Add case PHANTOM_4_PRO: in the MainActivity.java file at line 949, and update the line 296 of DroneModel.java with useMissionManager = m_model == Model.PHANTOM_4_PRO.
  3. Connect the RC by USB to the smartphone with the drone connected.
  4. Start the apk from AndroidStudio.
  5. Tap Drone button.
  6. Start DroneKit vehicle_state.py example script.

Screenshots

No response

Drone Model

DJI Phantom 4 Pro

Smartphone Model

- Model: Xiaomi Redmi Note 10S (M2101K7BL)
- Android version: 13 TP1A.220624.014

Additional context

DroneKit python vehicle_state.py --connect udpin:0.0.0.0:14550 command output:

Connecting to vehicle on: udpin:0.0.0.0:14550

Get all vehicle attribute values:
 Autopilot Firmware version: APM:Copter-0.4.1-dev7
   Major version number: 0
   Minor version number: 4
   Patch version number: 1
   Release type: dev
   Release version: 7
   Stable release?: False
 Autopilot capabilities
   Supports MISSION_FLOAT message type: False
   Supports PARAM_FLOAT message type: False
   Supports MISSION_INT message type: True
   Supports COMMAND_INT message type: True
   Supports PARAM_UNION message type: False
   Supports ftp for file transfers: False
   Supports commanding attitude offboard: False
   Supports commanding position and velocity targets in local NED frame: False
   Supports set position + velocity targets in global scaled integers: False
   Supports terrain protocol / data handling: False
   Supports direct actuator control: False
   Supports the flight termination command: False
   Supports mission_float message type: False
   Supports onboard compass calibration: False
 Global Location: LocationGlobal:lat=0.0,lon=0.0,alt=None
 Global Location (relative altitude): LocationGlobalRelative:lat=0.0,lon=0.0,alt=0.0
 Local Location: LocationLocal:north=None,east=None,down=None
 Attitude: Attitude:pitch=-0.003490658476948738,yaw=-0.6824237108230591,roll=-0.006981316953897476
 Velocity: [0.0, 0.0, 0.0]
 GPS: GPSInfo:fix=1,num_sat=3
 Gimbal status: Gimbal: pitch=None, roll=None, yaw=None
 Battery: Battery:voltage=0.0,current=0.0,level=42
 EKF OK?: False
 Last Heartbeat: 0.5488206660011201
 Rangefinder: Rangefinder: distance=None, voltage=None
 Rangefinder distance: None
 Rangefinder voltage: None
 Heading: 320
 Is Armable?: False
 System status: ACTIVE
 Groundspeed: 0.0
 Airspeed: 0.0
 Mode: STABILIZE
 Armed: False
Traceback (most recent call last):
  File "/home/angel/desarrollo/vehicle_state.py", line 93, in <module>
    cmds.wait_ready()
  File "/home/angel/.conda/envs/pytorch/lib/python3.10/site-packages/dronekit/__init__.py", line 2976, in wait_ready
    return self._vehicle.wait_ready('commands', **kwargs)
  File "/home/angel/.conda/envs/pytorch/lib/python3.10/site-packages/dronekit/__init__.py", line 2374, in wait_ready
    raise TimeoutError('wait_ready experienced a timeout after %s seconds.' %
dronekit.TimeoutError: wait_ready experienced a timeout after 30 seconds.

RD start log output:

2024-07-21 19:17:54.086 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:54.095 17549-17588 QT                      sq.rogue.rosettadrone                E  [QT]file does not exist
2024-07-21 19:17:54.441 17549-17549 DJISDKManager           sq.rogue.rosettadrone                E  Failed to load LDM Plus license file /storage/emulated/0/Android/data/sq.rogue.rosettadrone/files/DJI/sq.rogue.rosettadrone.dlf: open failed: ENOENT (No such file or directory)
2024-07-21 19:17:54.622 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:54.623 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:54.625 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:54.701 17549-17549 FBI                     sq.rogue.rosettadrone                E  Can't load library: dlopen failed: library "libmagtsync.so" not found
2024-07-21 19:17:54.717 17549-17586 libMiGL                 sq.rogue.rosettadrone                E  libmigl:This GPU version is note support Variable Shading Rate
2024-07-21 19:17:54.738 17549-17618 ion                     sq.rogue.rosettadrone                E  ioctl c0044901 failed with code -1: Invalid argument
2024-07-21 19:17:54.785 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:56.133 17549-17596 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  start accessory receiver
2024-07-21 19:17:56.148 17549-17592 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  receive action: android.hardware.usb.action.USB_STATE
2024-07-21 19:17:56.149 17549-17592 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  android.hardware.usb.action.USB_STATE: is connected
2024-07-21 19:17:56.164 17549-17648 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:17:56.164 17549-17648 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:56.196 17549-17677 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.196 17549-17674 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.196 17549-17678 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.196 17549-17676 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.196 17549-17675 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.197 17549-17673 Lightbridge             sq.rogue.rosettadrone                E  Failed to obtain JNIEnv
2024-07-21 19:17:56.231 17549-17596 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:56.232 17549-17596 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:56.232 17549-17596 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:57.226 17549-17592 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:57.226 17549-17592 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:57.227 17549-17592 DJIComponentManager     sq.rogue.rosettadrone                E  Service Not Connected
2024-07-21 19:17:57.520 17549-17596 FR_JNI                  sq.rogue.rosettadrone                E  JNI_OnLoad
2024-07-21 19:17:57.611 17549-17596 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:17:57.664 17549-17596 fdd                     sq.rogue.rosettadrone                E  start checkForDisable
2024-07-21 19:17:57.665 17549-17596 fdd                     sq.rogue.rosettadrone                E  disabled, return
2024-07-21 19:17:57.671 17549-17549 fdd                     sq.rogue.rosettadrone                E  start checkForDisable
2024-07-21 19:17:57.671 17549-17549 fdd                     sq.rogue.rosettadrone                E  disabled, return
2024-07-21 19:17:57.683 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  getModel: T600
2024-07-21 19:17:57.684 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  currentModel saved: NORMAL
2024-07-21 19:17:57.684 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  getManufacturer: DJI
2024-07-21 19:17:57.686 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  hasPermission 
2024-07-21 19:17:57.687 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  openAccessory: UsbAccessory[mManufacturer=DJI, mModel=T600, mDescription=DJI Inspire 1, mVersion=v1.2.3.4, mUri=www.dji.com, mSerialNumberReader=android.hardware.usb.IUsbSerialReader$Stub$Proxy@1bed3ae]
2024-07-21 19:17:57.690 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  mFileDescriptor: mInputStream=java.io.FileInputStream@25999e5
2024-07-21 19:17:57.691 17549-17549 DJIUsbAccessoryReceiver sq.rogue.rosettadrone                E  mFileDescriptor: FileDescriptor=true
2024-07-21 19:17:57.693 17549-17549 linkDeamon              sq.rogue.rosettadrone                E  stopDaemon AOA
2024-07-21 19:17:57.694 17549-17597 TAG                     sq.rogue.rosettadrone                E  API Key successfully registered(255)
2024-07-21 19:17:57.695 17549-17549 gfd                     sq.rogue.rosettadrone                E  djisocket destroy
2024-07-21 19:17:57.696 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 1
2024-07-21 19:17:57.696 17549-17549 fdd                     sq.rogue.rosettadrone                E  djisocket destroy
2024-07-21 19:17:57.697 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 2
2024-07-21 19:17:57.698 17549-17549 nhf                     sq.rogue.rosettadrone                E  udt destroy 1 9000
2024-07-21 19:17:57.699 17549-17549 nhf                     sq.rogue.rosettadrone                E  udt destroy 2 9000
2024-07-21 19:17:57.699 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 3
2024-07-21 19:17:57.700 17549-17549 P3CCameraService        sq.rogue.rosettadrone                E  udt destroy 1 9001
2024-07-21 19:17:57.701 17549-17549 P3CCameraService        sq.rogue.rosettadrone                E  udt destroy 2 9001
2024-07-21 19:17:57.701 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 4
2024-07-21 19:17:57.702 17549-17549 SwUdpService            sq.rogue.rosettadrone                E  sw udt destroy 1 N/A
2024-07-21 19:17:57.703 17549-17549 UDT-JNI                 sq.rogue.rosettadrone                E  cannot close udp
2024-07-21 19:17:57.704 17549-17549 SwUdpService            sq.rogue.rosettadrone                E  sw udt destroy 2 N/A
2024-07-21 19:17:57.705 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 5
2024-07-21 19:17:57.705 17549-17549 nhf                     sq.rogue.rosettadrone                E  djisocket destroy
2024-07-21 19:17:57.706 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 6
2024-07-21 19:17:57.706 17549-17549 fdd                     sq.rogue.rosettadrone                E  djisocket destroy
2024-07-21 19:17:57.706 17549-17549 daemon                  sq.rogue.rosettadrone                E  destroy wifi 7
2024-07-21 19:17:57.728 17549-17652 DJIPackManager          sq.rogue.rosettadrone                E  pack senderType=14 cmdSet=6
2024-07-21 19:17:57.732 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:17:57.755 17549-17758 fdd                     sq.rogue.rosettadrone                E  event:ConnectOK
2024-07-21 19:17:57.765 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE
2024-07-21 19:17:57.773 17549-17592 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:17:57.776 17549-17758 fdd                     sq.rogue.rosettadrone                E  send MSG_RETRY_DETECT_ENABLE
2024-07-21 19:17:57.857 17549-17592 DJIUSBWifiSwitchManager sq.rogue.rosettadrone                E  ****resetSwitchFromWifiFlag
2024-07-21 19:17:57.860 17549-17652 DJIPackManager          sq.rogue.rosettadrone                E  post DataCameraEvent.ConnectOK RC
2024-07-21 19:17:58.162 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:18:00.331 17549-17592 DJISDKCacheKeys         sq.rogue.rosettadrone                E  repeat include key, please check your code : class dji.sdksharedlib.hardware.abstractions.hjn.koy.ddf, key : @dji.sdksharedlib.keycatalog.ghj.koy(accessType=8, autoGetInterval=1000, excludedAbstractions=[class dji.sdksharedlib.hardware.abstractions.hjn.uio.dgh, class dji.sdksharedlib.hardware.abstractions.hjn.koy.ghu], expirationDuration=100, includedAbstractions=[class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.hjn, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.nbb, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.hgf, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.jhg, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.bcx, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.oyf, class dji.sdksharedlib.hardware.abstractions.hjn.uio.fdd, class dji.sdksharedlib.hardware.abstractions.camera.zenmuse.fdd, class dji.sdksharedlib.hardware.abstractions.hjn.koy.ddf, class dji.sdksharedlib.hardware.abstractions.hjn.xss.dgh, class dji.sdksharedlib.hardware.abstractions.hjn.xss.uio, class dji.sdksharedlib.hardware.abstractions.hjn.jnh.nhf, class dji.sdksharedlib.hardware.abstractions.hjn.koy.ddf], protectDuration=500, type=class java.lang.Object, types=[class dji.common.camera.SettingsDefinitions$ZoomDirection, class dji.common.camera.SettingsDefinitions$ZoomSpeed], updateType=USER_DRIVEN)
2024-07-21 19:18:00.616 17549-17592 fdd                     sq.rogue.rosettadrone                E  runMethod: null
2024-07-21 19:18:00.623 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:18:00.623 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:18:00.624 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE
2024-07-21 19:18:00.625 17549-17592 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:18:01.235 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:18:01.235 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:18:01.362 17549-17724 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:18:01.362 17549-17724 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:18:01.933 17549-17549 FileSource              sq.rogue.rosettadrone                E  Failed to open file 'content://settings/system/notification_sound'. (No such file or directory)
2024-07-21 19:18:01.934 17549-17549 AudioManager            sq.rogue.rosettadrone                E  hasHapticChannels failure:java.io.IOException: Failed to instantiate extractor.
2024-07-21 19:18:01.972 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:18:02.627 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE
2024-07-21 19:18:02.633 17549-17592 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:18:04.635 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE
2024-07-21 19:18:04.641 17549-17592 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:18:06.643 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE
2024-07-21 19:18:06.649 17549-17592 fdd                     sq.rogue.rosettadrone                E  isWifiLink:false isWifiConnected:true isMobileDataEnabled:true
2024-07-21 19:18:07.767 17549-17592 fdd                     sq.rogue.rosettadrone                E  receive msg MSG_RETRY_DETECT_ENABLE_TIMEOUT
2024-07-21 19:18:58.843 17549-17549 BinderMonitor           sq.rogue.rosettadrone                E  err open binder_delay errno=2
2024-07-21 19:18:58.853 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:19:03.453 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:19:06.630 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:19:06.631 17549-17595 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:19:06.631 17549-17595 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:19:06.631 17549-17592 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:19:06.632 17549-17648 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:19:06.632 17549-17648 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log

log after tap Drone button

2024-07-21 19:21:24.890 17549-17652 DJIPackManager          sq.rogue.rosettadrone                E  pack senderType=17 cmdSet=10
2024-07-21 19:21:49.712 17549-17549 MainActivity            sq.rogue.rosettadrone                E  onCreate()
2024-07-21 19:21:49.867 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:51.712 17549-17549 MainActivity            sq.rogue.rosettadrone                E  initVideoService
2024-07-21 19:21:51.712 17549-17549 MainActivity            sq.rogue.rosettadrone                E  IP Address: 192.168.1.220
2024-07-21 19:21:52.216 17549-17549 MainActivity            sq.rogue.rosettadrone                E  doBindService
2024-07-21 19:21:52.231 17549-17549 DJISDKManager           sq.rogue.rosettadrone                E  Failed to load LDM Plus license file /storage/emulated/0/Android/data/sq.rogue.rosettadrone/files/DJI/sq.rogue.rosettadrone.dlf: open failed: ENOENT (No such file or directory)
2024-07-21 19:21:52.277 17549-17549 MainActivity            sq.rogue.rosettadrone                E  onResume()
2024-07-21 19:21:52.298 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:52.299 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:52.347 17549-17597 MainActivity            sq.rogue.rosettadrone                E  API Key successfully registered(255)
2024-07-21 19:21:52.381 17549-18153 MAVLinkConnection       sq.rogue.rosettadrone                E  Connecting to 192.168.1.220:14550
2024-07-21 19:21:52.514 17549-17597 WP_JNI                  sq.rogue.rosettadrone                E  JNI_OnLoad
2024-07-21 19:21:52.618 17549-17597 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:21:52.618 17549-17597 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:52.633 17549-17765 NativeHelper            sq.rogue.rosettadrone                E  NativeHelper
2024-07-21 19:21:52.634 17549-17765 DJI                     sq.rogue.rosettadrone                E  m_pCodecPaser == NULL
2024-07-21 19:21:54.228 17549-17549 libEGL                  sq.rogue.rosettadrone                E  call to OpenGL ES API with no current context (logged once per thread)
2024-07-21 19:21:54.243 17549-17549 Affinity                sq.rogue.rosettadrone                E  Not RM500 !
2024-07-21 19:21:54.264 17549-17765 libEGL                  sq.rogue.rosettadrone                E  call to OpenGL ES API with no current context (logged once per thread)
2024-07-21 19:21:54.341 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.342 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.350 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.368 17549-17549 VideoService            sq.rogue.rosettadrone                E  oncreate Video 
2024-07-21 19:21:54.445 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.526 17549-18166 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:21:54.526 17549-18166 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.533 17549-18084 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:21:54.533 17549-18084 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.593 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.594 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:54.709 17549-17549 koy$fdd                 sq.rogue.rosettadrone                E  send to server success: Response{protocol=http/1.1, code=200, message=, url=https://statistical-report.djiservice.org/api/report/web}
2024-07-21 19:21:54.755 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:55.373 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:55.373 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:55.376 17549-17549 MainActivity            sq.rogue.rosettadrone                E  onServiceConnected  192.168.1.220
2024-07-21 19:21:55.376 17549-17549 VideoService            sq.rogue.rosettadrone                E  setParameters
2024-07-21 19:21:55.626 17549-18182 ion                     sq.rogue.rosettadrone                E  ioctl c0044901 failed with code -1: Invalid argument
2024-07-21 19:21:55.636 17549-18168 FileUtils               sq.rogue.rosettadrone                E  err open mi_exception_log errno=2
2024-07-21 19:21:55.636 17549-18168 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:55.750 17549-17549 FileUtils               sq.rogue.rosettadrone                E  err write to mi_exception_log
2024-07-21 19:21:55.871 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:55.872 17549-18166 libEGL                  sq.rogue.rosettadrone                E  call to OpenGL ES API with no current context (logged once per thread)
2024-07-21 19:21:55.872 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.879 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.879 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.905 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:55.912 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:55.914 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:55.923 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:55.928 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:55.929 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.932 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:55.967 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:55.974 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:55.975 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.977 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:55.983 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:55.985 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:55.985 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:55.987 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:56.001 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.002 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.056 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.128 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.133 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.133 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.135 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73ea00
2024-07-21 19:21:56.228 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.228 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.294 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.298 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.298 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.300 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c89e600
2024-07-21 19:21:56.322 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.327 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.329 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c89e600
2024-07-21 19:21:56.392 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.396 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.398 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c89ea80
2024-07-21 19:21:56.461 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.462 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.464 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:56.488 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.488 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.531 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.534 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.534 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.538 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e100
2024-07-21 19:21:56.564 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.630 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.634 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.635 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.637 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c73e700
2024-07-21 19:21:56.663 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.729 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.760 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.765 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.765 17549-18166 libEGL                  sq.rogue.rosettadrone                E  eglSwapBuffersWithDamageKHRImpl:1372 error 300d (EGL_BAD_SURFACE)
2024-07-21 19:21:56.767 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c89ec00
2024-07-21 19:21:56.825 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.829 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.831 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c0c89ed80
2024-07-21 19:21:56.895 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
2024-07-21 19:21:56.898 17549-17765 Surface                 sq.rogue.rosettadrone                E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-07-21 19:21:56.901 17549-18166 Surface                 sq.rogue.rosettadrone                E  getSlotFromBufferLocked: unknown buffer: 0xb400007c2a7ecc80
2024-07-21 19:21:56.929 17549-17765 libEGL                  sq.rogue.rosettadrone                E  eglMakeCurrentImpl:1082 error 3002 (EGL_BAD_ACCESS)
@angel-ayala angel-ayala added the bug Something isn't working label Jul 22, 2024
@angel-ayala
Copy link
Contributor Author

Apparently MAVLink is working fine, nevertheless there are some MAV_CMD_REQUEST_MESSAGE that may need proper handlers.

Every time when I have the QGC and start RD, the app crash with the following exception.

The issue should be with the FTP transaction, according to MAVLink documention, requestMsgId 395 is [COMPONENT_INFORMATION](https://mavlink.io/en/messages/common.html#COMPONENT_INFORMATION) which is a

Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE.

Apparently that FTP transaction done is being done with a null pointer, additionally the method appears as deprecated since 2022-04.

Any ideas how to solve it?

2024-07-29 15:43:05.568 10209-10637 MAVLinkReceiver         sq.rogue.rosettadrone                D  MAV_CMD_REQUEST_MESSAGE -> requestMsgId=148
2024-07-29 15:43:06.614 10209-10637 MAVLinkReceiver         sq.rogue.rosettadrone                D  MAV_CMD_REQUEST_MESSAGE -> requestMsgId=397
2024-07-29 15:43:07.637 10209-10637 MAVLinkReceiver         sq.rogue.rosettadrone                D  MAV_CMD_REQUEST_MESSAGE -> requestMsgId=395
2024-07-29 15:43:08.663 10209-10637 AndroidRuntime          sq.rogue.rosettadrone                E  FATAL EXCEPTION: Thread-191
                                                                                                    Process: sq.rogue.rosettadrone, PID: 10209
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'void sq.rogue.rosettadrone.FTPManager.manage_ftp(com.MAVLink.common.msg_file_transfer_protocol)' on a null object reference
                                                                                                    	at sq.rogue.rosettadrone.MAVLinkReceiver.process(MAVLinkReceiver.java:521)
                                                                                                    	at sq.rogue.rosettadrone.MainActivity$GCSCommunicatorAsyncTask$Listener.run(MainActivity.java:1773)

@kripper
Copy link
Collaborator

kripper commented Jul 29, 2024

Definetively a bug in the implementation.

@kripper
Copy link
Collaborator

kripper commented Jul 30, 2024

Why is it using FTP? Maybe it's old custom code that shouldn't be there.
One of the previous authors of RD (@The1only) was doing some custom FTP operations, like uploading stats to a private FTP server.
His customizations should be removed from the main code and placed into the "AI9Tek" plugin (app/src/main/java/sq/rogue/rosettadrone/plugins/AI9Tek.java), as I have done myself in the past.
The mentioned plugin is broken. I moved the code there only to make him easier to re-enable his customizations in case he needs them in the future.

The bug you described could be triggered by some leftovers of his customizations in MAVLINK commands that were not tested afterwards.
If so, feel free to remove those customizations and insert them as comments in the "AI9Tek" plugin.

@angel-ayala
Copy link
Contributor Author

Good, I did understand how to move the code to the plugin file, because the lines are in the MAVLinkReceiver.java file and not in the MainActivity.java.
I commented those lines and added the response to some commands such as get home location.
Additionally, apparently when set the home location from QGC is not being updated on the drone since the QGC is not updated.
Accordingly to the DJI SDK is the FlightController class which possess the setHomeLocation() method, and the DroneModel call the setHomeLocation from a FlightControllerInstance class, I was thinking that can be related.

Other aspect is the ACK necessity after a command, I saw that is already implemented but is not always sent. I added in the setHomeLocation method to prevent being notified by QGC that the commands did not obtained a response.

I still need to test during flying, If all goes fine I will create a PR.

@kripper
Copy link
Collaborator

kripper commented Jul 30, 2024

I also found and fixed many of those missing ACKs. I don't remember if QGC and MAVSDK were 100% compatible regarding ACKs (I remember the implementations had some deviations, but I got them working fine for my use cases).

@angel-ayala
Copy link
Contributor Author

I already did some tests, and when I create a mission on QGC appears the uploading message in logcat but when slide the bar to start the mission, nothing happens after that.
I will look more in depth to what is wrong, at first, should be something related to MAVLink only.

@kripper
Copy link
Collaborator

kripper commented Sep 4, 2024

I already did some tests, and when I create a mission on QGC appears the uploading message in logcat but when slide the bar to start the mission, nothing happens after that. I will look more in depth to what is wrong, at first, should be something related to MAVLink only.

What DJI model?

@kripper
Copy link
Collaborator

kripper commented Sep 4, 2024

I'm not sure if phantom 4 supports on-board missions.
I implemented and tested extensively the MissionManager class to support off-board missions (handled by RD).
If your drone doesn't support on-board missions, you can enable the MissionManager class by adding the model in the list of models (one line of code).
For more info, please search the issues and code by MissionManager.

@angel-ayala
Copy link
Contributor Author

I don't exactly know if P4P supports on-board missions, but I was looking into the MAVLinkReceiver class, there are some if related with the MissionManager and check if current model supports on-board mission.

@angel-ayala
Copy link
Contributor Author

There is anyway to test the support of on-board missions? I accidentally already added the model to the list and enabled it.
When I upload the mission enters into MAVLinkReceiver class's finalizeNewMission method with all working fine, but after sliding the drone lifts and then nothing happens and, there is no movement nor error log.

After populating the missionItems through mModel.missionManager.setMission which method (must be) is called? I was thinking in check the method's flow calls first, I'm using the mission planner from QGC with just one coordinate.
Any thoughts on what could it be?

@kripper
Copy link
Collaborator

kripper commented Sep 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants