Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 api\index.py failed #29

Open
Blaise-wig opened this issue Mar 12, 2024 · 4 comments
Open

python3 api\index.py failed #29

Blaise-wig opened this issue Mar 12, 2024 · 4 comments

Comments

@Blaise-wig
Copy link

Hello, when I run python3 api\index.py, I get this error

(DroneControl) C:\Users\Victus\anaconda3\envs\DroneControl\Mocap-Drones-main\computer_code>python api\index.py

  • Serving Flask app 'index'
  • Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on http://127.0.0.1:3001
    Press CTRL+C to quit
  • Restarting with stat
    Traceback (most recent call last):
    File "C:\Users\Victus\anaconda3\envs\DroneControl\Mocap-Drones-main\computer_code\api\index.py", line 22, in
    ser = serial.Serial("COM12", 115200, write_timeout=1, )
    File "C:\Users\Victus\anaconda3\envs\DroneControl\lib\site-packages\serial\serialwin32.py", line 33, in init
    super(Serial, self).init(*args, **kwargs)
    File "C:\Users\Victus\anaconda3\envs\DroneControl\lib\site-packages\serial\serialutil.py", line 244, in init
    self.open()
    File "C:\Users\Victus\anaconda3\envs\DroneControl\lib\site-packages\serial\serialwin32.py", line 64, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
    serial.serialutil.SerialException: could not open port 'COM12': PermissionError(13, 'Access is denied.', None, 5)

I connected the esp32 to COM12 and made sure no other program is using the port. I have been trying to resolve this for two days now. can anyone help?

@jyjblrd
Copy link
Owner

jyjblrd commented Mar 12, 2024

PermissionError(13, 'Access is denied.', None, 5)

Have you tried running with sudo? ie. sudo python3 api\index.py

@jyjblrd
Copy link
Owner

jyjblrd commented Mar 12, 2024

Also make sure that your arduino ide / whatever you are using to program the ESP32 is closed, because it could also be connecting to the port.

@Blaise-wig
Copy link
Author

I'm on windows. But I ran it as administrator. I also closed the arduino IDE but the error still persisted.

@clennpillo
Copy link

weird windows permission problem, I gave up windows and tried WSL, it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants