I have built a filament sensor with rotary encoder and Arduino. I read the pulses with the Arduino.
Until first movement and when moving Arduino sends HIGH. If no pulses after first movement for 15sec then it sends LOW.
It's working nice so far.
My problem is that after the print is finished or stopped it sends LOW. So I can't start a new print unless I restart the system or press RESET on Arduino.
I have thought an easy fix. I want to enable the sensor after first layer or if Zheight>something.
In the filament sensor reloaded plugin that I use there is an if that tells to Octoprint if it should listen the sensor. So it listens only at the presence of events PrintStarted and PrintResumed. Out of this events the state of the sensor is ignored.
if event in ( Events.PRINT_STARTED, Events.PRINT_RESUMED ):
Coding in python is beyond my skills and after searching a lot I couldn't find the way.
Is there a line add I can do to this plugin?
Something like Events.CurrentZ>0.3 ?
I ll then modify my gcode from Cura to send M114 at start and after first layer.
I saw many people requesting a plugin for encoder filament sensor. I do the pulse reading from Arduino so no reading of pulses is needed for Raspbery . With this solution I will only miss sensing filament in first layer. Loosing one layer is not that bad if filament jams or tangles.
With this I will not need to interact at all with the sensor. I am pretty sure in a while someone will create an awesome plugin with timeouts and even measuring filament passed from the sensor. So even partial clogs will be traceable. Prusa has done it in firmware and others. Untill then Arduino does the job for me.