-
Notifications
You must be signed in to change notification settings - Fork 54
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
Serial error - Permission denied when accessing COM port and script silently exiting on Windows #21
Comments
I believe this access denied error may in fact be spurious and actually caused by another error as indicated in Issue #5. I believe it is caused by mqtt connection failing. Then the serial connection subsequently fails. If I disable the mqtt code the script runs for a little while. It sends some keyboard mapping commands. Which are successfully received by the keyboard. Then the script exits with no exception. Any advice on how to get this working on Windows would be greatly appreciated. Likewise if anyone has some working code I would be very appreciative. |
I am afraid that I will not be of much help with Windows-specific problems and especially how to set up Python on Windows (in my Linux world, installing Python is a one-liner). |
Thanks Sebastian. I have just got to the bottom of this problem. The permission error on the COM port is indeed spurious. Whenever another error occurs it will generate this error. Usually the root cause of the problem can be found by enabling debug mode. AttributeError: 'FreeTypeFont' object has no attribute 'getsize' The suggested solution is to downgrade to Pillow 9.5.0. However it appears that Pillow 9.5.0 has a bug where it will just silently exit when this method is called. I tried downgrading further however anything less than 9.5.0 is not compatible with Python 3.12. So I was stuck. Replace line 208: with: Replace line 210: with: |
Reopening as it is not yet fixed in the repo - as a reminder for me to fix it and so others who might run into it can find it easily. |
I am trying to get the Python controller running on a Windows machine. when I run controller.py it appears to connect to the keypad successfully. It retrieves the info from the keypad. However when it enters the main loop I get the following error:
Error: <class 'AttributeError'>
I will retry in three seconds...
Connecting to COM6 .
Serial error: could not open port 'COM6': PermissionError(13, 'Access is denied.', None, 5)
If I enable debug mode I get the following traceback:
Traceback (most recent call last):
File "D:\Downloads\DIY\Macro Keypad\inkkeys-main\python-controller\controller.py", line 110, in tryUsingPort
work() #Success, enter main loop
^^^^^^
File "D:\Downloads\DIY\Macro Keypad\inkkeys-main\python-controller\controller.py", line 85, in work
pollInterval = mode.poll(device)
^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'poll'
Any assistance that you can offer would be appreciated.
The text was updated successfully, but these errors were encountered: