malnvenshorn / OctoPrint-CostEstimation

OctoPrint plugin to display the estimated print cost for the loaded model
GNU Affero General Public License v3.0
23 stars 19 forks source link

No Cost Estimate on API User #23

Open ViktorLindgren95 opened 5 years ago

ViktorLindgren95 commented 5 years ago

Hi i usually print by using the api connection in Cura together with Octoprint. When doing this the cost estimate dosent work it just shows blank.

malnvenshorn commented 5 years ago

Can you be more specific? I don't know what you mean.

chriskuipers commented 5 years ago

Hi! I think what @Masterzior means is that if you export a gcode object through Cura (or Slic3r, in my case) directly to octoprint using the octoprint API, no cost calculation is made. It just shows a dash.

But I don't think it has to do with using the API instead of manually uploading the file. If I upload a gcode file manually using the octopi website it also does not show the cost. It's really an intermittent issue. On some objects it does show a cost estimation, on others it does not, or only after you printed the object.

How can I/we debug this further?

Expectation OctoPrint-CostEstimation-Expectation

Symptom OctoPrint-CostEstimation-NoCost

malnvenshorn commented 5 years ago

I've never came across this issue and I'm also using Slic3r with the auto upload via the API.

This plugin relies on the data (filament length and est. print time) OctoPrint generates when analyzing a new uploaded file. This process can take some time depending on the size of a Gcode I had cases where this took 30 minutes to finish [*]. Only after the data is available the cost can be calculated. If you start a print the process will be stopped and continued after the print has finished.

@chriskuipers Your second screenshot is some what strange, because it shows the filament length but not the est. print time :confused:

A log file might help to find out if the analyzing process has finished.

[*] That's why I created the OctoPrint-MetadataPreprocessor plugin

KD7LRJ commented 5 years ago

I've noticed that filament length/weight isn't cleared immediately when a new file is loaded. At least not with the API and the Auto Select plugin active. It does update eventually after the loaded file gets processed by Octoprint.

chriskuipers commented 5 years ago

@malnvenshorn Thanks for your quick reply! That explanation explains some odd behaviour indeed... I also found it strange it did not show a approx. Total Print time. At this moment I'm printing something I just uploaded, it's relatively small, but it also does not show a approx. Total Print time (and because of that, no estimated cost?). Schermafbeelding 2019-06-14 om 10 39 43

I'll check the file I uploaded yesterday evening as soon as the printer is done. The symptom screenshot I uploaded in my comment, I took just a few minutes after I uploaded the file. So that could mean that the Raspberry had not enough time to analyse the file. That would also mean that if I check later, there should be a cost estimation on that file? I'll let you know.

Installing the OctoPrint-MetadatePreprocessor plugin would help to speed up the cost estimation?

Update: The printer is done. I just checked and now all my files show an Estimated Cost. I think it's indeed an issue regarding file analysis done in the background.

malnvenshorn commented 5 years ago

The MetadataPreprocessor just reads the metadata comment generated when/after slicing the model, therefore the data is available almost instantly. But it might not be easy to setup for everyone. If you want to give it a try carefully read both readme files (in the main and analysis folder).