It is going to work, but the signal back to RP will be 5V and raspberry pi are not 5V tolerant, using 5V as input will most likely fry your raspberry pi on the long run.
Sorry for not understand correctly that you say here:
The relays module that I used can be found here. Those relays are active low, that means that they will turn on when you put LOW on the output of your pin. In orther to not fry your r-pi > connect 3.3v to VCC, 5V to JD-VCC and Ground to GND> .
You don’t use the jumper, there are two VCC, one that is going to the input of the relay, and the other is going to be used to activate the transistor that will open the relay, so you need to REMOVE THE JUMPER, connect 3.3v from raspberry pi to the pin labeled VCC on the relay, 5V from raspberry pi to JD-VCC on the relay and Ground to GND.
Hi, I am very new to raspberry pi and having a little difficulty getting this setup, I am using a DHT11 sensor. In the octoprint web interface it says the temp is 588.8 and the humidity is 0. When using the instructions on this web page https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated I get temp = 23 humidity = 20% . Do I need to specify somewhere that I am using the DHT11 sensor for this plugin to work correctly? Thank You for any help.
One question: Have you ever thought in modify el main screen and below BED temperature put “enclosure temperature”?
You can make a “Safe plugin for printer” and plus telegram plugin if the electronic has to much temperature then disconnect the printer by rele and trigger a message to telegram, for example…or something like that
Thank you. That seems so obvious now. I am now getting accurate temp reading. However the humidity is still reading 0 in octoprint. I am not sure where to go from here. Does this tell you anything?
It does not make any sense for me, why would you turn the printer off if your enclosure get’s hot? Marin already has fail stops if your printer somehow misbehave, for example if your thermocouple fail, or disconnect.
Yes, when you downloaded the humidity script you copied the html code, like the entire page, you need to copy only the script…
I’m guessing you did not use wget to download the code, you can open the file and remove the unnecessary part, or copy the code bellow:
#!/usr/bin/python
import sys
import Adafruit_DHT
# Parse command line parameters.
sensor_args = { '11': Adafruit_DHT.DHT11,
'22': Adafruit_DHT.DHT22,
'2302': Adafruit_DHT.AM2302 }
if len(sys.argv) == 3 and sys.argv[1] in sensor_args:
sensor = sensor_args[sys.argv[1]]
pin = sys.argv[2]
else:
sys.exit(1)
# Try to grab a sensor reading. Use the read_retry method which will retry up
# to 15 times to get a sensor reading (waiting 2 seconds between each retry).
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
# Note that sometimes you won't get a reading and
# the results will be null (because Linux can't
# guarantee the timing of calls to read the sensor).
# If this happens try again!
if humidity is not None:
print('{0:0.1f}'.format(humidity))
else:
print('Failed')
sys.exit(1)
I have been working on getting your plugin installed, however I am running into some issues I suspect are being caused by another plugin. Here is the 1st Enclosure error message:
017-02-28 02:28:35,067 - octoprint.plugin - ERROR - Error while calling plugin enclosure
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.1-py2.7.egg/octoprint/plugin/__init__.py", line 229, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_enclosure/__init__.py", line 150, in on_after_startup
self.startGPIO()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_enclosure/__init__.py", line 52, in startGPIO
GPIO.setmode(GPIO.BCM)
ValueError: A different mode has already been set!
I am using Filament Sensor Reloaded which uses GPIO.setmode(GPIO.BOARD) - is there a work around so I can use both? I would use your filament sensor however I need a Normally Closed option for my sensor type.
I can make part of the preferences to choose the GPIO type naming… I need to push some of the latest changes that I already made on this plugin. I’ll get it tomorrow and you can try it out…
Someday I will learn to wait to post until I exhaust all efforts. It never fails as soon as I post an issue, I find a resolution.
I changed GPIO.setmode(GPIO.BOARD) to GPIO.setmode(GPIO.BCM) in the Filament Sensor Reloaded, and commented out GPIO.setmode(GPIO.BCM) and GPIO.setwarnings(False) in the Enclosure plugin and everything seems to be working.
I know in a previous message you mentioned you are busy on other projects, however if you find yourself bored one night I’d love a couple of small additions:
An option for Normally Closed on the Filament Sensor
An option for Fahrenheit. I was able to modify Adafruits code to show a Fahrenheit, and modify the template to show “F”, but I know as soon as there is an update I’ll forget how I did it.
New release is out. By the way the filament sensor being Normally Closed or Normally Open has nothing to do with active low and active high settings.
Active low mean that the sensor is triggered on is has a LOW input, example when it is connected to GROUND. You can use a Normally Closed sensor with a GROUND on one side and whatever pin you want on the rPI. when the sensor is triggered it will connect GROUND to RPI and pause the print job. Setting active low and active high only change the input pull resistor to UP or DOWN.