ENigma
ENigma
@MoonshineSG but it checks for some sensor ?
@MoonshineSG i need to read voltage using raspberry pi running Octopi (which will have battery backup). when power goes off the print will stop but the raspberry pi will still...
@MoonshineSG yes but i dont know where to start how did you write this https://github.com/MoonshineSG/Octoprint-Filament/blob/master/octoprint_filament/__init__.py script? where did you refer ?
i think this is the main part i should look? def check_gpio(self, channel): state = GPIO.input(self.PIN_FILAMENT) self._logger.debug("Detected sensor [%s] state [%s]? !"%(channel, state)) if not state: #safety pin ? self._logger.debug("Sensor...
channel is GPIO pin and state is 0 or 1 right?
``` # coding=utf-8 from __future__ import absolute_import import octoprint.plugin import octoprint.settings import octoprint.util from octoprint.events import eventManager, Events from flask import jsonify, request import logging import logging.handlers import RPi.GPIO as...
how to use the above .py file as plugin? are there any errors? the above code just checks a GPIO and pauses print
@MoonshineSG i do know python ...thank you for that link i was looking for the same thing...thank you
@MoonshineSG i almost got it working but i do have some questions if you could help me that would be great GPIO.FALLING is used to check if there is state...
i have tested and it works only if there is a change and not by default...so your plugin will not pause if the filament is not present from the beginning...