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

Could not open port, Access is denied. #15

Closed
Nurech opened this issue Jan 18, 2022 · 2 comments
Closed

Could not open port, Access is denied. #15

Nurech opened this issue Jan 18, 2022 · 2 comments

Comments

@Nurech
Copy link

Nurech commented Jan 18, 2022

Hello. On windows it may ask you permission for USB com's.

Configuration file does not exist: C:\Users\partsjoo\AppData\Local\lego-hub-tk\lego-hub-tk\lego_hub.yaml
2022-01-18 04:57:07,836 INFO App LEGO status app starting up
2022-01-18 04:57:08,054 INFO comm.ConnectionMonitor Starting USB autoconnect detection loop
2022-01-18 04:57:08,055 INFO comm.ConnectionMonitor Starting Bluetooth autoconnect detection loop
2022-01-18 04:57:08,055 WARNING comm.BluetoothConnectionMonitor Not scanning: no BlueTooth address configured
2022-01-18 04:57:08,055 INFO comm.ConnectionMonitor End Bluetooth autoconnect detection loop
2022-01-18 04:57:08,062 INFO comm.HubClient Connecting to hub using COM3
2022-01-18 04:57:08,063 INFO root Connection state change ConnectionState.DISCONNECTED --> ConnectionState.CONNECTING
2022-01-18 04:57:08,064 ERROR comm.HubClient connection change failed: could not open port 'COM3': PermissionError(13, 'Access is denied.', None, 5)
Traceback (most recent call last):
  File "C:\Users\partsjoo\AppData\Local\lego-hub-tk-main\comm\HubClient.py", line 85, in _connection_changed
    conn.open()
  File "C:\Users\partsjoo\AppData\Local\lego-hub-tk-main\comm\SerialConnection.py", line 37, in open
    self._serial.open()
  File "C:\Users\partsjoo\AppData\Local\Programs\Python\Python39\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 'COM3': PermissionError(13, 'Access is denied.', None, 5)
2022-01-18 04:57:08,067 INFO root Connection state change ConnectionState.CONNECTING --> ConnectionState.DISCONNECTED
2022-01-18 04:57:08,069 INFO comm.ConnectionMonitor End USB autoconnect detection loop

It can happen when something is already using HUB while you are trying to connect to it. To fix the problem, stop other programs from using HUB when you are trying to connect.

It seems like basic knowledge to the knowledgeable, but maybe a hit printed somewhere on these lines could be useful.

@smr99
Copy link
Owner

smr99 commented Jan 19, 2022

Thank you! I have never tested on Windows, so I'd be pleased to learn of your success or challenges. Were you able to use the software successfully after stopping the other programs?

@Nurech
Copy link
Author

Nurech commented Jan 19, 2022

Thank you! I have never tested on Windows, so I'd be pleased to learn of your success or challenges. Were you able to use the software successfully after stopping the other programs?

Yes after that it worked fine. I am now in processes of refactoring my code and using this toolkit to upload/run/monitor the code. I am working on Windows to develop the code but I hope to transfer to RPi (Rasp OS) afterwards. Preliminary results are very good, I'll keep using this. Thank you!

@Nurech Nurech closed this as completed Jan 19, 2022
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

2 participants