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

Persistent "?" Status #2

Open
SCH00N3R opened this issue Sep 18, 2024 · 6 comments
Open

Persistent "?" Status #2

SCH00N3R opened this issue Sep 18, 2024 · 6 comments

Comments

@SCH00N3R
Copy link

Hello,

After re-imaging my raspberry pi 4+ to run on raspbian (as opposed to OctoPi), the filament sensor portion of this plugin no longer seems to function as expected.

When I log into the Octoprint web UI, I briefly see the checkmark icon in the status bar but it quickly changes to the question mark indicator. I have verified that the correct GPIO pin is configured. I have tested the pin with the GPIO Status plugin. I have manually changed the state of the filament sensor. Through all of these tests and verifications, the question mark status remained.

I also removed the plugin and deleted its data and then reinstalled and reconfigured it. This made no difference.

Any help that you can provide would be appreicated.

Thank you,

Neal

@danieleborgo
Copy link
Owner

Thank you for you feedback, @SCH00N3R.

I have read you checked the filament via GPIO Status, does the pin change status when you remove and insert the filament? Obviously, refreshing GPIO Status each time.

@SCH00N3R
Copy link
Author

Thank you for following up so quickly.

Yes I did see the pin status as well as the voltage change each time I removed and reinsterted the filament. Yes I used the refresh button in GPIO Status to verify each change.

@danieleborgo
Copy link
Owner

I suspect there is a bug within FilamentBuddy, since the pin and GPIO Status behave correctly.

To know if this is the problem it is necessary to check if there are some hints inside OctoPrint logs. This plugin logs will contain the string FilamentBuddy, may you check your logs? I am looking for anything that contains this plugin name.
Thank you

@SCH00N3R
Copy link
Author

I had to turn on debug logging for filamentbuddy and then restart OP. I think I have found a relevant error in the octoprint log:

<2024-09-19 22:07:46,508 - octoprint.plugin - ERROR - Error while calling plugin filamentbuddy
Traceback (most recent call last):
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint/plugin/init.py", line 275, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint/util/init.py", line 1686, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint_filamentbuddy/init.py", line 54, in on_after_startup
self.__reset_plugin()
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint_filamentbuddy/init.py", line 62, in __reset_plugin
self.__initialize_filament_sensor()
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint_filamentbuddy/init.py", line 85, in __initialize_filament_sensor
self.__fs_manager = InterruptFilamentSensorManager(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint_filamentbuddy/manager/InterruptFilamentSensorManager.py", line 36, in init
self.__input_device = DigitalInputDevice(
^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/gpiozero/devices.py", line 108, in call
self = super(GPIOMeta, cls).call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/gpiozero/input_devices.py", line 171, in init
self.pin.when_changed = self._pin_changed
^^^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/gpiozero/pins/init.py", line 432, in
lambda self, value: self._set_when_changed(value),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
self._enable_event_detect()
File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
GPIO.add_event_detect(
RuntimeError: Failed to add edge detection>

@SCH00N3R
Copy link
Author

SCH00N3R commented Sep 20, 2024

I think that I have found the issue. It appears that there was a significant change to how GPIO pins function within the new 6.6 kernel for RPiOS. I have removed the python3-rpi-gpio package and upgraded to python3-rpi-lgpio, but I am still getting the same error in octoprint.log

https://rpi-lgpio.readthedocs.io/_/downloads/en/latest/pdf/

https://forums.raspberrypi.com/viewtopic.php?t=371716

https://forums.raspberrypi.com/viewtopic.php?t=371716

@danieleborgo
Copy link
Owner

I need to replicate your bug. Are you using a Raspberry PI 4 with the last Raspbian release, right?

The very weird part is that GPIO Status is still working as intended, even if it is using the same Python module. Maybe, this bug affects just few features.

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

2 participants