-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Uploading fails if klipper not running #81
Comments
I got the same kind of problem. I believe those lines of code Cura2MoonrakerPlugin/MoonrakerConnection/MoonrakerOutputDevice.py Lines 262 to 266 in 8faac62
in |
If the printer is off, deselect the "Start print job" option in the upload dialog. Job queuing is not yet supported by the plugin. |
I am almost 100% positive that I hadn't selected "Start print job" but uploading did not work anyway. Currently the printer is on (and printing), I'll try again once it's done and turned off. |
@emtrax-ltd , it's not as simple as I said (remove the check) because of how the code is laid out. I'm far from a python pro but I did clone the repo and pointed the plugin to it and with those two changes: and (remember, big hack to get the code invoked ;)) The plugin did trigger the print with the printer being offline. The gcode file was queued and my power devices (setup in moonraker) did turn on and the print did start. @wollew, reading your description again, I think it's not the exact same scenario as the one I explained. |
Try this branch: https://github.com/emtrax-ltd/Cura2MoonrakerPlugin/tree/pwrdevfix - there are many changes in MoonrakerOutputDevice.py now. |
Tried it and got
Without automatic print job And
With automatic print job. In both cases it doesn't seem to work. I'm unavailable for the next week but when I'm back, I'll try to open a PR with something that fixes both cases. |
Wait, upload without print did work. |
Important: the “Start print job” option in the upload dialog requires either an active printer or a named power device that activates the printer. In your configuration it only works without "Start print job" because no power device has been named - the Moonraker option "queue_gcode_uploads: True" ensures that a print job is created and, if desired, the option "on_when_job_queued: True" for the power device ensures that the printer is activated by creating the job. |
I tried the branch, but uploading still fails:
No exceptions in the log file. |
it looks like the upload implies a "start print job". Do you use the upload dialog or the "fire & forget" mode? |
I am using the upload dialog, "Start print job" is unchecked. |
For further investigation of this problem the cura.log is required |
Sorry for taking a little bit longer, this morning I tried again, interesting enough I got a different error message:
Relevant part of the cura.log is attached. |
refactored handling of power devices and printer status (#81)
Unfortunately this does not work for me, /printer/info returns 503 if the printer is not turned on and so we end up in the else branch in |
It fails because the Klipper service is not active/started on the Pi. This service should actually be active all the time, even if the printer itself is not switched on or the printer's MCU/board is without power. |
It is true that the klipper service is not running, it automatically ends/dies when I turn off my Ender running klipper (because it does have a USB connection any more). And it automatically restarts (via systemd) as soon I power up the printer. Never had any problems with that and frankly I thought it is the default behaviour. So klipper.service should be up when the MCU is powered down? |
Try latest version of branch: https://github.com/emtrax-ltd/Cura2MoonrakerPlugin/tree/pwrdevfix - there is a new commit! |
LGTM, will confirm once my currently running print is done. Thank you. |
As expected, this fixed the problem for me. |
Retrieve and check printer status via server-API (#81)
Uploading files to moonraker fails if the printer/klipper is not connected:
2023-12-25 12:14:48,961 - DEBUG - [MainThread] UM.TaskManagement.HttpRequestManager._onRequestError [369]: request[31c2ee3f][get][PyQt6.QtCore.QUrl('http://192.168.1.22:7125/printer/info')][timeout=None][no-data] got an QNetworkReplyError Error transferring http://192.168.1.22:7125/printer/info - server replied: Klippy Host not connected. The server returned: b'{"error": {"code": 503, "message": "Klippy Host not connected", "traceback": "Traceback (most recent call last):\\n\\n File \\"/home/pi/moonraker/moonraker/app.py\\", line 641, in _process_http_request\\n result = await self.api_defintion.request(\\n\\n File \\"/home/pi/moonraker/moonraker/klippy_connection.py\\", line 558, in request\\n raise ServerError(\\"Klippy Host not connected\\", 503)\\n\\nmoonraker.utils.ServerError: Klippy Host not connected\\n\\n\\nThe above exception was the direct cause of the following exception:\\n\\n\\nTraceback (most recent call last):\\n\\n File \\"/home/pi/moonraker-env/lib/python3.9/site-packages/tornado/web.py\\", line 1713, in _execute\\n result = await result\\n\\n File \\"/home/pi/moonraker/moonraker/app.py\\", line 624, in get\\n await self._process_http_request(RequestType.GET)\\n\\n File \\"/home/pi/moonraker/moonraker/app.py\\", line 645, in _process_http_request\\n raise tornado.web.HTTPError(\\n\\ntornado.web.HTTPError: HTTP 503: Klippy Host not connected\\n"}}'
My printer is not usually turned on all the time but I would still like to be able to slice and upload files to moonraker. This works through the Mainsail/moonraker web frontend, but the Cura plugin fails because it requests /printer/info which (correctly) responds with 503 because printing would not be possible. I know I could configure moonraker's power device in the plugin which then fixes things but I don't really see why my printer needs to be turned on just to upload files.
The text was updated successfully, but these errors were encountered: