question

ChristopherZielinski-4771 avatar image
0 Votes"
ChristopherZielinski-4771 asked ·

UWP access to COM3 (Serial Port) on Panasonic Tablet (FZ-F1) -

SerialDevice.FromIdAsync( ) is always returning null due to "Access to the device was blocked by the system : \\?\USB#VID_1546&PIC_01A8#5&46E708A&0&10#{86e0d1e0-8089-11d0-9ce4-08003e301f73}"

I did request access to the device in the UWP application manifest...

2516-untitled.png

But, _device is always getting assigned null, in the following code...

 public async Task AttachedToGps()
 {
     const uint baudRate = 9600;
     const ushort dataBits = 8;
     const SerialParity parity = SerialParity.None;
 
     ushort vid = 0x1546;
     ushort pid = 0x01A8;
     var selector = SerialDevice.GetDeviceSelectorFromUsbVidPid(vid, pid);
 
     var devices = await DeviceInformation.FindAllAsync(selector);
 
     if (devices.Any())
     {
         var deviceInfo = devices.First();
 
         _device = await SerialDevice.FromIdAsync(deviceInfo.Id);
 
         _device.BaudRate = baudRate;
         _device.DataBits = dataBits;
         _device.Parity = parity;
 
         _device.ReadTimeout = TimeSpan.FromMilliseconds(500);
         _device.WriteTimeout = TimeSpan.FromMilliseconds(500);
 
         _deviceChannel = new NmeaParser.SerialPortDevice(_device);
     }
     return _deviceChannel;
 }
 

What more do I need to do, to get access to this serial communications device? This source code did work on an older version of the device (and Windows 10 Pro O/S).

Many thanks to anyone that can help!

uwp
untitled.png (18.5 KiB)
· 5
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please check if the device's pid and vid is correct and check the device drive is running, and make sure the device was not been disabled.

0 Votes 0 · ·

hi ChristopherZielinski, do you solve this issue, and do you have any updates for this case

0 Votes 0 · ·

Hacked a workaround (replaced the u-blox serial COM port driver with Microsoft's; captured longitude; latitude; velocity; course; and, satellite count via a .Net Framework Windows service that binary serialized the data to disk for the UWP program to deserialize at fairly frequent intervals).

The hardware Id for the u-blox Virtual COM Port (by default on COM5) is... UBLOXVCP\PNP0501

n.b.: The u-blox GNSS Location Sensor has a PID, VID hardware Id and it is... USB\VID_1546&PID_01A8

Any help would be welcomed and appreciated.

0 Votes 0 · ·

Any updates about this issue? Please feel free to contact us if you have any other questions.

0 Votes 0 · ·

With an older Panasonic FZ-G1 Toughpad tablet, I was able to acquire GPS information from the serial COM3 port after adding the COM port permission in the application's manifest and making the following Windows Registry change...

 [reg add HLKM\SYSTEM\ControlSet001\Control\DeviceOverrides\ACPI#PNP0501\LocationPaths\* /v removable /t REG_DWORD /d 1]

However, I was recently provided with the most recent Panasonic FZ-G1 Toughpad tablet and the GPS chipset(s) were completely updated.

I reached out to both Panasonic and u-blox (the GPS chipset maker), but neither were able to assist. u-blox said that they could not see how they could help.

The u-blox GPS serial COM port driver seems to be a USB-to-COM driver. Both .Net Framework (v4.7.2) and UWP are unable to access the serial COM port when the u-blox drivers are correctly installed.

I have not had time to see if I can acquire the GPS NMEA data directly from the USB driver. The USB approach seems more complicated.

0 Votes 0 · ·

1 Answer

RoyLi-MSFT avatar image
1 Vote"
RoyLi-MSFT answered ·

Hello,

Welcome to Microsoft Q&A!

It seems that Windows.Devices.SerialCommunication.SerialDevice class can't get SerialDevice instance of a virtual COM port. It will return null like the result you got. You could try to use System.IO.Ports.SerialPort class instead. Please refer to this Blog: How to access virtual COM port from UWP app for more information.

Thank you.

· 2 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you so very much!

0 Votes 0 · ·

Note: The provided solution only works if the Panasonic Toughpad u-blox USB-to-COM port driver is replaced by the Microsoft USB Serial Device driver. This modification will disable the Windows Location service, as the complete u-blox driver set is no longer able to participate.

.NET Framework and UWP are unable to open the u-blox serial driver by name ("COM3").

0 Votes 0 · ·