Skip to content
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

Error while calling plugin filament #8

Open
Werja opened this issue Sep 1, 2016 · 16 comments
Open

Error while calling plugin filament #8

Werja opened this issue Sep 1, 2016 · 16 comments

Comments

@Werja
Copy link

Werja commented Sep 1, 2016

from octoprint Log:

2016-09-01 15:53:54,607 - octoprint.plugins.filament - INFO - Running RPi.GPIO version '0.6.2'...
2016-09-01 15:53:54,610 - octoprint.plugins.filament - INFO - Filament Sensor Plugin [filament] initialized...
...
2016-09-01 15:53:57,605 - octoprint.plugins.filament - INFO - Filament Sensor Plugin setup on GPIO [2]...
...
2016-09-01 16:36:19,306 - octoprint.plugin - ERROR - Error while calling plugin filament
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.2.15-py2.7.egg/octoprint/plugin/init.py", line 204, in call_plugin
result = getattr(plugin, method)(_args, *_kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_filament/init.py", line 56, in on_event
self.setup_gpio()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_filament/init.py", line 70, in setup_gpio
GPIO.add_event_detect(self.PIN_FILAMENT, GPIO.FALLING, callback=self.check_gpio, bouncetime=self.BOUNCE)
RuntimeError: Failed to add edge detection

@MoonshineSG
Copy link
Owner

what pin number are you using ?

@Werja
Copy link
Author

Werja commented Sep 2, 2016

2016-09-01 15:53:57,605 - octoprint.plugins.filament - INFO - Filament Sensor Plugin setup on GPIO [2]...
The status request via API works!

@MoonshineSG
Copy link
Owner

That is odd....
Just trying to see what can be wrong... Did you do a "chmod a+rw /dev/gpiomem" ? Assume running under 'pi' user ? What OS version ?

@Werja
Copy link
Author

Werja commented Sep 2, 2016

OS Version 7 (wheezy)
running under pi user
I have the "chmod a+rw /dev/gpiomem" added to the octoprint startscript

@MoonshineSG
Copy link
Owner

MoonshineSG commented Sep 2, 2016

can you run a "sudo chmod a+rw /dev/gpiomem" from terminal ? just run it once and restart OctoPrint .

do a ls -l /dev/gpiomem and capture the output... I'm curious what is it now...

I don't think you need that to be in the startup script...

@MoonshineSG
Copy link
Owner

MoonshineSG commented Sep 2, 2016

Then again... if you said the request via API works it has nothing to do with permissions...
And, of course, the API returns the correct status of the filament sensor.. right ?

@Werja
Copy link
Author

Werja commented Sep 2, 2016

yes..
{
"status": "1"
}
when filament is detected and
{
"status": "0"
}
if not detected

@MoonshineSG
Copy link
Owner

I which I can say I know how to help...
what's your hardware like ? RPi2 RPi3 ?
I can try to do an exact setup and see what happens, but it might take a while for me to have the time to do that...

Not much help from google when searching for "Failed to add edge detection"...

@Werja
Copy link
Author

Werja commented Sep 2, 2016

ok, many thanks for your help.
I think it is a problem in my individual RPi / Octoprint configuration.
I will give you feedback, when the problem is solved.

@MoonshineSG
Copy link
Owner

Please do. It might help in the future.
Hope you solve it!

@ghvader
Copy link

ghvader commented Oct 23, 2016

I have the same exact issue as the OP.
any suggestions?

so the RPI and octoprint see's the change in filament state. but it never pauses.
from the log
setup
2016-10-23 18:17:02,127 - octoprint.plugins.filament - INFO - Filament Sensor Plugin setup on GPIO [24]...
then when called to act
2016-10-23 18:17:46,314 - octoprint.plugins.filament - INFO - Printing started. Filament sensor enabled.
2016-10-23 18:17:47,354 - octoprint.plugin - ERROR - Error while calling plugin filament
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.2.16-py2.7.egg/octoprint/plugin/init.py", line 204, in call_plugin
result = getattr(plugin, method)(_args, *_kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_filament/init.py", line 56, in on_event
self.setup_gpio()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_filament/init.py", line 70, in setup_gpio
GPIO.add_event_detect(self.PIN_FILAMENT, GPIO.FALLING, callback=self.check_gpio, bouncetime=self.BOUNCE)
RuntimeError: Failed to add edge detection

@MoonshineSG
Copy link
Owner

The "RuntimeError: Failed to add edge detection" seams to be a problem with the underlying OS.

@ghvader
Copy link

ghvader commented Oct 25, 2016

i was using the octopi image, today i went ahead and started fresh with raspbian and installed octoprint manually. i was able to get the plugin working correctly.
it did indeed pause the print.. so you were right.. thanks for the tip!

@MoonshineSG
Copy link
Owner

@ghvader if you install the devel branch, the plugin will fire FILAMENT_RUNOUT event. You can then, write your own plugin to handle that event in any way you choose.

A temporary solution, is to write the M commands to turn off the heater and bed in the OctoPrint Settings "GCODE Scripts" / "After print job is paused" (just don't forget to turn it off otherwise ANY pause will stop your heaters!!!)

Btw, you should never leave the house with the printer running.

@ghvader
Copy link

ghvader commented Oct 25, 2016

I saw those options just after i posted my comment.. so i came back for an edit.
I'll give the M codes a try.

yeah yeah :)

@MoonshineSG
Copy link
Owner

@ghvader Wait a couple of minutes and I'm updating the devel. I'm changing "pause" to "gcode" and you can write whatever you want there... This should work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants