From 035b1c4bad49f63dbc1b8ccd95661b5806a7e795 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 23 Feb 2020 01:03:41 +0000 Subject: [PATCH] Add DEBUG environment variable --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1fe9f09..aa8eef4 100644 --- a/main.py +++ b/main.py @@ -6,11 +6,14 @@ logging.basicConfig( from multiprocessing import Process, Queue from queue import Empty import RPi.GPIO as GPIO +import os import json import requests import serial import time +DEBUG = os.environ.get('DEBUG', False) + RELAY_PIN = 17 RFID_EN_PIN = 27 CARDS_FILE = 'card_data.json' @@ -141,4 +144,4 @@ if __name__ == '__main__': Process(target=reader_thread, args=(card_data,)).start() Process(target=update_thread, args=(card_data,)).start() - Process(target=watchdog_thread).start() + if not DEBUG: Process(target=watchdog_thread).start()