diff --git a/README.md b/README.md index a27e195..0beae30 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ Note: #### Enable I2C and install smbus +Update the system: + +```shell +sudo apt update && sudo apt upgrade -y +``` + To enable I2C: Open a terminal and run the command @@ -155,6 +161,8 @@ Your Power Pi is now ready. ![Dashboard](Assests/dashboard_R3.PNG "UPS Monitoring Dashboard") +If you are new to Node-Red, please checkout their Essentials [video](https://www.youtube.com/watch?v=ksGeUD26Mw0&list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6) series. + Open the Node-Red link in a browser. The link is usually: http://[IP of Raspberry Pi]:1880/ diff --git a/src/ups.py b/src/ups.py index 270b2ba..8871e16 100644 --- a/src/ups.py +++ b/src/ups.py @@ -12,7 +12,7 @@ logging.basicConfig(level=logging.INFO) -USE_1WIRE = False +GPIO4_AVAILABLE = True ENABLE_UDP = True UDP_PORT = 40001 serverAddressPort = ("127.0.0.1", UDP_PORT) @@ -57,7 +57,7 @@ def main(): if ppi.initialize(): sys.exit(1) - if not USE_1WIRE: + if GPIO4_AVAILABLE: try: GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_UP)