Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #24506
| From | Paul <nospam@needed.com> |
|---|---|
| Newsgroups | comp.lang.python, microsoft.public.windowsxp.general |
| Subject | Re: PySerial could not open port COM4: [Error 5] Access is denied - please help |
| Date | 2012-06-27 08:28 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <jseu9c$sp3$1@dont-email.me> (permalink) |
| References | <jse17v$d5n$1@dont-email.me> <jse604$1cq$1@dont-email.me> <jseim6$tn7$1@dont-email.me> |
Cross-posted to 2 groups.
Adam wrote:
> "John Nagle" <nagle@animats.com> 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 <module>
>>> 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.
>>
>> What is "COM4", anyway? Few machines today actually have four
>> serial ports. Is some device emulating a serial port?
>>
>> John Nagle
>>
>
> 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.
>
>
Doesn't VirtualBox allow "remapping" serial ports ? I thought you
could have COM 4 in the host OS, and make it COM 1 or COM 2 in
the guest. Something like that.
http://virtuatopia.com/images/6/60/Virtualbox_serial_port_settings.jpg
Also, Windows (as a host), is notorious for stealing control of
COM ports. Even Windows software, when you run it, would report
"COM 4 is busy". Then, you have to track down *why* it's busy.
Is it that FAX software you installed ? The GPS software
that talks to your GPS serial interface ?
In theory, the "Handle" program is supposed to identify what
is keeping a COM port busy, but I don't get the desired
results from it very often. You need to know the naming
convention for virtual COM ports (COM4 via USB to serial, is
more virtual than physical). That's what makes it harder
to track down.
These are some names for COM ports, in Windows. The last two entries,
are my USB to serial adapters. VCP1 functions as COM3.
VCP0 functions as COM4. The VCP part is what would be
listed in "Handle" from Sysinternals. The \device\serial
format, is more likely to be used with true "native"
motherboard serial ports.
\device\serial
ups.exe pid: 1072 NT AUTHORITY\SYSTEM
98: File (---) \Device\VCP0
hypertrm.exe pid: 3404 ComputerName\UserID (claims to use COM3)
E0: File (---) \Device\VCP1
You can download "Handle" and play with it here.
http://technet.microsoft.com/en-us/sysinternals/bb896655
Note that, in my Handle results, at the time I was running
the Windows provided ups.exe to talk to my external UPS
(uninterruptible power supply). So that's what that
reference is. The "hypertrm" one, is me using the
built-in Windows terminal software, to talk to COM3,
to keep the port artificially busy for the purposes
of testing.
If things were working well in your case, you *might*
see something of this form. If not, you'd instead
see the name of the process that has "stolen" the
com port.
virtualbox.exe pid: 1234 ComputerName\UserID
E0: File (---) \Device\VCP0
HTH,
Paul
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-26 21:12 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help John Nagle <nagle@animats.com> - 2012-06-26 22:33 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 02:10 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 08:28 -0400
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 08:26 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 12:04 -0400
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 10:41 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 14:04 -0400
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 13:40 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 21:18 +0000
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 14:48 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 22:06 +0000
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 22:18 +0000
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Temia Eszteri <lamialily@cleverpun.com> - 2012-06-27 15:31 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 15:51 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 23:24 +0000
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 17:14 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-28 14:15 +0000
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-28 13:31 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Roel Schroeven <roel@roelschroeven.net> - 2012-06-28 21:08 +0200
Re: PySerial could not open port COM4: [Error 5] Access is denied- please help "Adam" <adam@no_thanks.com> - 2012-06-28 14:48 -0700
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "David H. Lipman" <DLipman~nospam~@Verizon.Net> - 2012-06-27 08:28 -0400
Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 14:53 +0000
csiph-web