Enhanced formatting with markdown of the readme #380
126
README.md
126
README.md
@@ -28,13 +28,22 @@ Here is a list of possibilities:
|
||||
|
||||
Check pictures on thingiverse: http://www.thingiverse.com/thing:2245493
|
||||
|
||||
**Software**
|
||||
## Installation
|
||||
|
||||
Install the plugin using the Plugin Manager bundled with OctoPrint, you can search for the Enclosure plugin or just use the url: https://github.com/vitormhenrique/OctoPrint-Enclosure/archive/master.zip.
|
||||
|
||||
To control the encosure temperature or get temperature trigged events, you need to install and configure a temperature sensor. This plugin can support DHT11, DHT22, AM2302, DS18B20, SI7021, BME280 and TMP102 temperature sensors.
|
||||
## Hardware
|
||||
|
||||
* For the DHT11, DHT22 and AM2302 follow this steps:
|
||||
This plugin support many hardware temperature sensors, led, relays, heater...
|
||||
|
||||
Here are detailled instructions on how to setup them.
|
||||
|
||||
### Temperature sensors
|
||||
|
||||
To control the enclosure temperature or get temperature triggered events, you need to install and configure a temperature sensor. This plugin can support DHT11, DHT22, AM2302, DS18B20, SI7021, BME280 and TMP102 temperature sensors.
|
||||
|
||||
|
||||
#### DHT11, DHT22 and AM2302 sensors
|
||||
|
||||
Wire the sensor following the wiring diagram on the pictures on thingiverse, you can use any GPIO pin.
|
||||
|
||||
@@ -42,84 +51,93 @@ For DHT11 and DHT22 sensors, don't forget to connect a 4.7K - 10K resistor from
|
||||
|
||||
You need to install Adafruit library to use the temperature sensor on raspberry pi.
|
||||
|
||||
Open raspberry pi terminal and type:
|
||||
Open a raspberry pi terminal and type:
|
||||
|
||||
<pre><code>cd ~
|
||||
```
|
||||
cd ~
|
||||
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
|
||||
cd Adafruit_Python_DHT
|
||||
sudo apt-get update
|
||||
sudo apt-get install build-essential python-dev python-openssl
|
||||
sudo python setup.py install</code></pre>
|
||||
sudo python setup.py install
|
||||
```
|
||||
|
||||
Note: All libraries need to be installed on raspberry pi system python not octoprint virtual environment.
|
||||
|
||||
You can test the library by using:
|
||||
|
||||
<pre><code>cd examples
|
||||
```
|
||||
cd examples
|
||||
sudo ./AdafruitDHT.py 2302 4</code></pre>
|
||||
|
||||
```
|
||||
Note that the first argument is the temperature sensor (11, 22, or 2302), and the second argument is the GPIO that the sensor was connected.
|
||||
|
||||
* For the DS18B20 sensor:
|
||||
#### DS18B20 sensor
|
||||
|
||||
Follow the wiring diagram on the pictures on thingiverse. The DS18B20 uses "1-wire" communication protocol, DS18B20 only works on GPIO pin number 4 by default. You also need to add OneWire support for your raspberry pi.
|
||||
|
||||
Start by adding the following line to /boot/config.txt
|
||||
Start by adding the following line to `/boot/config.txt`
|
||||
|
||||
<pre><code>dtoverlay=w1-gpio</code></pre>
|
||||
```
|
||||
dtoverlay=w1-gpio
|
||||
```
|
||||
|
||||
After rebooting, you can check if the OneWire device was found properly with
|
||||
<pre><code>dmesg | grep w1-gpio</code></pre>
|
||||
```
|
||||
dmesg | grep w1-gpio
|
||||
```
|
||||
|
||||
You should see something like
|
||||
<pre><code>[ 3.030368] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0</code></pre>
|
||||
```
|
||||
[ 3.030368] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
|
||||
```
|
||||
|
||||
If you're using the internal pullup resistor, you'll need to enable it manually by running these Python commands. Or, you can simply configure the sensor inside of the Enclosure plugin, which will do this for you.
|
||||
|
||||
```python
|
||||
import RPi.GPIO as GPIO
|
||||
You should be able to test your sensor by rebooting your system with `sudo reboot`. When the Pi is back up and you're logged in again, type the commands you see below into a terminal window. When you are in the 'devices' directory, the directory starting '28-' may have a different name, so `cd` to the name of whatever directory is there.
|
||||
|
||||
PIN=4
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
||||
```
|
||||
|
||||
You should be able to test your sensor by rebooting your system with sudo reboot. When the Pi is back up and you're logged in again, type the commands you see below into a terminal window. When you are in the 'devices' directory, the directory starting '28-' may have a different name, so cd to the name of whatever directory is there.
|
||||
|
||||
<pre><code>sudo modprobe w1-gpio
|
||||
sudo modprobe w1-gpio
|
||||
sudo modprobe w1-therm
|
||||
cd /sys/bus/w1/devices
|
||||
ls
|
||||
cd 28-xxxx (change this to match what serial number pops up)
|
||||
cat w1_slave</code></pre>
|
||||
cat w1_slave
|
||||
```
|
||||
|
||||
The response will either have YES or NO at the end of the first line. If it is yes, then the temperature will be at the end of the second line, in 1/000 degrees C.
|
||||
The response will either have `YES` or `NO` at the end of the first line. If it is `YES`, then the temperature will be at the end of the second line, in 1/000 degrees C.
|
||||
|
||||
Copy the serial number, you will need to configure the plugin. Note that for the serial number includes the 28-, for example 28-0000069834ff.
|
||||
Copy the serial number, you will need to configure the plugin. Note that for the serial number includes the `28-`, for example `28-0000069834ff`.
|
||||
|
||||
The DS18B20 needs a pullup resistor on the data pin. On modern Pi models, you can use a resistor built into the Pi, configured in software. To do this, set the "Input Pull Resistor" option to "Input Pullup". If this doesn't work, you need to use a 4.7K to 10K resistor from the data pin to VCC.
|
||||
|
||||
* For the SI7021, BME280, TMP102 and MCP9808 sensors
|
||||
#### SI7021, BME280, TMP102 and MCP9808 sensors
|
||||
|
||||
Enable I2C on your raspberry pi, depending on raspi-config version, step by step can be different:
|
||||
|
||||
<pre><code>Run sudo raspi-config
|
||||
Use the down arrow to select 9 Advanced Options
|
||||
Arrow down to A7 I2C
|
||||
Select yes when it asks you to enable I2C
|
||||
Also select yes when it asks about automatically loading the kernel module
|
||||
Use the right arrow to select the button
|
||||
Select yes when it asks to reboot
|
||||
</code></pre>
|
||||
```
|
||||
sudo raspi-config
|
||||
```
|
||||
* Use the down arrow to select 9 Advanced Options
|
||||
* Arrow down to A7 I2C
|
||||
* Select yes when it asks you to enable I2C
|
||||
* Also select yes when it asks about automatically loading the kernel module
|
||||
* Use the right arrow to select the button
|
||||
* Select yes when it asks to reboot
|
||||
|
||||
Install some packages (on raspberry pi system python not octoprint virtual environment):
|
||||
|
||||
<pre><code>sudo apt-get install i2c-tools python-pip python-smbus</code></pre>
|
||||
```
|
||||
sudo apt-get install i2c-tools python-pip python-smbus
|
||||
```
|
||||
|
||||
Find the address of the sensor:
|
||||
|
||||
<pre><code>i2cdetect -y 1</code></pre>
|
||||
```
|
||||
i2cdetect -y 1
|
||||
```
|
||||
|
||||
* For Neopixel
|
||||
### Neopixel
|
||||
|
||||
If your setup does not have pip install pip:
|
||||
`sudo apt-get install python-pip`
|
||||
@@ -137,40 +155,36 @@ Also backlist the audio kernel:
|
||||
|
||||
`sudo nano /etc/modprobe.d/snd-blacklist.conf`
|
||||
|
||||
add the `blacklist snd_bcm2835` to the end of the file:
|
||||
add the `blacklist snd_bcm2835` to the end of the file.
|
||||
|
||||
|
||||
* GPIO
|
||||
### GPIO
|
||||
|
||||
This release uses RPi.GPIO to control IO of raspberry pi, it should install and work automatically. If it doesn't please update your octoprint with the latest release of octopi.
|
||||
You can use relays / mosfets to control you lights, heater, lockers etc... If you want to control mains voltage I recommend using [PowerSwitch Tail II](http://www.powerswitchtail.com/).
|
||||
|
||||
**Hardware**
|
||||
|
||||
You can use relays / mosfets to control you lights, heater, lockers etc... If you want to control mains voltage I recommend using PowerSwitch Tail II.
|
||||
|
||||
* Relay
|
||||
### Relay
|
||||
|
||||
The relays module that I used couple [SainSmart 2-Channel Relay Module](https://www.amazon.com/gp/product/B0057OC6D8?ie=UTF8&tag=3dpstuff-20&camp=1789&linkCode=xm2&creativeASIN=B0057OC6D8). Those relays are active low, that means that they will turn on when you put LOW on the output of your pin. In order to not fry your Raspberry Pi pay attention on your wiring connection: remove the jumper link and connect 3.3v to VCC, 5V to JD-VCC and Ground to GND.
|
||||
|
||||
* Heater
|
||||
### Heater
|
||||
|
||||
For heating my enclosure I got a $15 lasko inside my enclosure. I opened it and added a relay to the mains wire. If you’re uncomfortable soldering or dealing with high voltage, please check out the [PowerSwitch Tail II](http://www.powerswitchtail.com/) . The PowerSwitch Tail II is fully enclosed, making it a lot safer.
|
||||
For heating my enclosure I got a $15 lasko inside my enclosure. I opened it and added a relay to the mains wire. If you’re uncomfortable soldering or dealing with high voltage, please check out the [PowerSwitch Tail II](http://www.powerswitchtail.com/). It is fully enclosed, making it a lot safer.
|
||||
|
||||
**CAUTION: VOLTAGE ON MAINS WIRE CAN KILL YOU, ONLY ATTEMPT TO DO THIS IF YOU KNOW WHAT YOU ARE DOING, AND DO AT YOUR OWN RISK**
|
||||
|
||||
**CAUTION 2: THIS HEATER IS NOT INTENDED TO FUNCTION THIS WAY AND IT MIGHT BE A FIRE HAZARD. DO IT AT YOUR OWN RISK**
|
||||
|
||||
* Cooler
|
||||
### Cooler
|
||||
|
||||
You can get a [USB Mini Desktop Fan](https://www.amazon.com/gp/product/B00WM7TRTY?ie=UTF8&tag=3dpstuff-20&camp=1789&linkCode=xm2&creativeASIN=B00WM7TRTY) and control it over a relay.
|
||||
|
||||
* Filament sensor
|
||||
### Filament sensor
|
||||
|
||||
You have the ability to add a filament sensor to the enclosure, it will automatically pause the print and run a gcode command to change the filament if you run out of filament, I can be any type of filament sensor, the sensor should connect to ground if is set as an "active low" when the filament run out or 3.3v if the sensor is set as "active high" when detected the end of filament, it does not matter if it is normally open or closed, that will only interfere on your wiring. I'm using the following sensor:
|
||||
|
||||
http://www.thingiverse.com/thing:1698397
|
||||
|
||||
**Configuration**
|
||||
## Plugin configuration
|
||||
|
||||
You need to enable what do you want the plugin to control. Settings from plugin version < 3.6 are not compatible anymore, you will loose all settings after upgrading the plugin.
|
||||
|
||||
@@ -208,7 +222,7 @@ After selecting GPIO for the input type, and selecting output control on the act
|
||||
Selecting print control on the action type will trigger printer actions when the configured GPIO receives a signal. The actions can be Resume and Pause a print job or Change Filament. You can use the "change filament" action and set up the input GPIO according to your filament sensor, for example, if your filament sensor connects to ground when detects the end of the filament, you should choose PULL UP resistors and detect the event on the falling edge.
|
||||
You can also add mechanical buttons to pause, resume and change filaments near your printer for convenience.
|
||||
|
||||
**Advanced Area**
|
||||
## Advanced Area
|
||||
|
||||
If you want to enable notifications check the following [issue](https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/36)
|
||||
|
||||
@@ -216,16 +230,16 @@ You can control outputs using a simple [API](https://github.com/vitormhenrique/O
|
||||
|
||||
Or use [g-code](https://github.com/vitormhenrique/OctoPrint-Enclosure/wiki/G-CODE-Control) commands
|
||||
|
||||
**Tab Order**
|
||||
### Tab Order
|
||||
|
||||
I often use more this plugin than the time-lapse tab, so having the plugin appear before the timelapse is better for me.
|
||||
|
||||
You can do this by changing the config.yaml file as instructed on [octoprint documentation ](http://docs.octoprint.org/en/master/configuration/config_yaml.html). Unless defined differently via the command line config.yaml is located at ~/.octoprint.
|
||||
You can do this by changing the config.yaml file as instructed on [octoprint documentation ](http://docs.octoprint.org/en/master/configuration/config_yaml.html). Unless defined differently via the command line config.yaml is located at `~/.octoprint`.
|
||||
|
||||
You just need to add the following section:
|
||||
|
||||
|
||||
<pre><code>appearance:
|
||||
```
|
||||
appearance:
|
||||
components:
|
||||
order:
|
||||
tab:
|
||||
@@ -234,4 +248,4 @@ You just need to add the following section:
|
||||
- gcodeviewer
|
||||
- terminal
|
||||
- plugin_enclosure
|
||||
</code></pre>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user