Retrieving "serious_low_battery_warning_threshold" and "low_battery_warning_threshold" via Cloud API
CompletedDear DJI Support Team,
I hope this message finds you well. We are currently facing an issue related to the "serious_low_battery_warning_threshold" and "low_battery_warning_threshold" telemetry fields when an aircraft is initially connected to the Cloud API.
These two telemetry fields are of critical importance to our application, as they provide valuable data for our operations. However, we've encountered a challenge in retrieving these values. These fields are state telemetries, and they only seem to update when the user manually changes them in DJI Pilot.
Our primary inquiry is whether there is a method, topic, or workaround available via the Cloud API to obtain these values without relying on manual user intervention. We are particularly interested in accessing these properties through MQTT topics, if such topics exist.
Your assistance in resolving this issue or providing insights into available workarounds is highly appreciated. We rely on this telemetry data for our application's functionality and user experience, and we are eager to find a solution.
Thank you for your prompt attention to this matter.
-
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. -
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 -
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"
} -
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. -
The main scenario right now is:
- Turn on RC;
- Turn on Aircraft;
- 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.
-
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.
Please sign in to leave a comment.
Comments
14 comments