diff --git a/RPI Code/SmartGarden/Installation steps.txt b/RPI Code/SmartGarden/Installation steps.txt new file mode 100644 index 0000000..f537e0e --- /dev/null +++ b/RPI Code/SmartGarden/Installation steps.txt @@ -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/ \ No newline at end of file diff --git a/RPI Code/SmartGarden/allInOne.py b/RPI Code/SmartGarden/allInOne.py index 744608f..b3749e7 100644 --- a/RPI Code/SmartGarden/allInOne.py +++ b/RPI Code/SmartGarden/allInOne.py @@ -7,13 +7,14 @@ from ctypes import c_ubyte import paho.mqtt.client as mqtt import socket -broker="localhost" +broker="192.168.31.118" #username="oilkfgjy" #password="lEyZb90q49Rf" mqttc = mqtt.Client("SmartGarden_PiZero") #mqttc.username_pw_set(username, password) +delayBetweenSending = 300 DEVICE = 0x76 # Default device I2C address @@ -241,7 +242,7 @@ try: #print ("Pressure : ", pressure, "hPa") #print ("Humidity : ", humidity, "%") # Pause for one minute. - time.sleep(60) + time.sleep(delayBetweenSending) except KeyboardInterrupt: # here you put any code you want to run before the program