PySerial could not open port COM4: [Error 5] Access is denied - please help

Adam adam at no_thanks.com
Wed Jun 27 16:40:19 EDT 2012


"Paul" <nospam at needed.com> wrote in message 
news:jsfhv2$ta9$1 at dont-email.me...
> Adam wrote:
>
>>
>> This is a tough one.
>
> Try
>
>    handle -a > allhand.txt
>
> Then open the allhand.txt with Notepad and look for interesting entries.
>
> *******
>
> I tested right now, and first opened a session in HyperTerminal with one
> of my USB to serial adapters. The second serial adapter, is connect to a
> UPS, looking for a shutdown message. So the second entry should be present
> at all times.
>
> hypertrm.exe pid: 3452
> ...
>   120: File  (---)   \Device\VCP1
>
>
> ups.exe pid: 1568 NT AUTHORITY\SYSTEM
> ...
>    98: File  (---)   \Device\VCP0
>
> I don't have any "serial" entries on this machine. But one of
> my other machines, has a real COM port on the SuperI/O chip,
> so the entries for that would involve the word "serial" in some
> way. The USB ones, at least the ones I've got, say VCP. Possibly
> because one of the driver files sets up virtual COM ports. There
> is a control panel for the driver, that maps a virtual COM port,
> to a COM port number, like COM3 and COM4 in this case.
>
>   Paul


Thanks (Guru Paul), you're the best.  I think we may have something this 
time ...

  144: File  (---)   \Device\ProlificSerial3

And, TeraTerm (using COM4) is open and receiving data wirelessly.

>From the output generated by "handle -a", here's the section for TeraTerm 
...
------------------------------------------------------------------------------
ttermpro.exe pid: 3648 VBOX_WINXPPRO\adam        (claims to use COM4)
    4: KeyedEvent    \KernelObjects\CritSecOutOfMemoryEvent
    8: Directory     \KnownDlls
    C: File  (RW-)   D:\downloads\Tera Term Pro\ttpro313
   10: Event
   14: Directory     \Windows
   18: Port
   1C: WindowStation \Windows\WindowStations\WinSta0
   20: Desktop       \Default
   24: WindowStation \Windows\WindowStations\WinSta0
   28: Directory     \BaseNamedObjects
   2C: Section       \BaseNamedObjects\ttset_memfilemap
   30: Semaphore
   34: Semaphore
   38: Key           HKLM
   3C: Event
   40: Semaphore 
\BaseNamedObjects\shell.{A48F1A32-A340-11D1-BC6B-00A0C90312E1}
   44: File  (RW-) 
C:\WINDOWS.0\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
   48: File  (---)   \Device\KsecDD
   4C: Key           HKCU
   50: Key           HKCU\CLSID
   54: File  (RW-) 
C:\WINDOWS.0\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86
   58: Mutant
   5C: Event         \BaseNamedObjects\crypt32LogoffEvent
   60: Event
   64: Mutant
   68: Event
   6C: Event
   70: Section 
\BaseNamedObjects\_ISWINTERNAL_EPT32_SHEX_K32_0_1c9aa25ea688500_7c80_S-1-5-21-1801674531-1078145449-1957994488-1004
   74: Event
   78: File  (RWD)   C:\DOCUME~1\adam\LOCALS~1\Temp\IswTmp\Logs\ISWSHEX.swl
   7C: Semaphore
   80: Semaphore
   84: Semaphore
   88: Semaphore
   8C: Semaphore
   90: Semaphore
   94: Semaphore
   98: Semaphore
   9C: Semaphore
   A0: Semaphore
   A4: Semaphore
   A8: Semaphore
   AC: Section 
\BaseNamedObjects\_ISWINTERNAL_EPT32_SHEX_A32_0_1c98aa70f70ec00_77dd_S-1-5-21-1801674531-1078145449-1957994488-1004
   B0: Port
   B4: Section
   B8: Key           HKCU
   BC: Mutant 
\BaseNamedObjects\CTF.LBES.MutexDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
   C0: File  (---)   \Device\Tcp
   C4: File  (---)   \Device\Tcp
   C8: File  (---)   \Device\Ip
   CC: File  (---)   \Device\Ip
   D0: File  (---)   \Device\Ip
   D4: Semaphore
   D8: Semaphore
   DC: Key           HKLM\SYSTEM\ControlSet001\Services\Tcpip\Linkage
   E0: Key           HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters
   E4: Key 
HKLM\SYSTEM\ControlSet001\Services\NetBT\Parameters\Interfaces
   E8: Key           HKLM\SYSTEM\ControlSet001\Services\NetBT\Parameters
   EC: Thread        ttermpro.exe(3648): 3684
   F0: Event
   F4: Key 
HKLM\SYSTEM\ControlSet001\Services\WinSock2\Parameters\Protocol_Catalog9
   F8: Event
   FC: Key 
HKLM\SYSTEM\ControlSet001\Services\WinSock2\Parameters\NameSpace_Catalog5
  100: Section 
\BaseNamedObjects\CiceroSharedMemDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  104: Key           HKLM\SOFTWARE\Microsoft\SystemCertificates\My
  108: File  (RW-)   D:\downloads\Tera Term Pro\ttpro313\httplog.log
  10C: Mutant 
\BaseNamedObjects\CTF.Compart.MutexDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  110: Mutant 
\BaseNamedObjects\CTF.Asm.MutexDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  114: Mutant 
\BaseNamedObjects\CTF.Layouts.MutexDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  118: Mutant 
\BaseNamedObjects\CTF.TMD.MutexDefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  11C: Mutant 
\BaseNamedObjects\CTF.TimListCache.FMPDefaultS-1-5-21-1801674531-1078145449-1957994488-1004MUTEX.DefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  120: Section 
\BaseNamedObjects\CTF.TimListCache.FMPDefaultS-1-5-21-1801674531-1078145449-1957994488-1004SFM.DefaultS-1-5-21-1801674531-1078145449-1957994488-1004
  124: Mutant        \BaseNamedObjects\ShimCacheMutex
  128: Section       \BaseNamedObjects\ShimSharedMemory
  12C: Mutant        \BaseNamedObjects\MSCTF.Shared.MUTEX.IN
  130: Event         \BaseNamedObjects\ReadEnd4
  134: Event
  138: Section       \BaseNamedObjects\MSCTF.Shared.SFM.IN
  13C: Event         \BaseNamedObjects\Write4
  140: Event         \BaseNamedObjects\ReadEnd4
  144: File  (---)   \Device\ProlificSerial3
  148: Event         \BaseNamedObjects\Read4
  14C: Thread        ttermpro.exe(3648): 272
  150: Section       \BaseNamedObjects\MSCTF.Shared.SFM.EGO
  154: Event
  158: Mutant        \BaseNamedObjects\MSCTF.Shared.MUTEX.EGO
------------------------------------------------------------------------------


The Python script needed a call to ser.close() before ser.open() in order to 
work.
Yes, that's right ... things are working fine now.    :-)





More information about the Python-list mailing list