Skip to content

Troubleshooting Guide

Vitor de Miranda Henrique edited this page May 26, 2020 · 10 revisions

If you are having problems with the plugin follow the steps before opening an issue or contacting me:

Restart the settings

First thing, double check the pins that you configured on the settings page, double check if the pins should be active low or high, and double check if the pin numbers match the settings. By default the plugin uses BCM pin numbers. If everything looks right remove all octoprint-enclosure settings, save it, restart the server, and see if it start working, next step is to check the octoprint log, look for exceptions or any other issue.

Check input / output outside enclosure plugin

You need to make sure that the problem is isolated to the plugin, so whatever you have configured inside of the plugin needs to be tested with simple python scripts. For example, if you have simple outputs configured, create the following script, make sure to change the pin number to the correct pin that you want to test.

import RPi.GPIO as GPIO
from time import sleep
import signal
import sys

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

PIN_NUMBER = 24

GPIO.setup(PIN_NUMBER, GPIO.OUT)

def signal_handler(signal, frame):
    GPIO.output(PIN_NUMBER, True)
    print 'Exiting...'
    sys.exit(0)


signal.signal(signal.SIGINT, signal_handler)

while True:
    print 'Setting low...'
    GPIO.output(PIN_NUMBER, False)
    sleep(5)
    print 'Setting high'
    GPIO.output(PIN_NUMBER, True)
    sleep(5)

Save the script as output_test.py and run with sudo python output_test.py

To test inputs buttons you can create a python script like the following code, note that the example has two configured pins, one on the rising edge and one on the falling edge just to exemplify.

import RPi.GPIO as GPIO
from time import sleep
import signal
import sys

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

PIN_EVENT_ON_FALLING = 22
PIN_EVENT_ON_RISING =  23

GPIO.setup(PIN_EVENT_ON_FALLING, GPIO.IN, GPIO.PUD_UP)
GPIO.setup(PIN_EVENT_ON_RISING, GPIO.IN, GPIO.PUD_DOWN)

def signal_handler(signal, frame):
    GPIO.clear();
    print 'Exiting...'
    sys.exit(0)

def btnpressed(gpio):
    print "btn " + str(gpio) + " pressed"

GPIO.add_event_detect(PIN_EVENT_ON_FALLING, GPIO.FALLING, callback= btnpressed, bouncetime=200)
GPIO.add_event_detect(PIN_EVENT_ON_RISING, GPIO.RISING, callback= btnpressed, bouncetime=200)

while True:
    sleep(0);

Save the script as input_btn_test.py and execute it with sudo python input_btn_test.py, press the buttons and see if you get any activity on the terminal.

For temperature sensors and neopixel follow guides on adafruit or other tutorials. Get them working outside the enclosure plugin BEFORE asking for help.

3. Few documented problems with fixes

  • Problems with neopixel after upgrade: https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/98

  • My environment can not run python scripts with sudo: https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/76

  • DHT Sensor works outside of the plugin but does not show any value on the plugin: Disable "use sudo" under the advanced section of the plugin

  • Filament sensor does not work: If you have a different firmware from marlin, and octoprint can not control your printer, like move the head, etc, it will not be able to send gcode commands at all, so filament sensors will not work.

  • Unreliable values with DHT sensors: Nothing I can do about it, DHT sensors and raspberry pi don't play very well with each other, change the sensor.

  • It does not work on my X single board computer: Plugin only work on raspberry pi.

If you tried everything next step is looking on the issues page, check if anyone had a similar issue.

Open a new issue

After you exhausted all the possibilities and it is still experiencing problems open a new issue, with a clear title, explain what is happening, attach print screens of you setting and attach your octoprint log. If you create issues without the log I'll simply close it without even looking.

I can't stress enough! ATTACH SCREENSHOTS AND LOG! 99% of the issues are related with configuration.