Serial Port null from SerialDevice.FromIdAsync(dis[0].Id) with windows UWP & FTDI adapter
Whilst on a laptop the following code fails whereas it is working on the RPi2. The serial port is provided by a USB to serial adapter, a USB FTDI adapter.
var aqsFilter = SerialDevice.GetDeviceSelector();var dis = await DeviceInformation.FindAllAsync(aqsFilter);serialPort = await SerialDevice.FromIdAsync(dis[0].Id);
serialPort is null when a break point is put after the last line, but is correct when running the RPi2.
I updated the driver in device manager for the adapter, but it still failed. After following several other posts on the internet and failing I then, after an hour or so discovered the following stack overflow post:
Connecting to FT232R USB UART device in Windows Runtime 8.1
The key was to also update the USB Serial Converter as well as the COM driver. Do this by uninstalling the driver after right clicking it. Make certain that the check box is selected to delete the driver.
Scan for hardware changes will then install an updated driver that allows the serial port to be found by ID.
So running the original code it now finds the serial port as expected.