Need Plugin for Smart Filament runout sensor

BIGTREETECH has a smart filament runout sensor that watches for movement of the filament not just if the filament is present so when the filament is moving it sends pulses. This sensor is designed to be wired to the printers main board and when the printer is printing and no longer receives pulses due to jam or filament runout Marlin sees this and pauses print. The problem is that Octoprint has no way of knowing this has happened and just keeps sending gcode.

  1. if the sensor could be wired to a GPIO pin on the raspberry pi and a plugin that would watch for pulses coming from this sensor which could then send the pause command when a pulse has not been seen in a configurable amount of time.

  2. Not sure if a plugin could be made to monitor if the pause command has been sent when the sensor is instead connected to the control screen of the printers main board like it is intended to.

There may be some way to incorporate Action Commands so that your firmware is indicating what's going on back to OctoPrint. Then a plugin could see that and do whatever. But maybe I've gotten this backwards, I've not used that.

In theory, though, Marlin pauses the print and says something back to OctoPrint at this moment.

This was an interesting read.

1 Like

Agreed, if marlin is configured to send action commands it should pause octoprint.

I'm still waiting on my touch screen from BIGTREETECH (it's on the slow boat) and the filament sensor but am already running the SKR 1.4v Turbo. With my research that I have done the sensor gets connected to the touch screen which then sends gcodes to the board via one of the serial ports. When the filament sensor detects that the filament has run out or has stopped moving for a period of time (filament jam) the touch screen sends a gcode to marlin to initiate an "Advanced Pause" which is under Configuration_adv.h . I am not sure what the code is exactly but it looks like it is M600 and then M125 to pause the printing and park the nozzle.

Check this thread....

1 Like

ok so I just added a couple of lines to Configuration_adv.h and it compiled with no errors but I'm not sure how I can test to see if it works being that I do not have the sensor or touch screen yet

/**
 * Host Action Commands
 *
 * Define host streamer action commands in compliance with the standard.
 *
 * See https://reprap.org/wiki/G-code#Action_commands
 * Common commands ........ poweroff, pause, paused, resume, resumed, cancel
 * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed
 *
 * Some features add reason codes to extend these commands.
 *
 * Host Prompt Support enables Marlin to use the host for user prompts so
 * filament runout and other processes can be managed from the host side.
 */
#define HOST_ACTION_COMMANDS
#if ENABLED(HOST_ACTION_COMMANDS)
  #define ACTION_ON_PAUSE "pause"
  #define ACTION_ON_RESUME "resume"
  //#define HOST_PROMPT_SUPPORT
#endif

the lines that I added because they are not part of Configuration_adv.h file anymore are the following and I hope that they are formatted correctly but since I didn't get any errors I guess they are right.

#define ACTION_ON_PAUSE "pause"
#define ACTION_ON_RESUME "resume"

Hi,

Can I ask how you got on with this please?

I have a BIGTREETECH 3.5 and a filament sensor (just a detection one not a movement one)

From what I understand this sensor when connected to the screen only works if you print from the screen (via usb or sd) so if I send a print to Octoprint then the sensor will not be active?

I am quite a newbie (first post) so please bear that in mind :smiley:

Would love to see this feature too. Smart runout sensor that sends pluged into the raspberry and a plug-in that Handels the runout/clogged/etc feature as marlin firmware, or kind of this.

Would do it my self but programming and me.. That's another story :smiley:

2 Likes

Did your compilation ever work? I'm left here suspended. Also 7 months later still no way to use bigtreetech smart filament sensor with octoprint. Guess this one is a little over "OutsourcedGuru"s head.

Do I smell a bit of annoyance at this situation here? Have you considered that this might be the case simply because no one with access to the hardware so far has sat down and actually looked into writing a plugin or finding a different solution? Maybe you could do that?

Also no idea what Guru has to do with anything here. For the record, if you want to get grumpy at who maintains and more or less singlehandedly develops OctoPrint, that would be me. Instead of getting grumpy though I suggest to contribute, see above. Solutions don't magically grow on trees, especially not without access to the hardware in question.

3 Likes

yeah if someone wants to send me the hardware I'll write the plugin.

I'm assuming it'll just be a case of pulses on the pin and timing.

I got the smart filament sensor and skr 1.4 turbo of bigtreetech.
Any new development on this?

I am trying to get it to work with M118 A action:pause. Will let you know how it works out. If there is any code that needs to be tested with someone with the hardware let me know!

I am new to Octoprint and for that matter my ender is new also.. I enjoy using Octoprint and appreciate all the hard work you have put into it. I had a few prints saved by a filament sensor so I ordered the Smart sensor from Bigtree without looking into the availability of use on Octoprint.. I did check and the new Creality board v.4.2.2 I have supports it with a dedicated plug in.

A few of you have offered to help get this sensor working if you had the hardware. since I cant use mine, I am willing to send it to someone to help the project. (I would preferer someone with a new Creality board to match my hardware but beggars can be to choosy)

Message me with a way to contact you and we can arrange everything.

Since I am new and haven't tried to write my own plugins yet, I would like to know if it is posable to plug the sensor into the main board and have the printer board pause Octoprint. I can hook it directly to Pi but the length of that connection would not be my preferred method.

Currently i use Enclosure Plugin (4.13.1) to control most signals to and from Pi.

Other plugins I use

Action Command Notification Support
Action Command Prompt Support
Consolidate Temp Control (0.1.7)
DeleteAfterPrint Plugin (1.8.1)
Enclosure Plugin (4.13.1)
Filament Manager (1.6.3)
Floating Navbar (0.3.4)
Fullscreen Plugin (0.0.5)
GCode Viewer
GcodeEditor (0.2.9)
HeaterTimeout (0.0.3)
Navbar Temperature Plugin (0.14)
PrintTimeGenius Plugin (2.2.6)
System Command Editor (0.3.4)
TemperatureFailsafe (0.2.3)
TemperatureLegendMover (1.0.0)
Tempsgraph Plugin (0.3.6)
Themeify (1.2.2)

You can use any filament sensor as long as the firmware supports host action commands. You can find out more information here. For Marlin, it's as simple as uncommenting the line #define HOST_ACTION_COMMANDS in configuration_adv.h. Once you do that then when a filament runout is triggered on the board (no matter what the type of sensor) octoprint will get notified to pause and allow for controlling the process I think.

Please correct me if I'm wrong, but has this just been done? Very exciting and amazing work if this is the plugin we've been waiting for.
https://plugins.octoprint.org/plugins/smartfilamentsensor/?utm_medium=announcements&utm_source=octoprint&utm_content=1.4.2

Yeah It was just released.

1 Like

But that requires you to plug in to the pi not the printer board, which is why I didn't mention it @cods69.

1 Like

This is precisely why I'm excited about it. Awesome stuff - can't wait to give it a spin. Thanks to all involved!
Is there a guide to pinout's/GPIO which should be used on the Pi? My unit won't arrive for a few weeks yet, so no rush.

https://pinout.xyz is a really good website for seeing all of the Raspberry Pi pins numbers.