imrahil / octoprint-printhistory Goto Github PK
View Code? Open in Web Editor NEWPlugin for OctoPrint - saves filename, print time and filament usage for each print
License: GNU Affero General Public License v3.0
Plugin for OctoPrint - saves filename, print time and filament usage for each print
License: GNU Affero General Public License v3.0
Regardless of the beginning sort order, when i pressing to delete an entry, the record is deleted however the list resorts into a pattern that doesn't appear obvious. See screenshots 1 (pre-delete) and 2 (after deletion).
In addition,although likely a separate defect, if i delete a record while a print is in progress, the printer pauses on and off for ~3-5 seconds while the deletion is being processed.
I'm on a Pi2
latest Dev build of Octoprint (1.3.0 dev95...) but i have seen this behavior even prior to the 1.2 upgrade.
Running 0.6 version of print history
Could the default sort order be set to show the most resent print first? Or have the plugin remember the last sort order used?
See OctoPrint/OctoPrint#1241 (comment)
Causing print stuttering issues when accessing the web interface with lots of history entries.
Is it possible to avoid accessing /history until the history tab is actually opened? That would be an immediate quick fix as it shouldn't need that data when not on the history tab.
Just installed this plugin fresh with a fully updated octoprint server. Nothing is showing up int he history tab. the tab is there with the framework, but it is not pulling in any print history. I installed via the plugin manager in octoprint. Any suggestions or missing steps that I can try?
Greetings,
I'm using 1.0 and seeing some missing entries, double entries, and entries that are marked as failed prints.
I've attached history.db and history.bak. For good measure, I also include my old history.yaml which ended after the upgrade, but might prove useful. These are all zipped up in the attachment. If I can provide any additional information, please let me know.
Thank you,
John
My History tab is empty, and I get this in my log:
2015-09-06 15:42:38,084 - octoprint - ERROR - Exception on /plugin/printhistory/history [GET]
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/oprint/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/oprint/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/__init__.py", line 64, in getHistoryData
raise IOError("Couldn't read history data from {path}".format(path=self._history_file_path))
IOError: Couldn't read history data from /home/pi/.octoprint/data/printhistory/history.yaml
The history.yaml file is accessible to the pi user (and cat'ing it works fine):
pi@octopi ~/.octoprint/logs $ ls -lh /home/pi/.octoprint/data/printhistory/history.yaml
-rw-r--r-- 1 pi pi 21K Sep 6 15:42 /home/pi/.octoprint/data/printhistory/history.yaml
octoprint is run by the pi user:
pi@octopi ~/.octoprint/logs $ ps auxwwf | grep octoprint
pi 2304 18.0 7.6 170728 29236 ? Sl 10:35 59:12 /home/pi/oprint/bin/python /home/pi/oprint/bin/octoprint --host=127.0.0.1 --port=5000
It seems like this would be a permissions issue, but I can't figure out what exactly is causing this.
Both exports gives the following error (runing on Octoprint 1.2.0-dev-834):
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Even if the server is doing "nothing" so the "overloaded" isn't very possible...
It would be nice to make use of the User Access Control feature to also log which user issued which print. On a multi-user environment having something like this could be particularly useful.
@imrahil do you think this is possible?
Hi everyone!
Some of my Print History entries get lost due to a error in the plugin. For example:
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.0-py2.7.egg/octoprint/plugin/init.py", line 229, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/init.py", line 118, in on_event
return eventHandler.eventHandler(self, event, payload)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py", line 97, in eventHandler
cur.execute("INSERT INTO print_history (fileName, note, filamentVolume, filamentLength, printTime, success, timestamp) VALUES (:fileName, :note, :filamentVolume, :filamentLength, :printTime, :success, :timestamp)", currentFile)
ProgrammingError: You did not supply a value for binding 3.
Not all entries get lost, some are working properly. See the attached log file for more examples.
octoprint.log.txt
I cannot figure out why this is happening or how I could prevent it.
I'm using Octoprint 1.3.0 Master with Print History 1.0.0 on a Raspberry Pi B+ with my Prusa i3 MK2.
As a remote control I use the app OctoDroid on Android 7.1.1
Thanks for any help!
And happy new year!
I originally installed Print History Plugin (0.4) from the Plugin Manager and everything worked then one day when I went to the History tab no data showed up.
Uninstalled Print History from the Plugin Manager and rebooted
opened up terminal
source ~/oprint/bin/activate
cd ~/OctoPrint
git pull & git checkout devel
python setup.py clean
python setup.py install
pip install https://github.com/imrahil/OctoPrint-PrintHistory/archive/master.zip
sudo service octoprint restart
Tried it again but no success. History tab opens but no data shows on the tab even after I printed some things
I received this message when attempting to export the history in either CSV or Excel format.
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
This happened after I seem to have shocked the printer with electrostatic charge. After rebooting, everything else with octoprint seems to be working fine. This happened once before awhile back & just reinstalled everything to fix it.
I am running octoPrint
Version: 1.3.0-dev-2-g1796c92 (devel branch)
Print History Plugin (0.5.1)
I also have your Navbar Temperature Plugin (0.6) installed & that is working fine.
I use plugins least two months, ever I had a lot of data, after the restart of octoprint I have set HISTORY empty. Is the ability to recover data?
Hello!
After update to OctoPrint 1.2.7 all diagrams are empty. No more data is showen.
Where is the data stored for the print history? If I am doing a clean installation of octoprint can I import my previous history?
It would be great to be able to open up the details of each print and see what settings it was done with. This would be really useful when I want to reproduce old prints. The extreme, and likely well beyond the scope of this plugin, version would be to archive/version the entire gcode file so that one really could just hit reprint.
It would be fantastic if information from the history could be fetched via the OctoPrint API. Not sure what you'd have to do or if it's possible. I'd be interested in helping with this, if/as needed.
This is a feature suggestion: It would be really nice if I could select a reason for printing fail (e.g. unstuck print, hot end issue, malfunction, filament issue) and be able to see a breakdown of fail reasons in the stats. This would be best implemented by a fillable drop-down list - you click the failed print job and select an existing fail reason or add a new one. Thank you for an awesome tool! :)
Your plugin is very insterresting in order to track our past prints but also to plan the next prints, it would be interresting to have the feedrate used in the prints in order to correlate/reproduce the print with the same settings.
I know that the feedrate can change during the print but capture the current feedrate at print end could be enough.
Sorry if this is not the best place for this but I have not found any other resources. I installed your plugin on my new OctoPi installation and the plugin installed correctly but the history remains blank after a couple of days. Is there some configuration I am missing to enable this? I am able to connect to my printer and complete prints and I have a few other plugins installed that are working but I would like to get this one working as well.
Any help is appreciated, and thanks for creating this plugin.
Printhistory is not working on my raspberry pi 3 running octoprint 1.3.0. I installed PrintHistory from the plugin manager.
Here is there error message from the octoprint.log:
2017-01-01 05:18:21,162 - octoprint.plugin - ERROR - Error while calling plugin printhistory Traceback (most recent call last): File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.0-py2.7.egg/octoprint/plugin/__init__.py", line 229, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/__init__.py", line 118, in on_event return eventHandler.eventHandler(self, event, payload) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py", line 97, in eventHandler cur.execute("INSERT INTO print_history (fileName, note, filamentVolume, filamentLength, printTime, success, timestamp) VALUES (:fileName, :note, :filamentVolume, :filamentLength, :printTime, :success, :timestamp)", currentFile) ProgrammingError: You did not supply a value for binding 3.
Any assistance would be greatly appreciated.
I'm having an issue where an otherwise successful print doesn't include Filament length and Filament volume.
Based upon the screenshots shown at http://plugins.octoprint.org/plugins/printhistory/ that doesn't appear to be the expected case.
I have attached a screenshot detailing the unexpected behavior, as well as the associated print history excel export.
I have version 0.7 installed but I am not seeing the Trash Can for deleting jobs from the list.
Users can delete and edit history without an account even when access control is enabled.
I've cancelled a print in middle (using web gui "cancel" button) but history shows it as "success" job. Cancelled shouldn't be considered a success.
Cancelled prints do not show in the print history at all, showing an incorrect 100% success rate.
I would like to have the ability to edit the data for completed prints to manually change success/fail or to manually set the filament used when it is blank because octoprint didn't calculate it.
Most of my prints do not have a value at filament usage. Yesterday I printed the same .gcode twice. Only one of them got a value in filament usage.
I would like to add the missing values by editing the file - would you please provide me the file format and a description of the fields.
I just ran two test prints using V 0.7, and with both prints the Filament usage showed no data.
If I expand the print file to show more info in the File library however it does correctly show the filament and volume from the gcode, so OctoPrint itself appears to be ware of the materials data. It seems to not be recorded by the History plugin though. I've tried two prints, both were the same model, but were sliced using two different programs (Cura and Simplify3D) and exported in two different gCode flavors. (Ultimaker Native and RepRap)
I do not know whether this worked before, but the total time for all prints displays as a "-" only. I looked in the octoprint.log file & this is the only error I see. 2015-07-23 18:24:26,620 - py.warnings - WARNING - /home/pi/oprint/local/lib/python2.7/site-packages/requests-2.7.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Here is a screen capture from my firefox browser running under Windows 7 Pro.
Ideally we should be able to set up an associated "price per material/spool" for each print file, but if at first stage it's too much, just set up an "average price per spool" field and calculate price per print accordingly?
Help - I completely lost all my previous History when I ran the last update to the History module. It was 10 months of printing history. Is there some way to recover that?
Could you add option to track by spool or filament color? I was tracking my black spool usage, but changed to white last night and now the data doesn't help me calculate how much of my spool has been used.
Is there a way to reset all the data? If I can't separate by spool or color?
I would want the print statistics to maintain across spools.
Just as in the title. Some prints show the filament used, some do not. There isn't any obvious reason as to why.
Please help, would like to recover all my print history data since I began using this plugin back in February. Couldn't find history.yaml
See screenshots and log file:
http://i.imgur.com/ju1KO5U.png
http://i.imgur.com/f3JV8DI.png
https://dl.dropboxusercontent.com/u/7579452/plugin_printhistory_console.log.zip
Hello,
Currently the total filament usage exported seems to be the total length. Any chance the script can be modified to export the filament usage by tool?
Thanks for the great plugin!
Ken
Hi,
On a fresh Octoprint 1.3 everything is working fine except as the title says. I've done 4 prints from it so far (all successful), but I only get the Date and the status of the print, no other information ("-").
Do I need to setup something?
Feature Request:
If we can mark each print in the history as coming from a spool, then we can use this to track spool inventory.
Being able to enter what spools I have, how much they cost and how much filament is on the spool. Then for each print in the history, select a spool it came from.
A spool inventory screen could show all the spools and how much filament remains in each.
Hi I wonder under which circumstances (or what needs to be set) the used filement lenght gets tracked?
Sometimes there is a value - sometimes not. But used same slicer with same settings and both prints succeeded.
Can you clarify? Or update the Readme / Docs?
That would be great.
Filament usage sometimes not recorded. I just got such print:
"filament-wall-holder2.gcode 2015-05-13 04:05 03:05:22 -"
Now it didn't save filament usage info and log doesn't say why:
2015-05-13 04:05:13,049 - octoprint.plugins.printhistory - INFO - event: PrintDone
2015-05-13 04:05:13,062 - octoprint.plugins.printhistory - INFO - metadata for filament-wall-holder2.gcode
2015-05-13 04:05:13,067 - octoprint.plugins.printhistory - INFO - printTime: 11122.7004569
2015-05-13 04:05:13,069 - octoprint.plugins.printhistory - INFO - success: True, timestamp: 1431482712.2
Need more stats:
I installed printhistory plugin on octoprint 1.3.1, and I don't have any print history information, and I am getting the following error in the logs:
2017-03-03 00:26:21,166 - octoprint.plugins.detailedprogress - INFO - Printing stopped. Detailed progress stopped.
2017-03-03 00:26:21,222 - octoprint.plugin - ERROR - Error while calling plugin printhistory
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.1-py2.7.egg/octoprint/plugin/init.py", line 229, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/init.py", line 146, in on_event
return eventHandler.eventHandler(self, event, payload)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py", line 46, in eventHandler
parameters = gcode_parser.parse()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 25, in parse
parameters = self.parser_factory.parse(self.file)
AttributeError: 'NoneType' object has no attribute 'parse'
Seems like there's somthing hogging the cpu when a new client connects to the web ui, which makes the serial connection to the printer stutter. This is especially visible when doing smooth surfaces, like circles.
It'd be nice to have a snapshot of the print on the plate after the print completed.
Ever since I updated to the latest version of the plugin I've been getting this error when trying to write to the history.yaml file.
2016-04-06 06:35:06,619 - octoprint.plugin - ERROR - Error while calling plugin printhistory
Traceback (most recent call last):
File "/home/ubuntu/OctoPrint/src/octoprint/plugin/__init__.py", line 204, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/octoprint_printhistory/__init__.py", line 63, in on_event
return eventHandler.eventHandler(self, event, payload)
File "/usr/local/lib/python2.7/dist-packages/octoprint_printhistory/eventHandler.py", line 115, in eventHandler
self._console_logger.exception("Error while writing history.yaml to {path}".format(**locals()))
KeyError: 'path'
Ideally number of failed prints is low, but there are times a print fails after 6 hours of printing. During that time your bot's been running for 6 hours and it's used a ton filament. It would be great to capture this so that users have a try value for bot usage and filament used as a whole.
Please let me know if there are other details required for this enhancement request. Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.