dever 5 éve
szülő
commit
ff2edfc9da
4 módosított fájl, 7 hozzáadás és 7 törlés
  1. 2 2
      install.py
  2. 1 1
      service/modbus/rtu.py
  3. 1 1
      service/modbus/tcp.py
  4. 3 3
      service/mqtt/subs.py

+ 2 - 2
install.py

@@ -156,7 +156,7 @@ def device():
 			model.name = value['name']
 			model.insert()
 
-#manage()
-#farm()
+manage()
+farm()
 device()
 Demeter.echo('install success!')

+ 1 - 1
service/modbus/rtu.py

@@ -26,7 +26,7 @@ class Rtu(object):
 				check = "ps aux|grep '"+command+"'|grep -v entrypoint|grep -v grep|grep -v process|awk '{print $1}'"
 				check = Shell.popen(check)
 				if not check:
-					Shell.popen(command)
+					Shell.popen(command, sub=True, bg=True)
 
 	def client(self, id):
 		server = Demeter.service('common').one('setting_server', id=id)

+ 1 - 1
service/modbus/tcp.py

@@ -26,7 +26,7 @@ class Tcp(object):
 				check = "ps aux|grep '"+command+"'|grep -v entrypoint|grep -v grep|grep -v process|awk '{print $1}'"
 				check = Shell.popen(check)
 				if not check:
-					Shell.popen(command)
+					Shell.popen(command, sub=True, bg=True)
 
 	def client(self, id):
 		server = Demeter.service('common').one('setting_server', id=id)

+ 3 - 3
service/mqtt/subs.py

@@ -7,7 +7,7 @@
 import time
 from demeter.core import *
 from demeter.mqtt import *
-timeSleep = 1000
+timeSleep = 10
 import random
 class Subs(object):
 
@@ -20,12 +20,12 @@ class Subs(object):
         if topic:
             mqtt = Demeter.path + 'mqtt.py'
             for v in topic:
-                command = 'python3 ' + mqtt + ' -m sub -t ' + v
+                command = 'python3 ' + mqtt + ' -m subs -t ' + v
 
                 check = "ps aux|grep '"+command+"'|grep -v entrypoint|grep -v grep|grep -v process|awk '{print $1}'"
                 check = Shell.popen(check)
                 if not check:
-                    Shell.popen(command)
+                    Shell.popen(command, sub=True, bg=True)
 
     def load(self, topic):
         Sub(topic)