-
Notifications
You must be signed in to change notification settings - Fork 5
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
Added flag to send M600 only once for each detection #1
base: master
Are you sure you want to change the base?
Conversation
Excuse me for maybe not quite understanding what you're wanting to do here but this kind of feature might be dangerous in the terms that, during a print you do want the sensor to pause the print as much as possible when there is no filament. The intention here is to make sure that the printer is not printing air whenever possible but only make sure that we're doing that when we can confirm it rather than it be a faulty pi or switch. The printer should be in a pause loop when you do the filament swap to stop you from trying to start the print again without any filament loaded. I also need to setup a merge request template as well, so thank you for that. |
I agree with detecting as much as possible when there's no filament on the extruder. My problem is that while putting the new spool in sometimes the sensor gets pushed, so another M600 is sent by the plugin. I have not tried the pause function, maybe that only happens if the printer is not paused (ie: you can't pause a paused print!) but when sending gcode it does get sent a few times other while fiddling around with the filament. The two referenced plugins in the README have a couple pull requests to fix this, but they just stop listening for new filament changes, and that's an issue if you're finishing a lot of spools or doing a multiple color print with various strands. To mitigate this I save the timestamp of the last detection and only disable new detections for the determined amount of seconds. Thanks for replying, and I understand if you don't want to merge this, I'm not sure if it's a problem for a lot of people or something specific to my setup :) |
Octoprint doesn't seem to care if code tries to pause a paused print. Personally I don't think this is really an issue unless you have a really bad sensor for filament out but you can fix that with bumping the number of detections up. This might be an issue if I had put in auto resume on filament in. I'm still happy to hear your thoughts however as I'm trying to understand what is going on here. |
I'm my case I have the pause checkbox disabled, since I want the printer to just run the filament change sequence. I guess that for people using pause this is a non issue, but when sending gcode it just keeps sending it until the filament is detected again. My sensor is a basic switch on the filament guide, not sure if I can hook it up in a different way. I tried upping the number of detections, but if I have it too high it detects too late that it's out of filament and it has no way to grab onto it to eject. |
Ok now I understand, you're using the gcode and not the pause print option. |
Sorry to do this to you but do you mind doing this merge on the dev branch please? I'd prefer to keep your name in the commits rather than me adding your code in with my name attached. Actually, I have a different idea. |
Download the latest dev branch as a zip, install it and let me know if that fixes your problem. This might take a while as I don't currently have a functioning printer to test this (and other changes) with. |
I'll try it out later today and report back. Thanks a lot for making this changes! |
I tested it out and the same happens. It keeps receiving confirmations after sending the first GCODE string. I took a look into the modifications made on 4d1eefe but it looks like the "send once" is only accounted for in the I see there's a This is a very clean way to make this work for paused prints, but I think it won't work if the user is only sending GCODE and not pausing, since technically the print is not paused, thus also removing the event will work the first time, but I don't see a clear way to re-add the event any other than a timer or something similar. What are your thoughs on this? I'm up to coding anything any way you prefer to make things easier :) I'm going to configure my printer to just pause and swap the filament manually for now and let you know if anything doesn't work as expected. |
Just an FYI, you'll need to uninstall the plugin then install from the dev zip. |
I installed it on a clean OctoPi instance, going from a zip downloaded directly from the dev branch. |
Did you also enable the send once option in the settings? |
Odd, I'll see if I can make a test suite this weekend to try and get rid of bugs like this without a printer but in saying that the if statement for the send once is for both methods of pausing. I see what I have done, I've not changed the tracking variable up when the pause is triggered, so it is always zero. Let me fix that and get another push. |
Give the latest dev a go now, sorry about that. |
No problem, thanks! It will probably take a few days for me to test it out, looks like my sensor is not working properly. Checking the logs I can see the "Pin: 0" scroll, but if I release the switch nothing happens. If I push it and release manually a bunch of times I can see it detects the release sometimes, depending on timming. Odd, a stand alone script works properly. Maybe something's wrong in my wiring or installation. I'll do a few test and get it working soon :) |
Hi, within two aspects I´ve got similar problems with that plugin. First: This sometimes, specially shortly after starting a print does work fine. Many other times it takes up to five Minutes from stopping the "Pin:0" scroll until starting the pausing action. Putty shows even too a delay in showing new lines. This Putty delay only takes up to 15 sec but the pause action is delayed further on up to those five minutes. Printing with 0,6 nozzle I can´t have the sensor far enough away from the extruder not to give it a chance to runnout of material within 5 Min. It takes place on a Pi 3b+ with the newest octoprint release candidat (same with the lates stable on my second machine) Second: M207 S80 F5000; retract Settings Every now and then this code even too is doubled, what results in two Z10 ups. In my case I´ve swapped out all those tiny miro switches and did setup a new, bigger & more precise one that changes state with that much tension, any mice trap would be proud of. Any results about thos two issues meanwhile? |
@Charly333 I highly suggest using the plugin in the plugin repo if you want a stable printer. |
Hello:
I added functionallity to be able to flag when the filament sensor is triggered so it only triggers once. I did this by adding a configurable option to do so and define the ammount of seconds the sensor triggers should be ignored.
Other solutions just stop detecting new triggers once the first one is detected, but that will cause the sensor to work just once per printing session.
Without this code mine was entering a pause loop since it was triggering while doing the filament swap. This addition fixed that.
Ángel