Hello,
i am running a python code to read the data from the serial print of the arduino.
i generally work in linux, and the code did work correctly without issues. but when i brought the arduino to a windows pc at work i can not make it work.
the line that fails is this one:
self.serial_port = serial.Serial(port, serialBaud, timeout=1)
port=='COM3'
i can see that the COM3 is the correct one.
- i dont have the arduino IDE open when running the script
- if i open i can see the serial print for com3
- i tried going into the device adiminitrator desactivate the com3, wait, re activate it
- i tried to change the com number of the arduino
- i tried running inside python debugging from vscode
- i tried running from python from powershell
- i tried 5 and 6 as admin
non of this gave a solution.
i am always getting:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.1520.0_x64__qbz5n2kfra8p0\Lib\tkinter\__init__.py", line 2068, in __call__
return self.func(*args)
~~~~~~~~~^^^^^^^
File "C:\Users\PC PBR\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
self._command()
~~~~~~~~~~~~~^^
File "C:\Users\PC PBR\Desktop\franco\tempV4.py", line 265, in start
self.serial_port = serial.Serial(port, serialBaud, timeout=1)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PC PBR\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\serial\serialwin32.py", line 33, in __init__
super(Serial, self).__init__(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\PC PBR\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\serial\serialutil.py", line 244, in __init__
self.open()
~~~~~~~~~^^
File "C:\Users\PC PBR\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\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 'COM3': PermissionError(13, 'Accès refusé.', None, 5)
any solution would be appreciated. i am using windows 10 and python 3.13.5