diff --git a/compLib/Reset.py b/compLib/Reset.py new file mode 100644 index 0000000..9c7fd7d --- /dev/null +++ b/compLib/Reset.py @@ -0,0 +1,16 @@ +import RPi.GPIO as GPIO +import time + +RESET_PIN = 23 + + +class Reset: + @staticmethod + def reset_bot(): + GPIO.setmode(GPIO.BCM) + GPIO.setup(RESET_PIN, GPIO.OUT) + + GPIO.output(RESET_PIN, GPIO.LOW) + time.sleep(0.1) + GPIO.output(RESET_PIN, GPIO.HIGH) + time.sleep(0.5) diff --git a/compLib/__init__.py b/compLib/__init__.py index bc17135..d516a38 100644 --- a/compLib/__init__.py +++ b/compLib/__init__.py @@ -2,6 +2,7 @@ __version__ = "0.1.5-1" import compLib.LogstashLogging import compLib.Spi +import compLib.Reset import logging import apt @@ -16,4 +17,5 @@ except Exception as e: compLib.LogstashLogging.Logging.get_logger().error(f"error during checking apt package version -> {str(e)}") print(f"\033[91merror during checking apt package version -> {str(e)}\033[0m\n") +compLib.Reset.Reset.reset_bot() compLib.Spi.Spi.health_check() \ No newline at end of file