Page 1 of 1

Windows 10 IoT Core Simple Serial Example not working

Posted: Thu Sep 10, 2015 8:24 am
by rghubert
Hi, I have reproduced this example "to the T" but when I connect to the device I always get a null returned.

Sample and sources used:
https://ms-iot.github.io/content/en-US/ ... Sample.htm

The device (http://www.amazon.com/gp/product/B00LODGRV8 ) is the same one used in the example. The device also appears in the Select Device dialog with the following Id:

\\\\?\\USB#VID_10C4&PID_EA60#0001#{86e0d1e0-8089-11d0-9ce4-08003e301f73}

Once I select and "Connect", this line always returns null.

serialPort = await SerialDevice.FromIdAsync(entry.Id);

I have debugged and my entry.Id is shown as:
Id "\\?\USB#VID_10C4&PID_EA60#0001#{86e0d1e0-8089-11d0-9ce4-08003e301f73}" string

I have also read the complete sample document and checked all the caveats. Why isn't this working for me?

Thanks!

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Thu Sep 10, 2015 3:52 pm
by hellthorne
This is sort of a known issue.

See here: https://social.msdn.microsoft.com/Forum ... after-boot

and here: https://social.msdn.microsoft.com/Forum ... berry-pi-2

the short answer is unplug and then re-plug your serial device after booting the pi. Some have had success if the serrial device is connected after the Pi is completely booted.

I could not get mine to work until i bought a powered USB hub, attached it to the PI, and then attached the serial device after the pi boots.

Lastly, I found a sample on GitHub that works for FTDI serial devices. It works with the device connected at boot, but uses a FTDI specific library, so the Serial Example will not work with it - also, you'll need an FTDI serial device: https://github.com/Jark/FTDISample

HTH

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Thu Sep 10, 2015 7:58 pm
by rghubert
:-) OMG. I'll be right back... Wait - a powered USB-hub for the USB-TTL-adapter side of things, I assume? I have a FTDI USB-RS485 adapter waiting to be used, but no driver for Windows 10 IoT to be found as far as I can see...

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Thu Sep 10, 2015 8:52 pm
by rghubert
Great! After several attempts at plugging in the USB-TTL Adapter at the right moment with a non-usb power supply -- and then standing on my head -- it worked! The NULL-source in the sample finally came up with something other than a null and I was able to transmit data. Many thanks for this tip! ... and OMG!

I'd be interested if anyone ever finds out a way to get the FTDI adapter working.

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Fri Sep 11, 2015 7:22 pm
by hellthorne
rghubert wrote:I'd be interested if anyone ever finds out a way to get the FTDI adapter working.
To be clear, using https://github.com/Jark/FTDISample I am able to read and write to an FTDI USB to serial device.

It has instructions for installing the driver and using the library. It is not compatible with the generic SerialDevice library that the "official" Serial sample uses, but is still pretty easy to understand. I got the library working in my own app in just a couple of hours.

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Fri Sep 11, 2015 8:10 pm
by rghubert
Great. Many thanks! Do you think this driver will also support the FT232RL ( http://wiki.in-circuit.de/images/d/da/610000191A.pdf ) that I have already? I'm searching for the difference between drivers -- if any -- but don't see anything yet.

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Mon Sep 14, 2015 8:11 pm
by hellthorne
rghubert wrote:Great. Many thanks! Do you think this driver will also support the FT232RL ( http://wiki.in-circuit.de/images/d/da/610000191A.pdf ) that I have already? I'm searching for the difference between drivers -- if any -- but don't see anything yet.
Yes. I have the same chipset device. works like a charm.

Re: Windows 10 IoT Core Simple Serial Example not working

Posted: Fri Oct 02, 2015 7:11 pm
by pabasarak
I am using Silicon Labs CP2102 USB to UART Bridge

Here, once the USB is connected, I got roughly 20 seconds to lunch the application. If it done within that time, serialPort will NOT be null and can open the port.

If it gets late than that, serialPort becomes null.

Another thing I have noticed is that, when its null, the Pi is sending some garbage data to the USB to UART. May be that's why I cannot open the port.