lglaf icon indicating copy to clipboard operation
lglaf copied to clipboard

IOError: [Errno 2] No such file or directory: u'COM11'

Open BehindTheMath opened this issue 8 years ago • 10 comments

When I clone the repo and run python lglaf.py, I get the following error:

Traceback (most recent call last):
  File "lglaf.py", line 404, in <module>
    main()
  File "lglaf.py", line 382, in main
    comm = autodetect_device()
  File "lglaf.py", line 314, in autodetect_device
    return FileCommunication(serial_path)
  File "lglaf.py", line 187, in __init__
    self.f = open(file_path, 'r+b')
IOError: [Errno 2] No such file or directory: u'COM11'

I'm running Python 2.7 on Windows 10 x64, with an LG G5 (H830).

BehindTheMath avatar Jul 16 '17 20:07 BehindTheMath

I have not tested this with Windows 10, but in theory it should work if you have drivers installed. Is that the case? (See README)

Lekensteyn avatar Jul 16 '17 21:07 Lekensteyn

I have driver v4.2.0 installed. LGUP recognizes it, as well as Windows in My Computer.

BehindTheMath avatar Jul 16 '17 21:07 BehindTheMath

Can you try with Python 3?

Lekensteyn avatar Jul 16 '17 22:07 Lekensteyn

Python 3.6.1

Almost the same error:

Traceback (most recent call last):
  File "lglaf.py", line 404, in <module>
    main()
  File "lglaf.py", line 382, in main
    comm = autodetect_device()
  File "lglaf.py", line 314, in autodetect_device
    return FileCommunication(serial_path)
  File "lglaf.py", line 185, in __init__
    self.f = open(file_path, 'r+b', buffering=0)
FileNotFoundError: [Errno 2] No such file or directory: 'COM11'

BehindTheMath avatar Jul 17 '17 01:07 BehindTheMath

@BehindTheMath Com port number need <10

lamloanmobile avatar Aug 14 '17 14:08 lamloanmobile

@lamloanmobile I tried it with Windows 10 x64 with an LG G3 (d850) manually set to COM2. Same error:

Traceback (most recent call last):
  File "lglaf.py", line 404, in <module>
    main()
  File "lglaf.py", line 382, in main
    comm = autodetect_device()
  File "lglaf.py", line 314, in autodetect_device
    return FileCommunication(serial_path)
  File "lglaf.py", line 185, in __init__
    self.f = open(file_path, 'r+b', buffering=0)
FileNotFoundError: [Errno 2] No such file or directory: 'COM2'

BehindTheMath avatar Aug 15 '17 13:08 BehindTheMath

@BehindTheMath i do it ok LG V20 7.0

F:\LG\lglaf-master>python lglaf.py --unlock --debug LGLAF.py: DEBUG: Using serial port: COM9 LGLAF.py: DEBUG: Challenge: 78:e4:25:3a LGLAF.py: DEBUG: Response: 4d:6f:97:77:55:d3:ed:f4:bc:b2:d1:8f:f2:51:a3:f7 LGLAF.py: DEBUG: Hello done, proceeding with commands LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf) Type a shell command to execute or "exit" to leave.

lamloanmobile avatar Aug 21 '17 15:08 lamloanmobile

Hi. I have the same issue. Windows 10 x64. Both Python 2 or Python 3, same error. Any suggestion? Thanks

giuseppegimo avatar Oct 21 '17 13:10 giuseppegimo

Fixed this on https://github.com/steadfasterX/lglaf/pull/9 Tested on windows 64 and python 3

kenkit avatar Mar 01 '19 13:03 kenkit

For me I just changed the FileCommunication ctor from:

def __init__(self, file_path):
        super(FileCommunication, self).__init__()
        if sys.version_info[0] >= 3:
            self.f = open(file_path, 'r+b', buffering=0)
        else:
            self.f = open(file_path, 'r+b')

to:

def __init__(self, file_path):
        super(FileCommunication, self).__init__()
        if sys.version_info[0] >= 3:
            self.f = open('\\\\.\\'+file_path, 'r+b', buffering=0)
        else:
            self.f = open('\\\\.\\'+file_path, 'r+b')

ivanjx avatar Apr 23 '19 15:04 ivanjx