From a3cd5a2e270308219eb6ffc7e669b1130620a3a7 Mon Sep 17 00:00:00 2001 From: Anni Lange Date: Sun, 15 Nov 2020 21:27:47 +0100 Subject: [PATCH 1/3] Bugfix --- octoprint_smart_filament_sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoprint_smart_filament_sensor/__init__.py b/octoprint_smart_filament_sensor/__init__.py index 3cd17e1..28f1880 100644 --- a/octoprint_smart_filament_sensor/__init__.py +++ b/octoprint_smart_filament_sensor/__init__.py @@ -222,7 +222,7 @@ def calc_distance(self, pE): # Remove motion sensor thread if the print is paused def print_paused(self, pEvent=""): self.print_started = False - self._logger.info("%s: Pausing filament sensors." % (pEvent="")) + self._logger.info("%s: Pausing filament sensors." % (pEvent)) if self.motion_sensor_enabled and self.detection_method == 0: self.motion_sensor_stop_thread() From a6fb4c9b9fa3c4038359fca35cab2fe3716d2be6 Mon Sep 17 00:00:00 2001 From: Pavulon87 Date: Tue, 22 Dec 2020 11:05:04 +0100 Subject: [PATCH 2/3] Fix Only one detection per print Reset send_code with every movement --- octoprint_smart_filament_sensor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/octoprint_smart_filament_sensor/__init__.py b/octoprint_smart_filament_sensor/__init__.py index 28f1880..72e8d3f 100644 --- a/octoprint_smart_filament_sensor/__init__.py +++ b/octoprint_smart_filament_sensor/__init__.py @@ -170,6 +170,7 @@ def printer_change_filament (self): # Reset the distance, if the remaining distance is smaller than the new value def reset_distance (self, pPin): self._logger.debug("Motion sensor detected movement") + self.send_code = False if(self.remaining_distance < self.motion_sensor_detection_distance): self.remaining_distance = self.motion_sensor_detection_distance From 3d27668ca714229f39d4194909c5fff23b67abd5 Mon Sep 17 00:00:00 2001 From: Anni Lange Date: Fri, 25 Dec 2020 11:30:54 +0100 Subject: [PATCH 3/3] Small bugfix, extended Readme.md and increased version --- README.md | 5 +++++ octoprint_smart_filament_sensor/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43f2d3c..272840f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ After installation a restart of Octoprint is recommended. ### GPIO Pin * Choose any free GPIO pin you for data usage, but I would recommend to use GPIO pins without special functionalities like e.g. I2C * Run the sensor only on 3.3V, because GPIO pins don't like 5V for a long time +* In [BigTreeTech SmartFilamentSensor Manual](https://github.com/bigtreetech/smart-filament-detection-module/tree/master/manual) on page 12 you can find the functionality of the pins. Please ensure that there is no undocumented twist in your cable +* My recommended GPIO pins: 11, 13, 15, 17 (such without any special usage). Please check the [documentation](https://www.raspberrypi.org/documentation/usage/gpio/) of your Raspberry Pi version/model. Also other pins could work, if you know how to configure it on the Raspberry, but it might be tricky and not work out of the box. ### Detection time Currently it is necessary to configure a maximum time period no filament movement was detected. This time could be depended on the print speed and maximum print line length. For the beginning - until I figured out how to estimate the best detection time - you can run a test print and messearue your maximum time and configure this value. @@ -48,6 +50,9 @@ Since v1.1.3 there are also alternative pausing commands [M0, M1, M25, M226, M60 ### Octoprint - GCode Scripts If you do not want that the print is paused right on your print, I recommend to add a GCode Script for "After print job is paused". Also adding GCode script "Before print job is resumed" might be useful, in the case you hit the heatbed or print head during the change of the filament or removing the blockage. +### Test script +Advice: don't run the test script in this repository durin a print. This leads to failures in the detection of movements of the print and therefore to missbehaviour of the plugin. + ## GCode ### Start GCode Since the sensor is activated with the first G0 or G1 command it is adviced to perform these commands after complete heatup of the printer. diff --git a/octoprint_smart_filament_sensor/__init__.py b/octoprint_smart_filament_sensor/__init__.py index 72e8d3f..3cc9f26 100644 --- a/octoprint_smart_filament_sensor/__init__.py +++ b/octoprint_smart_filament_sensor/__init__.py @@ -317,7 +317,7 @@ def distance_detection(self, comm_instance, phase, cmd, cmd_type, gcode, *args, __plugin_name__ = "Smart Filament Sensor" -__plugin_version__ = "1.1.3" +__plugin_version__ = "1.1.4" __plugin_pythoncompat__ = ">=2.7,<4" def __plugin_load__(): diff --git a/setup.py b/setup.py index d21c4fd..070ab48 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ plugin_name = "Octoprint-Smart-Filament-Sensor" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.1.3" +plugin_version = "1.1.4" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module