#SmartGarden : Update the broker url and adding delay variable

This commit is contained in:
ThomasFransolet 2019-05-23 22:30:18 +02:00
parent 86f967a0f4
commit df85167cd7
2 changed files with 13 additions and 2 deletions

View 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/

View File

@ -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