?

Log in

No account? Create an account
recent stories superwonderfulous peoples pick a day, any day! who, me? go back in time! go back in time! move boldly ahead! move boldly ahead!
Ldy, the lemony, ligerish ducttaparian's Magic Treehouse of Lost Thoughts
A classy broad's life... with footnotes.
ldy
ldy
Python help, please!!
14 tall tales or Tell me a story
Comments
hitchhiker From: hitchhiker Date: December 15th, 2009 11:24 am (UTC) (permalink)
PIL: http://www.pythonware.com/products/pil/

as for the serialexception, try running the script as Administrator and see if that helps.

also read http://www.ni.com/support/serial/verhyper.htm and http://forums.adafruit.com/viewtopic.php?f=19&t=13421

basically you're now running into a windows or hardware issue, not a python one
ldy From: ldy Date: December 15th, 2009 10:48 pm (UTC) (permalink)
You are correct, of course.

PIL didn't help. And I've already got Admin priv on this account. Echoing through hyperterminal confirmed that the COM port was the issue.

I poked around my event viewer and found the following, at approximately the times I was attempting access:

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
{BC866CF2-5486-41F7-B46B-9AA49CF3EBB1}
to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19). This security permission can be modified using the Component Services administrative tool.

However, while I could find the friendly name for the CSID in question in regedit (NSVCAP~1.EXE, it's apparently an nvidia networking thingamajig), I could not find the offending program by either friendly name or CSID in component services --> DCOM Config to change permissions.

Le sigh! Stupid rabbit hole ;)

Any other advice, oh wise one?
From: (Anonymous) Date: January 9th, 2010 02:45 am (UTC) (permalink)
HI. I have a bodybugg and am trying to clear the data using the hack.

I'm having the same problem with the program not being about to open the COM port.

Have you found an answer?

Good luck.
From: (Anonymous) Date: March 6th, 2010 08:22 pm (UTC) (permalink)
repost from the bmhack blog:

To fix the Access Denied problem:

in the script, right before
ser.open()

add this:

ser.close()

The script will look like this:

def OpenSerial(fname="/dev/ttyUSB0"):
ser=serial.Serial(fname,baudrate=921600,timeout=.01)
ser.close()
ser.open()

Works on Win7 64bit Ultimate... Didn't have to do this on Vista 64bit.
ldy From: ldy Date: March 28th, 2010 10:22 pm (UTC) (permalink)
Well, it did clear up the Access Denied issue. Now if it could only find the file... (sigh!)

THIS CODE IS DECLARED BY THE AUTHOR TO BE IN THE PUBLIC DOMAIN.
NO WARRANTY EXPRESSED OR IMPLIED OF ANY KIND IS PROVIDED.
Traceback (most recent call last):
File "C:\python26\scripts\bmhack-z718b.py", line 1180, in
sys.exit(main())
File "C:\python26\scripts\bmhack-z718b.py", line 1101, in main
ser = OpenSerial(dopts["--fromSerial"])
File "C:\python26\scripts\bmhack-z718b.py", line 87, in OpenSerial
ser=serial.Serial(fname,baudrate=921600,timeout=.01)
File "C:\python26\lib\site-packages\serial\serialutil.py", line 192, in __init
__
self.open()
File "C:\python26\lib\site-packages\serial\serialwin32.py", line 53, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
inError()))
serial.serialutil.SerialException: could not open port COM7:: [Error 2] The syst
em cannot find the file specified.
ldy From: ldy Date: March 28th, 2010 10:27 pm (UTC) (permalink)
HA! I'm a dork. It assigned it a different COM port this time and I just didn't notice. Works with the fix (and the correct COM port!) :D
From: (Anonymous) Date: March 25th, 2010 02:53 pm (UTC) (permalink)

Did you get it working?

Idy,
Were you successful? I would love to know.

Best Regards,
Fly
ldy From: ldy Date: March 28th, 2010 10:28 pm (UTC) (permalink)

Re: Did you get it working?

Yes, yes I did :)

And thanks for jogging my memory-- I just went through a big move (and a lot of other changes in my life) and this little project got forgotten.
14 tall tales or Tell me a story