Lekensteyn / lglaf

LG Download Mode utility and documentation
https://lekensteyn.nl/lglaf/
MIT License
137 stars 74 forks source link

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

Open BehindTheMath opened 7 years ago

BehindTheMath commented 7 years ago

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).

Lekensteyn commented 7 years ago

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)

BehindTheMath commented 7 years ago

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

Lekensteyn commented 7 years ago

Can you try with Python 3?

BehindTheMath commented 7 years ago

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'
lamloanmobile commented 7 years ago

@BehindTheMath Com port number need <10

BehindTheMath commented 7 years ago

@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'
lamloanmobile commented 7 years ago

@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.

giuseppegimo commented 7 years ago

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

kenkit commented 5 years ago

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

ivanjx commented 5 years ago

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')