open-tl866 icon indicating copy to clipboard operation
open-tl866 copied to clipboard

AClient will not work on Windows

Open RobertBaruch opened this issue 6 years ago • 3 comments

TLDR: Unless you're a Windows expert and know how to fix this, explicitly document that we do not support Windows.

AClient needs to open a COM port, but on Windows you need Administrator privilege to do that. And apparently even when you run a python script under Admin, it still refuses to open a com port, with error "Permission denied".

To test this, open a command prompt as admin (right click on command prompt, open as administrator), run python, and:

import os os.open("\\.\COM", os.O_RDWR)

(Yes, you need all that backslash magic because Windows)

That will actually work. However, running otl866 will not, because otl866 is an exe, and I guess Windows trashes the permissions.

RobertBaruch avatar Dec 30 '18 03:12 RobertBaruch

The core functions should abstract pexepect under the hood pretty well. I imagine we could write a generic pexpect replacement pretty easily just using pyserial read() and buffering it ourselves. The biggest drawback would be that we'd loose select and consume more CPU (at least on Windows)

JohnDMcMaster avatar Dec 30 '18 05:12 JohnDMcMaster

Can we consolidate the other issues into this one? Seems like the core issue, and having the others open may make this difficult to track

JohnDMcMaster avatar Dec 30 '18 05:12 JohnDMcMaster

Well, I think this is really the only issue -- opening a COM port on Windows in Python via a script installed through setup.py -- and it's a bit of a tough nut to crack. Apparently even my Google-fu isn't good enough to find a workable solution to this one.

I've closed the other issue #67 .

RobertBaruch avatar Dec 30 '18 18:12 RobertBaruch