Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!204.52.135.9.MISMATCH!newsfeed.hal-mli.net!feeder1.hal-mli.net!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python,microsoft.public.windowsxp.general Subject: Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Date: Wed, 27 Jun 2012 14:53:37 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 50 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1340808817 29161 64.122.56.22 (27 Jun 2012 14:53:37 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 27 Jun 2012 14:53:37 +0000 (UTC) User-Agent: slrn/pre1.0.0-18 (Linux) X-Received-Bytes: 2948 Xref: csiph.com comp.lang.python:24519 On 2012-06-27, David H. Lipman wrote: > From: "Adam" >> "John Nagle" wrote in message >> news:jse604$1cq$1@dont-email.me... >>> On 6/26/2012 9:12 PM, Adam wrote: >>>> Host OS: Ubuntu 10.04 LTS >>>> Guest OS: Windows XP Pro SP3 >>>> >>>> I am able to open port COM4 with Terminal emulator. >>>> >>>> So, what can cause PySerial to generate the following error ... >>>> >>>> C:\Wattcher>python wattcher.py >>>> Traceback (most recent call last): >>>> File "wattcher.py", line 56, in >>>> ser.open() >>>> File "C:\Python25\Lib\site-packages\serial\serialwin32.py", line 56, in open >>>> raise SerialException("could not open port %s: %s" % (self.portstr, >>>> ctypes.WinError())) >>>> serial.serialutil.SerialException: could not open port COM4: [Error 5] >>>> Access is denied. >>> >>> Are you trying to access serial ports from a virtual machine? Which >>> virtual machine environment? Xen? VMware? QEmu? VirtualBox? I >>> wouldn't expect that to work in most of those. Except he says it _does_ work with his terminal emulator. >>> What is "COM4", anyway? Few machines today actually have four >>> serial ports. Is some device emulating a serial port? It shouldn't matter. If other apps can open COM4, then pyserial should be able to open COM4. >> Thanks, and yes, I am using VirtualBox. My laptop does not have a >> serial port so I use a USB-to-serial converter, which is assigned >> COM4. > > Then it is a Virtual COM port. Often software will want to > communicate directly to the COM4 port which is usually at: IRQ3 and > I/O 2E8h. Pyserial doesn't do that. It uses the standard win32 serial API, and it should work just fine with any Win32 serial device (what you call a "virtual" COM port). -- Grant Edwards grant.b.edwards Yow! World War III? at No thanks! gmail.com