Issue with RTK Health Status in DJI MSDK
Hello DJI Support,
I am a Kotlin developer working with the DJI MSDK V5 and using RTK functionalities with M350. I am facing an issue where the RTK system reports conflicting states. Here’s my setup:
- I use
callbackFlowto observertkHealthyandRTKServiceState. - I also implement
startRtkCustomNetworkService()andstopRtkCustomNetworkService()to manage RTK connections. - Before calling
stopRtkCustomNetworkService()andstartRtkCustomNetworkService(), I update the RTK network settings usingrtkCenter.customRTKManager.customNetworkRTKSettings = settingswhich sets new values for the server address, port, username, password, and mount point.
When I call stopRtkCustomNetworkService() then startRtkCustomNetworkService(), the logs show that the RTK network transitions as follows:
DISABLEDRTK_START_PROCESSINGREADYTRANSMITTINGTRANSMITTINGagain However, despite the network being inTRANSMITTING, thertkHealthystate remainsfalse. Even after stopping and restarting the RTK service, this value does not change.
Questions:
- Why is
rtkHealthystillfalseeven when the RTK network is inTRANSMITTINGstate? - Is there an additional condition that must be met for
rtkHealthyto becometrue? - Should I wait for a specific event or state transition before expecting
rtkHealthyto update correctly?
Below is my implementation for reference:
Fun stop and start :
private fun stopRtkCustomNetworkService() {
logger.i("RTK trying to stop connection")
rtkCenter.customRTKManager.stopNetworkRTKService(
object :
CommonCallbacks.CompletionCallback {
override fun onSuccess() {
logger.i("RTK Connection stopped")
}
override fun onFailure(error: IDJIError) {
logger.e("RTK failed to stop connection: ${error.description()}")
}
})
}
private fun startRtkCustomNetworkService() {
rtkCenter.customRTKManager.startNetworkRTKService(CoordinateSystem.UNKNOWN, object :
CommonCallbacks.CompletionCallback {
override fun onSuccess() {
logger.i("RTK settings successfully transmitted | Start converging")
}
override fun onFailure(error: IDJIError) {
logger.e("RTK failed connection to network: ${error.description()}")
}
})
logger.i("RTK try start connection with: ${rtkCenter.customRTKManager.customNetworkRTKSettings}")
}
With rtkCenter :
rtkCenter = RTKCenter.getInstance()
Keys information :
val isHealthyFlow = callbackFlow {
val listener = RTKSystemStateListener {
logger.d("isHealthyFlow emitted: ${it.rtkHealthy}")
trySend(it.rtkHealthy).onFailure { error ->
logger.e("Failed to send isHealthyFlow state: $error")
}
}
logger.d("init RTKConnexionObservable")
rtkCenter.addRTKSystemStateListener(listener)
awaitClose { rtkCenter.removeRTKSystemStateListener(listener) }
}
val networkStatusFlow: Flow<RTKServiceState> = callbackFlow {
val listener = object : INetworkServiceInfoListener {
override fun onServiceStateUpdate(state: RTKServiceState) {
scope.launch(Dispatchers.Main) { // Ensure execution on the main thread
logger.d("networkStatusFlow emitted: $state")
trySend(state).isSuccess
}
}
override fun onErrorCodeUpdate(code: IDJIError?) {
logger.e("Failed to send networkStatusFlow state: $code")
}
}
listener.onServiceStateUpdate(RTKServiceState.UNKNOWN)
logger.d("init networkStatusFlow")
rtkCenter.customRTKManager.addNetworkRTKServiceInfoListener(listener)
awaitClose {
rtkCenter.customRTKManager.removeNetworkRTKServiceInfoListener(listener)
}
}
Thank you for your help!
Best regards, Victor
Agent comment from YIGUI LIU in Zendesk ticket #130257:
Dear Developer,
Hello and thank you for reaching out to DJI Innovations.
1、Whether getRTKConnected returns true doesn't necessarily mean the RTK has completed the convergence process and reached the fixed solution. It might still be in the process of convergence.
2、When isRTKHealthy is true, it indicates that both the GPS and RTK signals are healthy, and the RTK signal has good accuracy.
3、You may need to wait until the GPS signal is good and the RTK positioning solution reaches the fixed state.
How can you obtain the RTK positioning solution?
- You can listen through the
RTKLocationInfoListenerto get thepositioningSolutionand check if the RTK positioning calculation result is in the fixed state.
We hope that our solution meets your needs satisfactorily. We appreciate your email and wish you a wonderful day!
Best Regards,
DJI Innovations SDK Technical Support Team
°°°
Hello DJI Support,
I’m encountering an issue when using the stopNetworkRTKService() function. Here’s my implementation:
private fun stopRtkCustomNetworkService() {
logger.i("RTK trying to stop connection")
rtkCenter.customRTKManager.stopNetworkRTKService(
object : CommonCallbacks.CompletionCallback {
override fun onSuccess() {
logger.i("RTK connection stopped")
}
override fun onFailure(error: IDJIError) {
logger.e("RTK failed to stop connection: ${error.description()}")
}
}
)
}
Observed Behavior:
After calling stopRtkCustomNetworkService():
→ My networkStatusFlow Flow<RTKServiceState> indicates DISABLED
→ baseSatellites shows 0 satellites
→ However, isHealthy remains true, even though "Maintain Accuracy Mode" is disabled
Issue:
I would expect isHealthy to become false after stopping RTK, but it still remains true. How can I ensure that the RTK connection is fully stopped so that isHealthy reflects the correct state?
Thank you for your assistance!
Best regards, Victor
Hey @dji-dev , Do you have any news ? Best Regards, Victor