Octoprint suddenly permission denied on connect on Win10 via python&venv

@Ewald_Ikemann this post is a guide of how to fix the issue should someone else run into this issue, not necessarily asking for help.

2 Likes

Ooops - seems I' not quite awake yet.
I'll move it to -GetHelp -Guides then. (Can't do :cry:)

2 Likes

Done :wink:
@MeSoLost thx for the guide :slight_smile:

1 Like

Thank you. It's still an issue even though. The fix I found isn't a permanent issue and is more annoying to use than just finding what thing i need to give what permissions to in windows because giving everything admin rights just seems to break everything.

1 Like

ok, don't know how to do logs or spoilers -.- if someone wants to let me know what code to use. Still I think this should be the part of the serial log that explains what's going on. Time to do this all again but to be fair, the lights I put on are functional as well as stylish lol (gotta keep positive)

2021-01-19 02:25:45,720 - octoprint.util.comm - INFO - Connecting to port COM10, baudrate 115200
2021-01-19 02:25:45,720 - octoprint.util.comm - ERROR - Unexpected error while connecting to serial port COM10, baudrate 115200 from hook default: SerialException: 'could not open port 'COM10': PermissionError(13, 'Access is denied.', None, 5)' @ comm.py:_open_serial:3666
Traceback (most recent call last):
File "g:\program files\python39\lib\site-packages\octoprint\util\comm.py", line 3666, in _open_serial
serial_obj = factory(
File "g:\program files\python39\lib\site-packages\octoprint\util\comm.py", line 3648, in default
serial_obj.open()
File "g:\program files\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 'COM10': PermissionError(13, 'Access is denied.', None, 5)
2021-01-19 02:25:45,722 - octoprint.util.comm - INFO - Serial detection: Could not open port COM10, baudrate 115200, skipping
2021-01-19 02:25:45,722 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Error: No more candidates to test, and no working port/baudrate combination detected."
2021-01-19 02:25:45,725 - octoprint.util.comm - INFO - Changing monitoring state from "Error: No more candidates to test, and no working port/baudrate combination detected." to "Offline (Error: No more candidates to test, and no working port/baudrate combination detected.)"
2021-01-19 02:25:45,727 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2021-01-19 02:25:46,297 - octoprint.plugins.tracking - INFO - Sent tracking event commerror_autodetect, payload: {'commerror_text': 'No more candidates to test, and no working port/baudrate combination detected.'}

You can attach log files to the post: Just drag them from a file folder into the edit area or you click the Upload button: grafik in the editor top bar.

If you, like in your post, put it there, mark it with the grafik button to format it.


Have you tried to connect the printer with pronterface? If this works, your PC hardware is doing fine.

Thank you :slight_smile: I attached the log (hopefully the right one) to the main post. If that isn't the right one then I'll make it do it all over again once this 24hr print is done. I'll go get pronterface now. By everything I see in hardware manager and how windows itself acts everything appears to be fine. If you have a better driver for the serial connection I could use a link because I'm using "USB-SERIAL CH340" I got from some japan site I think from a forum post somewhere. Was the only driver that worked for the 1.1.4 board and it's still the driver windows preferred when I upgraded to 4.2.7 mainboard. That oddball driver is about the only thing I can think that would be the cause outside of some obscure permission or command line switch I need when starting octoprint. For reference the shortcut I use runs the command - "G:\Program Files\Python39\Scripts\octoprint.exe" serve

Do you have some other software running that may try to access the printer - like pronterface, or another instance of OctoPrint - ?
It seems some other program is occupying that port.

So does Windows make its usual sound when connecting the printer to the PC?

1 Like

No. I know better than to try and have 2 programs use the same port at the same time. I just got pronterface but haven't installed it yet. I only have one computer and one printer at the moment. I do have getting a better RasPi on my list so I can just use one of them. I have a 2B+ but it's in the "might work maybe" list so I'm hesitant to try and use it as a dedicated server.

Do you have Cura or Simplify3D open per chance? Both love to grab the serial port.

1 Like

Are you flipping serious? CURA!?!?! FACEPALM I leave that thing open constantly. It's open right now, been open all night as I been printing. Anyway to stop it from doing that? When this print is done I'll try just closing Cura before reconnecting to verify it is indeed that. Using my own math, this print should be done in about 2 and a half hours and I can test that.

If there is, I haven't yet found it. I know it drives me up the wall any time I try to flash an ESP or run a printer against my development instance.

Oh crap! I haven't even tried that yet. I was waiting for these MEGA 2560's to arrive for this power monitor I'm setting up for my landlord so we can charge tenants for power individually. (rebooting the campground on this property)

Perhaps someone reading this might know. Can I use my RasPi 2B+ as a print server if that's all it does? Web cam will be handled by my PC and if what I read is correct it jusst embeds the cam link anyway so it can be an ip cam for all it cares. In addition to programming I'm also slicing my items again and again up until the moment I click print on that job so I just need it to reliably reconnect when I power down to tweak something on the printer and probably not confuse my serial monitor. I'm the kind of wacked out programmer that will have half a dozen arduinos connected at once, programming them all at the same time, all while trying to keep port numbers and boards straight. Printer was board 10 (and surprisingly used same com port after mainboard upgrade) and I already have 2 more devices here to plug in. lol

I reached out to a friend and there is in fact a way, now documented here:

Awesomesause! You rock! Arduino IDE shouldn't, "shouldn't", give me any issues since it should only be connected to the one port I specify. (Can't even monitor 2 arduinos at once) As soon as this print is done I'll confirm and mark as solved. Now if I can find out why after my pc has been running over a certain amount of time it randomly just freezes for a few seconds. Well, freezes all USB at least. (mouse and printer at least. causes blobing since head pauses in place at pressure for about 3 seconds. Another reason I really want to be able to use the 2B+ Haven't even tried printing from Cura (successfully) because I installed that CH340 driver so that I could and my printer never showed up so that's why I installed Octoprint.

edit* after about a day it starts freezing for a few seconds about every hour or so

Yep, Cura had to be it. Just had to tighten a bolt on the carriage and when I plugged it back in, perfectly reconnected. Cura, if you aren't going to print directly to my printer you can't hog the port. Thanks for the help. :slight_smile: *edit Either I'm blind as a bat or there is no "mark as solved/resolved" for me to click.

For Guides, there isn't a solved - nothing to solve for an explanation of how to do something. As this now turned more into a support ticket however, I'll move it back to that category and then you can select the solution yourself.

1 Like

Have you checked the Pi input voltage and Amps

Um..... If you read you would realize that there is no Pi in my setup as it stands right now. I only printed the case for my Pi 2B+ last night and haven't plugged it into the printer yet. I built my own power supply for the Pi with dual 7805 linear regulators (one is clipped off until I install a diode for it, lazy/not critical yet, heat ok) and I've tested it with 12v 2.5A input and finally don't get low voltage icon like trying to run it from a 2.4A USB charger. It will be pulling 24v from the printer's power supply so I imagine it will remain just as stable.

This issue has actually been solved and was found to be Cura taking over the port upon printer reconnection. Thank you though for stopping to help. :slight_smile:

3 Likes

I know this is old but I wanted to post what my solution was incase some one else has the same problem as I did, I also had Creality Slicer and Cura open. One of those programs took over the connection and would not let Octoprint connect.
I shut down all of the programs that were running and just started Octoprint. It immediately connected.
I hope that this helps someone.
KO