Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24551

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

From Grant Edwards <invalid@invalid.invalid>
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 22:18 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <jsg0sj$4t9$1@reader1.panix.com> (permalink)
References (7 earlier) <jsfhv2$ta9$1@dont-email.me> <jsfr3i$p6d$1@dont-email.me> <jsftah$bb5$1@reader1.panix.com> <jsfv3v$imr$1@dont-email.me> <jsg05u$mgk$1@reader1.panix.com>

Cross-posted to 2 groups.

Show all headers | View raw


On 2012-06-27, Grant Edwards <invalid@invalid.invalid> wrote:
> On 2012-06-27, Adam <adam@no_thanks.com> wrote:
>> "Grant Edwards" <invalid@invalid.invalid> wrote:

>>> Why do you need to open it a second time?
>>
>> As far as I can tell, the wireless hardware connected to the
>> USB-to-serial converter is receiving data (which may have the serial
>> port open?).  I can see the data being received in TeraTerm (using
>> COM4).  After closing TeraTerm, I start up the Python script and get
>> the following error message ...
[...]
>> Searching for similar encounters of this error message, some people
>> said that calling ser.close() before ser.open() solved the problem.
>> And, it worked for me as well.
>>
>> Is this considered a chicken & egg situation?
>
> Can you post a small example showing what you're doing?

The best way to get help is to write as small a program as possible
that demonstrates the problem, and post it.  I'll help you get
started...

Does this program work?

    import serial
    ser = serial.Serial("COM4")
    ser.close()

At the moment, I don't have access to a Windows machine, but I think
the above should run without any errors.  If it works, then you've
successfully opened and closed the COM4 port.  Start adding
"features", in increments as small as possible, until the program
fails.

Then try to remove stuff that's not needed while still keeping the
failure.

IOW, try to find the smallest possible program that fails.

Usually, in the process of doing that, you'll figure out what you were
doing wrong.  If not, post the smallest failing program you can come
up with, and somebody will be able to help.

If you won't show us what you're doing, we can't tell you what you're
doing wrong.

-- 
Grant Edwards               grant.b.edwards        Yow! Gee, I feel kind of
                                  at               LIGHT in the head now,
                              gmail.com            knowing I can't make my
                                                   satellite dish PAYMENTS!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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