|
@@ -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)
|