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

Ok, so I've been printing with this setup for a few days without issues. Upgraded mainboard from 1.1.bzzzzgrind to 4.2.7 and still printed just fine. (added a bltouch) I installed the firmware for 2208 drivers (like my ebay listing said it had) and nothing moved. Put in the 2225 version and everything started working fine again. And now I start getting permission denied on attempted serial connection to the printer. Searched for a few hours and didn't find anything about this issue on this setup. So I know this might be odd but I'm posting this AFTER I fixed the issue and I just want to share.

Should work on any windows version since this is a trick I used when fixing peoples computers back in the Win3.1 and 95 days. Right click on your computer. Icon on the desktop, the one on the left bar in file explorer, just find something that says my computer and right click it. Select "manage" option and a really dangerous window comes up. Don't change anything and looking around should be fine. Click on device manager on the left and then look at the right for the section labled "Ports (COM&LPT)" and you should see the com port your printer is on. Right click that and select "Uninstall Device" and make sure you DO NOT check the box to remove the drives too. Unplug your printer now and DO NOT plug it back in yet. Restart the computer, restart octoprint, open your browser interface, and then plug in the printer and use the auto connect again. If this fails, repeat and remove drivers. Reinstall drivers before plugging in printer this run.

Hope this helps someone else.

EDIT:

Yeah Still a problem though. I have to do this whole procedure every single time I unplug the printer or loose connection. I need to find out how to give this thing permission. I'll go find those logs but here's a few more details about my setup.

Octoprint 1.5.2
OctoPi - Not Applicable
OS - Windows 10
Python version - 3.9
Venv - latest as of a week before this post.
Ender 3 with 1.1.4 mainboard initially

  • UPGRADES
    4.2.7 mainboard, firmware official creality marlin 4.2.7 w/2225 drivers w/BLTouch
    BLTouch

Going to find where this install stores it's logs/files and post em. I can recreate this error at will. +edit Enabled serial logging and will post logs at earliest convenience. (currently printing - calibration)octoprint.log.2021-01-17.log (306.7 KB)

2 Likes

Hello @MeSoLost!

You may be a bit more successful with a call for help in the subforum -Get Help.
Because there are some information requests that help us to help you.. (I#ll move it to there)

So anyhow.

* Please try in safe mode and tell if it works then.

* Could you please share the logs (octoprint.log and serial.log - you may have to enable the serial logging first)

* Also some information of your OctoPi and OctoPrint version and to what system you had installed it to (RasPi, Windows PC,...)

@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?

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