From aac99a11baddee09af5ba08097b2b22604a215b0 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Sat, 11 Sep 2021 21:12:58 +0200 Subject: [PATCH] Minor fixes --- compLib/MetricsLogging.py | 3 ++- compLib/Motor.py | 4 ++-- compLib/Reset.py | 4 +++- compLib/__init__.py | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compLib/MetricsLogging.py b/compLib/MetricsLogging.py index f696c0c..24f3099 100644 --- a/compLib/MetricsLogging.py +++ b/compLib/MetricsLogging.py @@ -74,11 +74,12 @@ class MetricsLogging(): global EXTENSIVE_LOGGING if EXTENSIVE_LOGGING: if MetricsLogging.is_influx_reachable(): - EXTENSIVE_LOGGING = False for i in range(CONCURRENCY): worker = threading.Thread(target=MetricsLogging.worker, daemon=True) worker.start() workers.append(worker) + else: + EXTENSIVE_LOGGING = False MetricsLogging.start_workers() diff --git a/compLib/Motor.py b/compLib/Motor.py index ea6e05f..b524d9d 100644 --- a/compLib/Motor.py +++ b/compLib/Motor.py @@ -89,8 +89,8 @@ class Motor(object): elif percent < 0: raw_power = -Motor.__linearizePower(MOTOR_CURVE, -percent) - MetricsLogging.put("Motor", percent, port, False) - Motor.power_raw(port, raw_power) + MetricsLogging.put("Motor", percent, port) + Motor.power_raw(port, raw_power, False) @staticmethod def all_off(): diff --git a/compLib/Reset.py b/compLib/Reset.py index 4767c1b..e81bc55 100644 --- a/compLib/Reset.py +++ b/compLib/Reset.py @@ -3,15 +3,17 @@ import time GPIO.setwarnings(False) RESET_PIN = 23 - +BOOT_PIN = 17 class Reset: @staticmethod def reset_bot(): GPIO.setmode(GPIO.BCM) GPIO.setup(RESET_PIN, GPIO.OUT) + GPIO.setup(BOOT_PIN, GPIO.OUT) GPIO.output(RESET_PIN, GPIO.LOW) + GPIO.output(BOOT_PIN, GPIO.LOW) time.sleep(0.1) GPIO.output(RESET_PIN, GPIO.HIGH) time.sleep(1.5) diff --git a/compLib/__init__.py b/compLib/__init__.py index c0efb79..993095f 100644 --- a/compLib/__init__.py +++ b/compLib/__init__.py @@ -2,6 +2,7 @@ __version__ = "0.1.5-1" import importlib import compLib.LogstashLogging +import compLib.MetricsLogging apt_found = importlib.util.find_spec("apt") is not None