Go to advanced search

by Idahowalker
Sun Sep 20, 2020 2:33 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

str(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows) <<< Do you see what's wrong with the string conversion function and why there is an indication of this
TypeError: str() takes at most 3 arguments (8 given)
error?
by Idahowalker
Sun Sep 20, 2020 1:14 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

Did you fix this error pi@raspberrypi:~/DHT11_Python $ python3 temperature.py Traceback (most recent call last): File "test3.py", line 35, in <module> lcd_columns, lcd_rows)) TypeError: str() takes at most 3 arguments (8 given) Sry Idahowalker, please forgive me...I really no idea how to fix this e...
by Idahowalker
Sun Sep 20, 2020 1:03 pm
Forum: Other projects
Topic: Real outdoor solar panel for RPi Zero with PiJuice HAT
Replies: 3
Views: 75

Re: Real outdoor solar panel for RPi Zero with PiJuice HAT

I did a search on Amazon with the words "solar panel usb output" for a few results. In general, one can make their own thingy. Get one 12V, 100W solar thingy, hook it to a switching regulator to get 5Volts. Get a USB breakout thingy, solder wires from the 5V to the USB thingy. Plug thingy with 5volt...
by Idahowalker
Sun Sep 20, 2020 11:58 am
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

Did you fix this error
pi@raspberrypi:~/DHT11_Python $ python3 temperature.py
Traceback (most recent call last):
File "test3.py", line 35, in <module>
lcd_columns, lcd_rows))
TypeError: str() takes at most 3 arguments (8 given)
by Idahowalker
Sat Sep 19, 2020 4:35 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

Is that I just follow the code provided and follow the pin I use ? makes sense. Follow the code and my pin getting this pi@raspberrypi:~ $ python3 test.py Usage: sudo ./Adafruit_DHT.py [11|22|2302] <GPIO pin number> Example: sudo ./Adafruit_DHT.py 2302 4 - Read from an AM2302 connected to GPIO pin ...
by Idahowalker
Sat Sep 19, 2020 2:43 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

jayleong1992 wrote:
Sat Sep 19, 2020 2:38 pm
Idahowalker wrote:
Sat Sep 19, 2020 2:02 pm
I'd try another library.

Have you tried the adafruit examples for the library? https://github.com/adafruit/Adafruit_Py ... ruitDHT.py?
Is that I just follow the code provided and follow the pin I use ?
makes sense.
by Idahowalker
Sat Sep 19, 2020 2:02 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

I'd try another library.

Have you tried the adafruit examples for the library? https://github.com/adafruit/Adafruit_Py ... ruitDHT.py?
by Idahowalker
Sat Sep 19, 2020 1:19 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

does this work? #!/usr/bin/python3 import sys import Adafruit_DHT import time from RPLCD import CharLCD import RPi.GPIO as GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23]) while True: humi...
by Idahowalker
Sat Sep 19, 2020 12:27 pm
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

#!/usr/bin/python import sys import Adafruit_DHT from RPLCD import CharLCD import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23]) while True: humidity, temperature = Adafruit_DHT.read_retry(11, 4) p...
by Idahowalker
Sat Sep 19, 2020 12:18 pm
Forum: Automation, sensing and robotics
Topic: Home Automation
Replies: 2
Views: 94

Re: Home Automation

Here is my weather station code. #!/usr/bin/python3 import certs import paho.mqtt.client as mqtt import mysql.connector import time import threading import datetime import signal # mutexPublish          = threading.Lock()  # equal to threading.Semaphore(1) mutexHomePublished    = threading.Lock() ""...
by Idahowalker
Sat Sep 19, 2020 12:11 pm
Forum: Automation, sensing and robotics
Topic: Home Automation
Replies: 2
Views: 94

Re: Home Automation

I have 4 ESP32's used as remote sensor/control devices. Those ESP32's send their data to the RPi. The RPi will route the data as per code. On the RPi, I run MQTT Broker and Python. The ESP32's send their data to the MQTT Broker. The Python program subscribes to the MQTT Broker, receiving messages fr...
by Idahowalker
Sat Sep 19, 2020 11:58 am
Forum: Python
Topic: Implement temperature and humidity(DHT11) using Python
Replies: 33
Views: 635

Re: Implement temperature and humidity(DHT11) using Python

this 'error' message /home/pi/.local/lib/python3.7/site-packages/RPLCD/gpio.py:122: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. is a warning caused by the program not properly shutting down when the program exits. The first time...
by Idahowalker
Fri Sep 18, 2020 2:30 pm
Forum: Troubleshooting
Topic: Pi 4 ethernet dropping often
Replies: 14
Views: 1315

Re: Pi 4 ethernet dropping often

I've experienced such behavior with the RPi3 and RPi4. To solve the issue was to, after the WiFi had connected, plug in the Ethernet cable, wait a few minutes, and unplug the Ethernet cable. For me, after I had completed the plug-in-take-plug-out thing, I've not experienced anymore WiFi disconnects.
by Idahowalker
Tue Sep 15, 2020 11:27 am
Forum: Python
Topic: Multithreading with Adafruit I2C display not updating properly
Replies: 3
Views: 121

Re: Multithreading with Adafruit I2C display not updating properly

Thus threading is not the issue. Does this work? def thread1(): global key while True: print ( "one potato") time.sleep(10) def thread2(): while True: print( "two potato") Does this work def thread1(): global key lock = threading.Lock() while True: print ( "one potato") time.sleep(10) Does this work...
by Idahowalker
Mon Sep 14, 2020 9:05 pm
Forum: Python
Topic: Multithreading with Adafruit I2C display not updating properly
Replies: 3
Views: 121

Re: Multithreading with Adafruit I2C display not updating properly

import time import subprocess from board import SCL, SDA, D4 import busio import digitalio from PIL import Image, ImageDraw, ImageFont import adafruit_ssd1305 import keyboard import string import threading, time import getch oled_reset = digitalio.DigitalInOut(D4) i2c = busio.I2C(SCL, SDA) disp = a...
by Idahowalker
Mon Sep 14, 2020 8:49 pm
Forum: Beginners
Topic: Installer software thinks Python 3 is Python 2
Replies: 2
Views: 119

Re: Installer software thinks Python 3 is Python 2

Without looking at you code, I'd guess you might be missing:

Code: Select all

#!usr/bin/python3
at the top of your sketch?
by Idahowalker
Mon Sep 14, 2020 11:37 am
Forum: Python
Topic: Python editor for Win10
Replies: 4
Views: 294

Re: Python editor for Win10

Why not just run Thonny on the wondows machine?
by Idahowalker
Fri Sep 11, 2020 1:52 pm
Forum: Python
Topic: Printing Temp sensor output on LCD
Replies: 11
Views: 325

Re: Printing Temp sensor output on LCD

When you put the RPi back to its original position, does it now work?
by Idahowalker
Thu Sep 10, 2020 11:46 am
Forum: Automation, sensing and robotics
Topic: Basic Linear Actuator to Churn Water
Replies: 6
Views: 274

Re: Basic Linear Actuator to Churn Water

A micro controller, such as a Arduino Uno or Mega, would be more cost effective than using a RPi.

see https://forum.arduino.cc/index.php?board=9.0.
by Idahowalker
Tue Sep 08, 2020 9:02 pm
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1339

Re: Send data from ESP32 to Raspberry PI

Second problem: Right now the ESP32 publishes data every 60s and every publish is saved to the database. I would like to publish the data every 10s to have a more detailed live view but only save it to database every 60s. How can I do that the best way? One can use a variable that is incremented up...
by Idahowalker
Tue Sep 01, 2020 11:15 am
Forum: Troubleshooting
Topic: RPi3: Wifi unavailable after awhile
Replies: 5
Views: 190

Re: RPi3: Wifi unavailable after awhile

My RPi3 and RPi4 had issues with WiFi disconnects. To solve the issue, whiles WiFi is connected, I connected a Ethernet cable to the units, let it sit for a minute, and disconnected. No more WiFi disconnects for me, might work for you?
by Idahowalker
Tue Sep 01, 2020 1:16 am
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1339

Re: Send data from ESP32 to Raspberry PI

Here is my ESP32 code that may be of help #include <WiFi.h> #include <PubSubClient.h> #include "certs.h" #include "sdkconfig.h" #include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/timers.h" #include "freertos/event_groups.h" #include <SPI.h> #include ...
by Idahowalker
Mon Aug 31, 2020 9:23 pm
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1339

Re: Send data from ESP32 to Raspberry PI

perhaps this will provide a few ideas: #!/usr/bin/python3 import certs import paho.mqtt.client as mqtt import mysql.connector import time import threading import datetime import signal # mutexPublish          = threading.Lock()  # equal to threading.Semaphore(1) mutexHomePublished    = threading.Loc...
by Idahowalker
Thu Aug 13, 2020 2:54 pm
Forum: Automation, sensing and robotics
Topic: DHT22: libgpiod_pulsein issue
Replies: 4
Views: 226

Re: DHT22: libgpiod_pulsein issue

You want you code to periodically print the data without having to reload 'everytime'? here is the code you posted import board import adafruit_dht import time dht = adafruit_dht.DHT22(board.D23) print(dht.temperature) print(dht.humidity) Now let's say you did this, instead import board import adafr...
by Idahowalker
Thu Aug 13, 2020 12:46 pm
Forum: Automation, sensing and robotics
Topic: DHT22: libgpiod_pulsein issue
Replies: 4
Views: 226

Re: DHT22: libgpiod_pulsein issue

The first time the code is ran, all the gpio pins are setup the program does its thing and exits. When the program exits the gpio pins are left in the state as set by the first run of the program so that the 2nd time it's ran, the program fails cause what the thing has been done already. The correct...

Go to advanced search