'Microsoft Point of Service - PosPrinter.FromIdAsync Returns "A device attached to the system is not functioning"

I'm trying to use MS PosPrinter into UWP app, my Epson Tm-T20II printer is installed and can print using Epson oPos setup utility.

Even I installed the full windows driver and it works.

My problem comes when I run this:

DevicePicker devicePicker = new DevicePicker();
devicePicker.Filter.SupportedDeviceSelectors.Add(PosPrinter.GetDeviceSelector());

// Anchor the picker on the Find button.
GeneralTransform ge = FindButton.TransformToVisual(Window.Current.Content as UIElement);
Rect rect = ge.TransformBounds(new Rect(0, 0, FindButton.ActualWidth, FindButton.ActualHeight));

DeviceInformation deviceInfo = await devicePicker.PickSingleDeviceAsync(rect);
rootPage.deviceInfo = deviceInfo;
PosPrinter printer = null;
if (deviceInfo != null)
{
    printer = await PosPrinter.FromIdAsync(deviceInfo.Id);
}

await PosPrinter.FromIdAsync(deviceInfo.Id) always return:

System.Exception: 'A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)'

This is my test from oPos setup.

enter image description here

Some Idea about this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source