-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
normally closed switch #10
Comments
At the moment there isn't a way to invert the behaviour. Let me think over the weekend and I'll get something done. If you need smth fast, you can change the code so that the api returns reverse values and instead of FALLING it should check for RISING and the safety check should be positive not negative ( |
Thanks for the quick response! I will keep an eye out for your next release! Maybe a variable that says up or down? If I were to simply changed the installed code do I have to recompile? I haven't used Python in a long time. |
no, you don't need to recompile but you need to restart octoprint so it's loads the changed code |
I am able to get the correct status returned from the API by swapping the status var. Do you have a good suggestion for code to pause the printer? |
please try the new codes that allow both type of switches. set (codes not yet as a release, so you need to deploy manually) |
Super awesome. It works!!! My printer is pausing randomly though. Does the script set a software type pull up or do I need to put a capacitor into the wiring harness? The light on my sensor stays on the whole time there is filament inside it. The print will pause every once in a while and I have to hit resume on the octo print interface. I have the sensor plugged directly into the PI 3.3v, ground, and GPIO pin 2. From reading it seems like the PI has a built in pull up or pull down resistor that can be selected with software, but I kinda got lost after reading that. |
Thats not good.... It means the switch gets false reads.... You can try to increase the bounce value and see if it helps.... If you're using one of those endstop switches you dont need software pull (up/down). Since you mentioned there is an LED indicator on your switch, I guess you use one of theses : I'll check the codes again. QUite difficult for me to test, as I am not actually using this plugin :D. I wrote it just as an example. And it stuck. |
I increased the bounce to 800 with the same results. I have the switch pictured. I might just buy the sensor you designed it for. I think you even posted a housing! Again thanks for all the hard work, especially on something you don't use yourself. |
The housing is not by me, but thats how the plugin became a little popular... You might try to move to a different RPi pin, maybe a generic one (without a secondary function) |
@cbusillo I added a tiny delay in the reading to try avoiding fake reads... Try the latest code and let me know... Please check if it really pauses when filament runs out. |
After updating the print does not pause at all. It does correctly show if the filament is loaded or not. |
can you paste your plugin settings and the relevant logs ? |
Hi, thanks for making and sharing this plugin. Did you test the input signals with an oscilloscope yet? I recently made my own sensor (http://www.filamentroller.com) which *had* a 600 microsecond blip on power-on which was falsely triggering pause. I assume "bounce" was a millisecond debounce value but trying values 4 to 4000 had no effect. Am I making the wrong assumption here? In any case, I added time.sleep(0.100) to the first line of check_status (100 ms manual software debounce) and the problem was solved. I later modified my circuit so that my sensor no longer needs the software debounce (no more blips, very clean signal); however, I think this may be the answer to your issue here. |
I'm confused. I tried moving the green signal wire from: |
should work... just do a manual deployment |
Should work, and yet....
|
Oh... sorry. I didn't realise this plugin was as inactive as it is...and I can see the reason. Also, thanks for indirectly forcing me to look at yet another bit of python, it's one of those things I keep meaning to learn properly. :) |
most firmware now support filament sensors, so this is kinda obsolete... but it's woking, if one wants to have it working... |
My switch is a normally closed switch. When polling the API it shows 0 when the filament is loaded and 1 when it is not loaded. Is there a variable I can set for a normally closed switch?
The text was updated successfully, but these errors were encountered: