Have an issue managing a SerialPort on Windows 10.
I need to plug in a serial device to the computer, it works properly most of the times, but in certains situations the port stops working, just refuses any new connection even when any process is using it, the device manager shows the port is available (the driver is loaded).
Sometimes the SerialPort is available until I disable the port in the device in Windows DeviceManager, restart the computer and enabling it again. Knowing that I've tried using some Microsoft tools:
- PnPUtil, creating a double click PowerShell script to disable and enable the device. It didn't worked, I had to unplug and plug in physically the serial device. By definition it works with PlugAndPlay devices.
- DevCon, It makes a similiar thing as PnPUtil, but it specifies that works with any devices pluged to the computer. I made a similar script but got the same result.
- Handle, I found out the existence of handles, they're like dependencies linked to a process including a device instance (using driver file). When I get the port unused, I tried searching the handle of the SerialPort ("Device/Serial0"), and none process was using it. it's been detected but blocked in someway.
- ProcessExplorer, this tool is like TaskManager but gives you a detailed view of each processes, including the handles. I confirmed again, the ports is not being used.
Now I'm thinking about some hardware related problem, the serial port is wired as NullModém, which means that only GND, Tx and Rx are connected. so that way of wiring, can't there be any bussines logic problem under RS232, right?
An option could be a driver incompatibility with the motherboard serial port?
Has someone any other ideas that I could try?
Edit: An under/overvoltage could possibly blocked a serial port?