Retrieving "serious_low_battery_warning_threshold" and "low_battery_warning_threshold" via Cloud API

Completed

Comments

14 comments

  • DJI Developer Support
    The two fields "serious_low_battery_warning_threshold" and "low_battery_warning_threshold" will be reported when the aircraft is powered on, and will be reported when they change next time. When reporting on startup, you can save this value in your cache, and the next time you retrieve it, you can retrieve it directly from the cache. The value that needs to be retrieved is currently designed to be reported in OSD, and the cloud does not have the ability to actively retrieve the value.
    0
    Comment actions Permalink
  • Vlad Groshkov
    I agree with your workflow, but you have a bug, because this "will be reported when the aircraft is powered on"  is not working in 50 percent of cases. 
    Added log information with started telemetry listeners. And I got telemetry fields only after updating them in DJI Pilot 2.
    Logs: 
    2023-11-06 13:51:23,950 UTC INFO [http-nio-5580-exec-8] *.telemetry.service.GatewayService Created session for Gateway SN #4LFCL5H005G4TV.
    2023-11-06 13:51:27,571 UTC INFO *.telemetry.service.GatewayService Gateway object {'sn':4LFCL5H005G4TV} wasn't created while creating session (applicable for web-app scenarios).
    2023-11-06 13:51:27,571 UTC INFO *.telemetry.model.Gateway DJI: gateway connected
    2023-11-06 13:51:27,572 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: thing/product/4LFCL5H005G4TV/osd.
    2023-11-06 13:51:27,573 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: thing/product/4LFCL5H005G4TV/state.
    2023-11-06 13:51:27,574 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: sys/product/4LFCL5H005G4TV/status.
    2023-11-06 13:51:27,575 UTC INFO *.telemetry.model.Aircraft DJI: aircraft connected
    2023-11-06 13:51:27,577 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: thing/product/1581F6GKB235K00403Z7/osd.
    2023-11-06 13:51:27,577 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: thing/product/1581F6GKB235K00403Z7/state.
    2023-11-06 13:51:27,578 UTC INFO *.telemetry.model.Gateway Registered aircraft #1581F6GKB235K00403Z7 on UCS {droneType: 'Matrice350RTK'}.
    2023-11-06 13:51:27,578 UTC INFO *.telemetry.service.GatewayService Gateway #4LFCL5H005G4TV connected.
    2023-11-06 13:51:27,578 UTC INFO *.telemetry.mqtt.MqttMQ Subscribed to topic: thing/product/4LFCL5H005G4TV/osd.
    2023-11-06 13:51:27,579 UTC INFO [DefaultDispatcher-worker-7] *.telemetry.service.RegistrationService Received value: *.telemetry.model.Aircraft@4608bbb4
    2023-11-06 13:51:27,580 UTC INFO [DefaultDispatcher-worker-4] ucs.vsm.sdk.UcsFacadeImpl Collected new values {'peer.state'=Connected(ucs=UcsVsmFacade(remotePeer='PeerInfo(version=4.19.2900, address=/127.0.0.1, name=DESKTOP-OLSMJRN)')), 'vehicle'=ucs.vsm.sdk.Vehicle@19bd8715}.
    2023-11-06 13:51:28,586 UTC INFO *.telemetry.mqtt.MqttMQ Published message to topic: sys/product/4LFCL5H005G4TV/status_reply.

    //changed values in DJI Pilot 2
    2023-11-06 13:54:51,513 UTC INFO [DefaultDispatcher-worker-9] *.telemetry.model.Aircraft Got new value from aircraft for field low_battery_warning_threshold: 31
    2023-11-06 13:54:51,514 UTC INFO [DefaultDispatcher-worker-9] *.telemetry.model.Aircraft DJI: Got new value from aircraft for field serious_low_battery_warning_threshold: 10
    0
    Comment actions Permalink
  • DJI Developer Support
    We test that the aircraft will be reported when it comes online. If it is not reported, please provide the complete mqtt message reported by the device. We will check it and them pass it to the R&D.
    0
    Comment actions Permalink
  • Vlad Groshkov

    This bug occurs in 50% of attempts. The first MQTT message containing state telemetry is sent after connecting to the Cloud API:

    Aircraft Received message state 'thing/product/1581F62HD226T00BN8PU/state': {
    "bid": "00000000-0000-0000-0000-000000000000",
    "data": {
    "wpmz_version": "1.0.4"
    },
    "tid": "00000000-0000-0000-0000-000000000000",
    "timestamp": 1699527215060,
    "gateway": "4LFCK660026JFQ"
    }
    0
    Comment actions Permalink
  • DJI Developer Support
    `/state` topic messages will be reported multiple times. We tested the report as follows:
    0
    Comment actions Permalink
  • Vlad Groshkov

    I know about it, but if I disconnect from Cloud API, wait some time, and then connect again. In one moment after 3-6 attempts, you can get only this state message like in my previous comment.

    0
    Comment actions Permalink
  • DJI Developer Support
    It will also be reported before disconnection, and you can also read it.
    0
    Comment actions Permalink
  • Vlad Groshkov

    But what if it is a first connection to the aircraft and weren't there ever disconnections? Or this scenario: disconnect from CLoud API and then the user changed values in DJI Pilot and then connected to Cloud API?

    0
    Comment actions Permalink
  • DJI Developer Support
    It is true that it will not be reported in the situation you mentioned, but the current design of the Cloud API does not provide an interface for querying attributes on the cloud. What scenario are you currently using? Because this value will not cause problems under normal circumstances, and the RC must use the Cloud API, It need pilot to manually control the flight, and this data can be viewed by the pilot.
    0
    Comment actions Permalink
  • Vlad Groshkov

    The main scenario right now is:

    1. Turn on RC;
    2. Turn on Aircraft;
    3. Connect to Cloud API by using DJI Pilot;

    The problem, which can be reproduced in 50%: we can't have this telemetry, but we want to have it always after  connect to Cloud API, when Aircarft connected for showing this telemetry to the user.

    0
    Comment actions Permalink
  • DJI Developer Support
    Ok, I will submit this issue as a bug to R&D colleagues for processing.
    0
    Comment actions Permalink
  • Vlad Groshkov

    Any updates from R&D?

    0
    Comment actions Permalink
  • DJI Developer Support
    We have confirmed this issue and submitted it as a bug to our R&D colleagues, who are currently troubleshooting the issue.
    0
    Comment actions Permalink
  • DJI Developer Support
    I'm sorry to let you know that your issue won't be addressed for the time being. Currently, due to performance considerations, our Cloud API is designed only to send data to the cloud and doesn't provide an interface for proactive queries. We appreciate your understanding in this matter.
    0
    Comment actions Permalink

Please sign in to leave a comment.