This little pice of plastic will with an optical endstop and octoprint combined save you from failed prints when you run out of filament :-)
Remixed the original to be able to use a ziptie for fasteing. (As i did not have fitting screws)
Also slimmed it down a bit to use it with my boden holder and it attaches nicely to my i3 mk2.
G - ground --> Ground on the Pi
S - signal --> GPIO 14
V - volt --> 5 V on the Pi
Test the right value for the sensor:
Write the right value into octoprint config.
Please post your makes :-)
Supports depend on printer type. On the mk2 it works well with and without.
Make sure to clean out all stringing in the feeding holes and in the backet so the optical sensor does not get confused!
See the images for wire management :-)
Hook it up to octoprint :-)