imrahil / OctoPrint-PrintHistory

Plugin for OctoPrint - saves filename, print time and filament usage for each print
GNU Affero General Public License v3.0
63 stars 64 forks source link

History stopped getting populated #86

Closed kb- closed 3 years ago

kb- commented 4 years ago

I updated Octoprint to the version 1.4.0 and noticed the history stopped getting populated. (OctoPi 0.15.1, running on Raspberry Pi 3 Model B Plus Rev 1.3)

stidf commented 4 years ago

Just happened to me as well. Stopped working about 2 weeks ago on April, 12th according to the log.

On Mon, Apr 27, 2020 at 10:30 AM kb- notifications@github.com wrote:

I updated Octoprint to the version 1.4.0 and noticed the history stopped getting populated. (OctoPi 0.15.1, running on Raspberry Pi 3 Model B Plus Rev 1.3)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/imrahil/OctoPrint-PrintHistory/issues/86, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACK7YAPVJRJ527QIZFUIAWDROW6MHANCNFSM4MSDWLVA .

-- -Andrew Gasperini

anhtuan445 commented 4 years ago

Check this topic: https://github.com/OllisGit/OctoPrint-PrintJobHistory/issues/23

You should try to find the same error in this plugin source files and replace it with name/path as appropriate. Let us know if it works ;)

anhtuan445 commented 4 years ago

For anyone looking for a quick fix, this is how I solved it for now:

Change the file for your plugin - /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py

  1. Change payload["file"] to payload["path"] (look for all places in this file and replace it) fileData = self._file_manager.get_metadata(payload["origin"], payload["name"])
  2. Add your upload directory to this line like so: UniversalParser('/home/pi/.octoprint/uploads/'+payload["name"], logger=self._logger)
  3. After saving be sure to restart OctoPrint

Now my prints are added to history again :)

EDIT: Changed path to name, for my solution they outputed same value, but it might differ, so name is more correct (might depend if file is on sdcard or local storage).

kb- commented 4 years ago

Thank you! It wasn't working with payload["path"] either. But changing payload["file"] to payload["name"] as mentioned in the topic you mentioned does the job!

/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py line 34: fileData = self._file_manager.get_metadata(payload["origin"], payload["name"]) line 45: gcode_parser = UniversalParser('/home/pi/.octoprint/uploads/'+payload["name"], logger=self._logger)

anhtuan445 commented 4 years ago

Thanks, corrected my post and added more detail.

guysoft commented 3 years ago

Can I close this? Seems you solved the issue. Also, should we add @anhtuan445 solution to FAQ/wiki?

guysoft commented 3 years ago

Ah wait, you solved it by editing the code @anhtuan445 Is this worth a pull request?

anhtuan445 commented 3 years ago

Sorry don't understand what you mean.

I just edited some files to get it working for me and put the info here so others can also benefit from it.

guysoft commented 3 years ago

Fixed by #89