-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
[BUG]: Print doesn't automatically start after printer turns on #207
Comments
Your settings do look correct, and your assumption is correct that is how it is intended to work. It does work that way for me, so to debug your issue I'll need you to enable debug logging, restart octoprint and put the plug into a powered off state, therefore turning your printer off. Then send the file from PrusaSlicer with that option enabled to auto start the print and the printer should power on, octoprint should then auto connect, and once the connection is established the file should be automatically selected and start printing. If it doesn't then I'll need to get your plugin_tplinksmartplug_debug.log file from OctoPrint's logging section. |
One clarification, when you say OS: windows, do you mean that's what octoprint is installed on or the machine that you're accessing octoprint from? |
Octoprint is running on a Raspberry Pi 4 using the Octopi setup. I set this up a few days ago. Attached are the logs. I'm new at deciphering this but I think that it's timing out trying to negotiate the serial connection. |
Try manually setting your port and baud rate with the option save settings and connect to octoprint while it's powered on instead of using Auto. That way when the power on occurs and it tries to connect it will know what port to send the connect command. You may consider increasing the autoconnect delay too just in case the printer is not fully on after 20 seconds. |
Yep, that helped. I disabled "automatically connect to printer on startup" and ensured the baud rate was correct. So now, the printer turns on and it becomes operational. It still doesn't start printing. The file does appear in the upload queue |
I think I figured it out (I have it working now by modifying the plugin source): After turning on the plug, the plugin starts a timer for connection OctoPrint-TPLinkSmartplug/octoprint_tplinksmartplug/__init__.py Lines 344 to 347 in da780d4
This method returns with whether the plugged turned on. There is then a sleep that sleeps for the autoConnectDelay + 1. It then checks if the printer is ready before kicking off the print: OctoPrint-TPLinkSmartplug/octoprint_tplinksmartplug/__init__.py Lines 667 to 671 in da780d4
I think it's failing because the connect method hasn't completed and the printer is not yet ready. I hacked this by adding 10 seconds to the sleep. I'm new to Octoprint so not sure the best way to fix this. I could see:
edited: updated formatting |
Yeah, it would make sense to increase that sleep value, or potentially switched the logic to something like the below. I'll do some additional testing on this approach.
|
So I've changed the logic to how the auto start happens and moved it to the connected event in the above commit, This way we're not clogging up anything in a busy while loop. Will be included as part of the next release. If you want to test it out for me you can copy/paste the URL below into plugin manager > get more> ...from URL and click Install. The version will still show 0.9.24 as I tend to keep that at current release version until I'm done with additional fixes.
|
Just installed the new version and uploading from Prusaslicer started it and the print started automatically after the machine turned on. I'll do some more testing and report back if there are issues but "no news is good news". Thanks for working on this and making the plugin :) |
Hey, I need to do more testing but I think that if I turn the printer on using the "lightning bolt" in Octopi, then it will start printing the last print that was uploaded. I'll do some more testing. |
So with that latest dev version linked above I wonder if you just increase your automatic connect time to 30 seconds if it makes a difference or not here? Sorry haven't had a chance to really dig into this yet. |
Yes, it works! Thanks |
I'm expecting this plugin to turn on the Printer and then start a print when uploading from PrusaSlicer. The printer will turn on using this plugin but the print won't automatically start.
To Reproduce
Steps to reproduce the behavior:
0. Printer is off.
Expected behavior
The printer turns on, waits the Auto-Connect duration and then starts printing.
Screenshots
Sending my config:
Desktop (please complete the following information):
Additional context
This may be how it's expected to work or I messed up the config. Thanks for creating this plugin!
The text was updated successfully, but these errors were encountered: