USBSerial COM-port "access denied"

19 Dec 2017

Hey Guys,

first of all i'm new to this topic so please be patient with me. :)

I got a python script (Spyder of Python 3.5) (and Windows 7) and want to communicate over a virtual COM-Port (USB-cable) with my mbed MC. I got it as that far, that it works.

But my problem is that i doesn't work constantly. Nearly every second time (statistically) an error occurs where python says:

/media/uploads/Biochrome/port-fehler2.png

The major fault is in the last lines. "Zugriff verweigert" means "access denied" in english. When i try to start the script a few times after this the error is gone and ist working normally until it occures the next time randomly.

I thought that i maybe forgot to install an extra driver to configure my port with "https://os.mbed.com/handbook/Windows-serial-configuration" but this didn't help.

I already tried to reinstall the Serial driver (.inf-File) from "https://os.mbed.com/handbook/USBSerial" too, but that didn't help either. My device shows up as "CDC-device" in the device manager, when it got no driver installed. With driver it's something like "mbed ..."

An other idea has been, that i gave too little time to close/open the port when i communicate but even with a time.sleep of two seconds the error occurs.

Does anyone got the same issue or an idea how to solve this?

Thanks in advance,

Manuel

20 Dec 2017

Hi Manuel,

Does the problem occur as well if you use a serial tool like Putty ?

Some USB gadgets (heart rate monitors, weather stations etc..) use serial over USB to communicate with the PC. The accompanying software will sometime periodically scan all serial ports and try to detect a device. During this time the port is not available for other programs. You can try to disable this software or disable the scanning in the software.

Kind regards, Ivo

20 Dec 2017

Hi,

Thanks for the reply!

It looks to be the same problem in Putty too... I open COM7 with 115200 and it connect sometimes and sometimes not. Randomly.

Your approch seems logical to me . How do i find out wich programm disturbes? Like with Portmon or sth.? Can i prevent the error when i configure the port to COM255 or is the list scanned normally to its end?

Regards, Manuel