From 28e729c6d9d7ffa211699cd57694104dc7776172 Mon Sep 17 00:00:00 2001
From: Guillaume <sagitta1618@gmail.com>
Date: Tue, 10 May 2022 18:24:30 +0200
Subject: [PATCH] add interface start in __main__

---
 ohmpi.py | 8 +++++++-
 run.sh   | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ohmpi.py b/ohmpi.py
index b8eeaee6..32fc2932 100644
--- a/ohmpi.py
+++ b/ohmpi.py
@@ -21,6 +21,7 @@ from termcolor import colored
 import threading
 from logging_setup import setup_loggers
 from config import CONTROL_CONFIG
+from subprocess import Popen
 
 # finish import (done only when class is instantiated as some libs are only available on arm64 platform)
 try:
@@ -801,4 +802,9 @@ print(current_time.strftime("%Y-%m-%d %H:%M:%S"))
 
 # for testing
 if __name__ == "__main__":
-    ohmpi = OhmPi(settings='ohmpi_param.json')
\ No newline at end of file
+    # start interface
+    Popen(['python', CONTROL_CONFIG['interface']])
+
+    ohmpi = OhmPi(settings='ohmpi_param.json')
+    
+        
\ No newline at end of file
diff --git a/run.sh b/run.sh
index f0886f0a..277fafc2 100755
--- a/run.sh
+++ b/run.sh
@@ -1,4 +1,4 @@
 #!bin/bash
 
 source ./ohmpy/bin/activate
-python webserver.py
+python ohmpi.py
-- 
GitLab