Filament sensor plugins + my stock sensor = Insta-canceled prints

I've tried connecting my Tronxy X5ST filament sensor to my OctoPi, and it works.

It's a three-pin sensor with LED, and it's wired as follows:
VCC = pin 17 (3.3V)
SIG = pin 18 (GPIO 24)
GND = pin 20

Using "gpio readall", I can see the following output:
Without filament: GPIO 24 = HIGH
With filament: GPIO 24 = LOW

As soon as I install a filament plugin (I've tested Filament Sensor Reloaded, Filament Sensor Encore and Filament Sensor NG), and every time I start a print, it instantly cancels the print.
As soon as I remove the filament sensor plugin, prints work fine again.

With the Filament Sensor Reloaded plugin, my octoprint.log was full of octoprint.plugins.filamentreload - INFO - Sensor callback but no trigger state change.
I've tried setting the switch-type to both Normal Open and Normal Closed but it makes no difference in any way.

Can anyone assist me?

Did you exercise this plugin's status API? If so, was it producing the expected result?

http://octopi.local/plugin/filamentreload/status

With the sensor set to "Normal Open", the status page says "status": "0" when there's no filament in the sensor, and "status": "1" when there is.
The octoprint.log file is "quiet" when there is no filament in the sensor, and spams 2019-07-05 22:43:26,473 - octoprint.plugins.filamentreload - INFO - Sensor callback but no trigger state change. when I insert my filament test-bit.
Printer keeps printing, doesn't pause like I'd expect it to.

As soon as I switch to Normal Closed, the status reverses, and the print is paused as soon as I insert filament...

Why not take this then to the plugin author's repository and ask for advice there by opening an issue? It sounds like 1) your switch is testing correctly to GPIO, 2) it's testing correctly to the author's API point and 3) doesn't work as expected.

And this state is stable? So if you check it 50 times you get 50 times the same result?

After following @OutsourcedGuru's directions, I went to the GitHub page for the Filamentet Sensor Reloaded plug-in, and found that several other people had similar issues, and that the plug-in hadn't been worked on since late January 2017. Others had tried Filament Sensor NG successfully, so I'm going to give it a second try.

@Schnello , no I didn't try that many tests, but I tried 4-5, and they all have the same result. Flutter doesn't seem to be the issue.

Still no solution. I think best thing to do is not use filament sensor with octopi / octoprint as it is not operational at this point in time. If you are reading this from google, stop your quest now. It cannot be done and you will just end up wasting a ton of time.

@Ryan_Avery
I had it running with the Enclosure Plugin - no problems at all

what settngs didd u use?

Ok, I try to remember:

The filament sensor switch closes the GPIO pin to ground when the filament is in.
In Enclosure plugin:

  • Add a new input
  • Label: Filament Sensor
  • Input Type: GPIO
  • Action Type: Printer
  • Input IO Number: the GPIO pin you use
  • Input Pull Up Resistor: Input Pullup
  • Event Trigger: Rise
  • Printer Action: Printer Pause

I used Pause Print instead of Filament Change because it worked more reliable for me.

In OctoPrint Scripts you have to fill in some GCODE Scripts for the filament change to Begin Pause and Before Resume: like this, or from here.

1 Like

Note that this number can be three different ones for the same pin. I'm here on pinout.xyz and hover over one of them:

BOARD_pin11

BOARD number indicates that it's the same number actually silkscreened into the top of the Raspberry Pi and is 11 in this case.

BCM number indicates 17 in this case.

Wiring Pi pin number indicates 0 in this case.

2 Likes

je viens apporter ma maigre contribution
Les sujets de plus de 1 an ne sont plus à jour ,mais aide quand même.

Merci à Fudd79 qui parle de gpio readall et on trouve x manière de l'installer sauf que maintenant il est installer d'office dans le package ce pour un rapberry Pi 3 B+ acheté en dec 2020 et fabriqué en 2017 monté en 12/2020
sauf que les pins lu par gpio readall ne corresponde pas du tout au schéma vu sur le net sur le site Framboise par exemple.
Sa marche sur le port pin N°7 à la position physique 4 à gauche sur le raspberry suivant schéma.
schéma noté gpio 4 (lu par gpio readall en gpio7) .

et le Ground pin N°6 à la position physique 3 à droite sur le raspberry suivant schéma.

Je pense que le schéma lu par gpio readall est basé sur d'ancien raspberry et depuis d'autres ports sont apparus. Donc la commande est très bien pour valider l'état d'une pin mais pas pour savoir le N° de port GPIO
Il serait bien d'insister sur le vocabulaire Pin physique du Raspberry à vérifier sur chaque modèle ou port GPIO,dans le plugin filament simplified on indique le numéro de pin physique donc pour moi pin 4.
Et bien sur bien vérifier les ports ou le raspberry fume.

Donc aujourd'hui oui le plugin filament sensor simplified semble fonctionner sur une anycubic Chiron sur une raspberry PI 3B+ de 2017 le port indiqué est 4 , sans modification du fichier config.yaml qui est lié au tout premier plugin filament ou autre modification. Mais Le plugin Enclosure Octiprint semble plus malléable et paramétrable ,c'est ma solution aujourdhui.

En mettant enable les ports IEC via le menu sudo raspi-config ,je n'ai pas la connaissance à savoir si tous les ports sont lisibles mais j'ai lu dans un post seul les ports jusqu'à 7 sont lisibles sans config particulière (à confirmer) et si cette opération était indispensable.
Pour enfoncer le clou pour ceux qui comprenne lentement comme moi.
Pin N°7 numérotation Raspberry
position physique 4 ième pin à gauche en positionnant le raspberry suivant la photo.
port GPIO 4 suivant schéma ci dessus mais lu port gpio7 par la commande Gpio readall qui ne sert qu'a voir l'état des pins 0 ou 1
Et vérifier à trois fois ,vos branchement car le raspberry peut être détruit
Merci à Tous

Houps everything works except that printer detects publishes a message, suspends printing
but when I raise the head does not come to position or the stop has occurred and remains above the plateau and it seems that Octoprint stops and I have to restart it.
:sweat_smile: :smirk: