Windows SDK REQUEST_HANDLER_NOT_FOUND error
1558 3 2020-12-5
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_xvTmPyn1HtzQ
lvl.1
Australia
Offline

I am getting an error REQUEST_HANDLER_NOT_FOUND using the Windows SDK.

I have a basic page with one button on it.
Here is my simple code:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using DJI.WindowsSDK.Components;
using DJI.WindowsSDK;
using System.Threading.Tasks;

namespace TestApp
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();

            DJISDKManager.Instance.SDKRegistrationStateChanged += Instance_SDKRegistrationEvent;

            DJISDKManager.Instance.RegisterApp("xxxxxxxxxxxxxxx");            // my real key goes here
        }

        private void Instance_SDKRegistrationEvent(SDKRegistrationState state, SDKError resultCode)
        {
            System.Diagnostics.Debug.WriteLine("Registration: " + resultCode.ToString());        // NO_ERROR is printed to the debug window, so this seems ok.   
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var handler = DJISDKManager.Instance.ComponentManager.GetBatteryHandler(0, 0);

            var voltageResult = handler.GetVoltageAsync();
        }  // break point set on this line
    }
}



Setting a break point after GetVoltageAsync gives me the following output in Intermediate window:

voltageResult
Id = 16, Status = RanToCompletion, Method = "{null}", Result = "DJI.WindowsSDK.ResultValue`1[System.Nullable`1[DJI.WindowsSDK.IntMsg]]"
    AsyncState: null
    CancellationPending: false
    CreationOptions: None
    Exception: null
    Id: 16
    Result: {DJI.WindowsSDK.ResultValue<DJI.WindowsSDK.IntMsg?>}
    Status: RanToCompletion
voltageResult.Result
{DJI.WindowsSDK.ResultValue<DJI.WindowsSDK.IntMsg?>}
    error: REQUEST_HANDLER_NOT_FOUND
    value: null



Can anyone please assist and tell me what I'm missing to get the REQUEST_HANDLER_NOT_FOUND error??

I am connected to my Phantom 4 v2 Pro remote with the green light on the remote indicating connection to my Phantom 4 is ok.
2020-12-5
Use props
kv886
lvl.4

Hong Kong
Offline

Does other function works well except GetVoltageAsync.
2020-12-9
Use props
djiuser_xvTmPyn1HtzQ
lvl.1
Australia
Offline

No functions working. This was just a simple example.
I have also tried GetSerialAsync and same error.
2020-12-10
Use props
kv886
lvl.4

Hong Kong
Offline

It may be that the aircraft and WSDK are not connected
2020-12-11
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules