-
Notifications
You must be signed in to change notification settings - Fork 319
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
Comments
Have you tried running with sudo? ie. |
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. |
I'm on windows. But I ran it as administrator. I also closed the arduino IDE but the error still persisted. |
weird windows permission problem, I gave up windows and tried WSL, it worked. |
I was lately trying to run the code on windows10, and solved this permission problem, here is the detail. if you are quite sure you serial port is not occupied by another program which is the situation in my case, but you still ran into the weird permissionerror 13 problem, you may try these steps. first, turn off the reloader function of Flask-SocketIO, as flask-socketio might use your serial port which caused the permission problem. second, create a unique thread for pyserial to operate serial port. here is the code i use
|
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
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Press CTRL+C to quit
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?
The text was updated successfully, but these errors were encountered: