-
-
Notifications
You must be signed in to change notification settings - Fork 301
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] Filament Usage for Octoprint broken in multiple areas of code #819
Comments
If you are using the private server, you can also retrospectively add back historical estimated filament usage for both completed prints as well as prints that were canceled but have a recoverable print time, using the following perl code that I hacked together (use at your own risk).
|
The current code in
octoprint_messages.py
as well as seemingly normalizers.js fails to retrieve either the live or predicted filament usage when using Octoprint.The result is that filament usage is NEVER CALCULATED (and hence never available for display) when using Octoprint, regardless of whether you are using the Obico Cloud Server or a private server.
Given that the "average" user is probably more likely to use Octoprint than Moonraker and that filament usage is a basic displayed feature of both the web and mobile apps, it seems like this is a critical bug that should be prioritized and fixed.
The basic problem is that the Obico code assumes that filament usage shows up under the
progress
data structure/api under the labelfilamentUsed
which seems to be true for Moonraker but not for Octoprint.For example, the code in
octoprint_messages.py
says:filament_used = printer_status.get('progress', {}).get('filamentUsed')
Rather, as clearly documented in https://docs.octoprint.org/en/master/api/job.html#retrieve-information-about-the-current-job, the API for Octoprint uses the following data structure with filament usage listed by tool# under the
job
structure.I was able to fix this problem by adding the following several lines just after the above quoted line that works for Moonraker. The added code sums the filament usage listed by tool under 'job'
See the following Pull request for more details #817
However, there are other issues in the
octoprint_messages.py
code.Specifically, the fallback estimation code fails:
It seems like
filament_total
is never calculated though it should be available and retrievable from the.metadata.json
files stored in Octoprint under the.octoprint/uploads
tree as well as from the current uploaded gcode itself. This may be due to issues with the corresponding code innormalizers.js
where it seems like none of the methods succeed in returning the estimated filament total (but I'm not sure how this code is called so I can't be 100% certain).Regardless, the above errors assuredly mean that filament usage is totally broken for Octoprint independent of whether you use Obico Cloud or your own private server.
The patch I suggested works fine for me and is quite simple so feel free to use it for now until a formal fix for all the above issues is implemented.
The text was updated successfully, but these errors were encountered: