Filament sensor switch not working at all #92

Closed
opened 2018-02-08 16:23:23 +00:00 by askmurphy · 10 comments
askmurphy commented 2018-02-08 16:23:23 +00:00 (Migrated from github.com)

Hello !
I have installed your nice plugin, and want to use it for a fillament sensor.
I have octoprint running on a RPI3 and I have connected a switch (see attachment) to GPIO26 (pin 37) and GND (pin 39).

SETUP:

Raspberry Pi Inputs
EVENT: printer
Input IO Number: 26
Input Pull Resistor: INPUT PULL UP
Event Trigger: FALL
Printer Action: fillament change
Filament Detection Timeout: 120
Use Board Pin #: not selected

When I start printing and press the switch during a few minutes: nothing happens. If I release the switch, nothing happens also..

I have this code in the fillament change codeblock:

G199 ; pauses the print immediately, and moves the head to X0, Y100.

Don't know what's the problem, doesn't work at all..

Can you help ? I think a lot off people wants to use your plugin..
Thanks in advance !

;-) Arthur

PS: I have also connected an DT22 to GPIO4 (pin 7), and installed the software library for it: that works, I see the temperature and the humity.

pi3_gpio
kw12-11

Hello ! I have installed your nice plugin, and want to use it for a fillament sensor. I have octoprint running on a RPI3 and I have connected a switch (see attachment) to GPIO26 (pin 37) and GND (pin 39). SETUP: Raspberry Pi Inputs EVENT: printer Input IO Number: 26 Input Pull Resistor: INPUT PULL UP Event Trigger: FALL Printer Action: fillament change Filament Detection Timeout: 120 Use Board Pin #: not selected When I start printing and press the switch during a few minutes: nothing happens. If I release the switch, nothing happens also.. I have this code in the fillament change codeblock: G199 ; pauses the print immediately, and moves the head to X0, Y100. Don't know what's the problem, doesn't work at all.. Can you help ? I think a lot off people wants to use your plugin.. Thanks in advance ! ;-) Arthur PS: I have also connected an DT22 to GPIO4 (pin 7), and installed the software library for it: that works, I see the temperature and the humity. ![pi3_gpio](https://user-images.githubusercontent.com/16864371/35984414-af122650-0cf4-11e8-8818-7ecfcf5c3dac.png) ![kw12-11](https://user-images.githubusercontent.com/16864371/35984448-bed30c9e-0cf4-11e8-89ae-ac5a1f2ad502.jpg)
vitormhenrique commented 2018-02-08 16:40:03 +00:00 (Migrated from github.com)

I need a couple of things:

  1. What pins have you used to connect the switch? there are three pins, C, NC and NO.

  2. Have you tested a simple input button python script to test your wiring?

ssh on your pi, create the a new file

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
    input_state = GPIO.input(26)
    if input_state == False:
        print('Button Pressed')
        time.sleep(0.2)

Name it test.py, then try to run without sudo:

python ./test.py

Press the switch, if nothing happens that means that you have something wrong with your wiring...

  1. If the script works, send me your octoprint.log
I need a couple of things: 1. What pins have you used to connect the switch? there are three pins, C, NC and NO. 2. Have you tested a simple input button python script to test your wiring? ssh on your pi, create the a new file ```python import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(26) if input_state == False: print('Button Pressed') time.sleep(0.2) ``` Name it _**test.py**_, then try to run without sudo: `python ./test.py` Press the switch, if nothing happens that means that you have something wrong with your wiring... 3. If the script works, send me your octoprint.log
askmurphy commented 2018-02-09 15:52:52 +00:00 (Migrated from github.com)

the script works, I get the message 'Button Pressed' when I press the button.

Printer doesn't respond to the button at all when printing.

I have added the log..

octoprint.log

the script works, I get the message 'Button Pressed' when I press the button. Printer doesn't respond to the button at all when printing. I have added the log.. [octoprint.log](https://github.com/vitormhenrique/OctoPrint-Enclosure/files/1711570/octoprint.log)
askmurphy commented 2018-02-09 15:57:34 +00:00 (Migrated from github.com)

The pause command for the Craftbot Plus printer is: G197 and the resume command is G198.

It would be nice if the printer could go to pause mode after pressing the button (later it will be replaced by a fillament-sensor switch). Also the extruder head must be parked to the left side.

After the resume command, the extruderhead must be moved to the last printerposition and continue with the printerjob.

Until now, it doesn't work at all.
Strange thing: the DT22 works nice...

The pause command for the Craftbot Plus printer is: G197 and the resume command is G198. It would be nice if the printer could go to pause mode after pressing the button (later it will be replaced by a fillament-sensor switch). Also the extruder head must be parked to the left side. After the resume command, the extruderhead must be moved to the last printerposition and continue with the printerjob. Until now, it doesn't work at all. Strange thing: the DT22 works nice...
vitormhenrique commented 2018-02-09 16:02:13 +00:00 (Migrated from github.com)

Something is a little bit odd...

despite you mention that use board number is not marked, the log is telling that it is being used.

What happens if you change the filament type action to pause? does it work?

Reboot your pi, it will clear gpio modes, change the setting to pause /resume, and test it out, and send me the log again.

Something is a little bit odd... despite you mention that use board number is not marked, the log is telling that it is being used. What happens if you change the filament type action to pause? does it work? Reboot your pi, it will clear gpio modes, change the setting to pause /resume, and test it out, and send me the log again.
askmurphy commented 2018-02-09 18:37:48 +00:00 (Migrated from github.com)

Ok, rebooted again. Checked if the board number is marked: it's not marked.
Printing again, pressed the switch a few times, nothing happens at all ??

octoprint (2).log

screenshots.zip

I have made screenshots and the log is attached too.

Would be great if you can help me to get this working ;-)

So, for your info again: I use a Raspberry Pi v3 model B, connected the switch to GPIO26 (=NC, pin 37) and GPIO19 (=NO, pin35) and the GND of the switch to Ground (=C, pin 39).
I have tried the same again, but now swapped the NC and NO pins, but same results too..

Ok, rebooted again. Checked if the board number is marked: it's not marked. Printing again, pressed the switch a few times, nothing happens at all ?? [octoprint (2).log](https://github.com/vitormhenrique/OctoPrint-Enclosure/files/1712069/octoprint.2.log) [screenshots.zip](https://github.com/vitormhenrique/OctoPrint-Enclosure/files/1712098/screenshots.zip) I have made screenshots and the log is attached too. Would be great if you can help me to get this working ;-) So, for your info again: I use a Raspberry Pi v3 model B, connected the switch to GPIO26 (=NC, pin 37) and GPIO19 (=NO, pin35) and the GND of the switch to Ground (=C, pin 39). I have tried the same again, but now swapped the NC and NO pins, but same results too..
askmurphy commented 2018-02-09 19:09:36 +00:00 (Migrated from github.com)

By the way: maybe you can add in the topmenu of Octoprint next to the Temp/Humity display
(Enc: 19.2°C Hum: 32.5%) also a fillament sensor display to see if for example in this setup the status of GPIO26 and GPIO19 ?

By the way: maybe you can add in the topmenu of Octoprint next to the Temp/Humity display (Enc: 19.2°C Hum: 32.5%) also a fillament sensor display to see if for example in this setup the status of GPIO26 and GPIO19 ?
vitormhenrique commented 2018-02-09 20:02:09 +00:00 (Migrated from github.com)

Status is possible, i'm re writing the entire thing, I'll add on the next release.
I need access to your raspberry pi to trouble shoot this.. Shoot me an email... (email is on my github page)
I need you to open port 22 on your modem to remote ssh, and username and password...

Status is possible, i'm re writing the entire thing, I'll add on the next release. I need access to your raspberry pi to trouble shoot this.. Shoot me an email... (email is on my github page) I need you to open port 22 on your modem to remote ssh, and username and password...
askmurphy commented 2018-02-09 21:30:24 +00:00 (Migrated from github.com)

I have send you 2 emails ;-)

I have send you 2 emails ;-)
vitormhenrique commented 2018-02-11 16:58:29 +00:00 (Migrated from github.com)

The issue was caused because of the firmware. I don't know why, but octoprint could not send gcodes for your printer.

The issue was caused because of the firmware. I don't know why, but octoprint could not send gcodes for your printer.
vitormhenrique commented 2018-02-11 16:59:16 +00:00 (Migrated from github.com)

I'm closing this issue, because it is not really a plugin bug, but an octoprint limitation.

I'm closing this issue, because it is not really a plugin bug, but an octoprint limitation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#92