mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
#SmartGarden : Update the broker url and adding delay variable
This commit is contained in:
parent
86f967a0f4
commit
df85167cd7
10
RPI Code/SmartGarden/Installation steps.txt
Normal file
10
RPI Code/SmartGarden/Installation steps.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
sudo pip install RPi.GPIO
|
||||||
|
sudo pip install paho-mqtt
|
||||||
|
|
||||||
|
+ Motion :
|
||||||
|
|
||||||
|
Test the camera : https://thepihut.com/blogs/raspberry-pi-tutorials/16021420-how-to-install-use-the-raspberry-pi-camera
|
||||||
|
|
||||||
|
https://www.hackster.io/sushree-subhasmita-jena/live-cam-with-raspberry-pi-e9f43d?fbclid=IwAR25LTpxOS3ov0PHO0odFYlHiLVyvmAwY2ioLGUCpobtRMRLGIdzrrTOhYE
|
||||||
|
|
||||||
|
http://www.richardmudhar.com/blog/2015/02/raspberry-pi-camera-and-motion-out-of-the-box-sparrowcam/
|
||||||
@ -7,13 +7,14 @@ from ctypes import c_ubyte
|
|||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
broker="localhost"
|
broker="192.168.31.118"
|
||||||
#username="oilkfgjy"
|
#username="oilkfgjy"
|
||||||
#password="lEyZb90q49Rf"
|
#password="lEyZb90q49Rf"
|
||||||
|
|
||||||
mqttc = mqtt.Client("SmartGarden_PiZero")
|
mqttc = mqtt.Client("SmartGarden_PiZero")
|
||||||
#mqttc.username_pw_set(username, password)
|
#mqttc.username_pw_set(username, password)
|
||||||
|
|
||||||
|
delayBetweenSending = 300
|
||||||
|
|
||||||
DEVICE = 0x76 # Default device I2C address
|
DEVICE = 0x76 # Default device I2C address
|
||||||
|
|
||||||
@ -241,7 +242,7 @@ try:
|
|||||||
#print ("Pressure : ", pressure, "hPa")
|
#print ("Pressure : ", pressure, "hPa")
|
||||||
#print ("Humidity : ", humidity, "%")
|
#print ("Humidity : ", humidity, "%")
|
||||||
# Pause for one minute.
|
# Pause for one minute.
|
||||||
time.sleep(60)
|
time.sleep(delayBetweenSending)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
# here you put any code you want to run before the program
|
# here you put any code you want to run before the program
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user