From ad2794cf917f9f93c8c2e4c2b7cdf73d70041b6e Mon Sep 17 00:00:00 2001 From: NikoLieberum <59099913+NikoLieberum@users.noreply.github.com> Date: Mon, 28 Oct 2024 04:36:55 +0100 Subject: [PATCH 1/3] Update README.md Updated WiringPi installation instructions and clarified GPIO pin declarations. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bd1f437..38a6afe 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,8 @@ This module reads and displays temperature and humidity information from a senso To install the module, use your terminal to: 1. Navigate to your MagicMirror's modules folder. If you are using the default installation directory, use the command:
`cd ~/MagicMirror/modules` 2. Copy the module to your computer by executing the following command:
`git clone https://github.com/glitch452/MMM-LocalTemperature.git` -3. Install the WiringPi library by executing the following command:
`sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y install build-essential wiringpi` - **Note:** If running on Raspberry Pi 4, use the following process to update wiringpi - [http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b](http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b) -4. Make sure the `DHT` program that reads the sensor data is executable by executing the following command:
`cd MMM-LocalTemperature && chmod +x DHT` +3. Install the WiringPi library from [GitHub](https://github.com/WiringPi/WiringPi). Simply clone the repository and run ´./build´. +4. Make sure the [DHT](Customizing the DHT Program) program that reads the sensor data is executable by executing the following command:
`cd MMM-LocalTemperature && chmod +x DHT` ## Using the module @@ -99,6 +97,8 @@ The `DHT` program is a `c` coded program used to read the sensor data. A `c` pro The included `DHT` program is something I pieced together based on code from [dht22 by nebulx29](https://github.com/nebulx29/dht22) and the [Python DHT Sensor Library by Adafruit](https://github.com/adafruit/Adafruit_Python_DHT). +Verify that the correct pin is defined in `DHT.c`. Make sure the WiringPi pin number is set (you can find the WiringPi pin number for the GPIO pin [here](https://pinout.xyz/pinout/wiringpi)). + If you would like to customize the `DHT` program, you can edit the file `DHT.c` with your favorite editor, then re-compile it using the following command: `cc -Wall DHT.c -o DHT -lwiringPi` ## Updates @@ -143,4 +143,4 @@ conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.** \ No newline at end of file +**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.** From 43f787989fcf4ee43b73ee1b81567fbb7e9ec72c Mon Sep 17 00:00:00 2001 From: NikoLieberum <59099913+NikoLieberum@users.noreply.github.com> Date: Mon, 28 Oct 2024 04:39:02 +0100 Subject: [PATCH 2/3] Update DHT.c Added a link to the WiringPi pinout for easier reference and understanding. --- DHT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DHT.c b/DHT.c index 0c84f92..94385e8 100644 --- a/DHT.c +++ b/DHT.c @@ -23,7 +23,7 @@ #define DHT_ERROR_TIMEOUT 2 // GLOBAL VARIABLES -uint8_t dht_pin = 3; // default GPIO 22 (wiringPi 3) +uint8_t dht_pin = 3; // default GPIO 22 (wiringPi 3) - https://pinout.xyz/pinout/wiringpi char mode = 'c'; // valid modes are c, f, k, h, j int data[5] = { 0, 0, 0, 0, 0 }; int debug = 0; From d61eb34eca7a1f56ed3d434e2c74d129f0067390 Mon Sep 17 00:00:00 2001 From: NikoLieberum <59099913+NikoLieberum@users.noreply.github.com> Date: Mon, 28 Oct 2024 04:44:02 +0100 Subject: [PATCH 3/3] Update MMM-LocalTemperature.js Removed config variable - Fix [Issue #31](https://github.com/glitch452/MMM-LocalTemperature/issues/31) --- MMM-LocalTemperature.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMM-LocalTemperature.js b/MMM-LocalTemperature.js index 8927aa9..6a5381d 100644 --- a/MMM-LocalTemperature.js +++ b/MMM-LocalTemperature.js @@ -8,7 +8,7 @@ * MIT Licensed. */ -var axis, Log, config; +var axis, Log; // removed config /** * Register the module with the MagicMirror program