|
@@ -7,8 +7,8 @@
|
|
"""
|
|
"""
|
|
from demeter import *
|
|
from demeter import *
|
|
import paho.mqtt.client as mqtt
|
|
import paho.mqtt.client as mqtt
|
|
-from gevent import monkey; monkey.patch_all()
|
|
|
|
-import gevent
|
|
|
|
|
|
+#from gevent import monkey; monkey.patch_all()
|
|
|
|
+#import gevent
|
|
|
|
|
|
class Connect(object):
|
|
class Connect(object):
|
|
|
|
|
|
@@ -31,13 +31,15 @@ class Connect(object):
|
|
|
|
|
|
def connect(self, client, userdata, flags, rc):
|
|
def connect(self, client, userdata, flags, rc):
|
|
#print("Connected with result code "+str(rc))
|
|
#print("Connected with result code "+str(rc))
|
|
- #client.subscribe("sensor/temperature/#")
|
|
|
|
-
|
|
|
|
|
|
+ #client.subscribe("sensor/#")
|
|
|
|
+ client.subscribe("pic/#")
|
|
|
|
+ """
|
|
gevent.joinall([
|
|
gevent.joinall([
|
|
gevent.spawn(self.subscribe, client, 'sensor/#'),
|
|
gevent.spawn(self.subscribe, client, 'sensor/#'),
|
|
gevent.spawn(self.subscribe, client, 'pic/#'),
|
|
gevent.spawn(self.subscribe, client, 'pic/#'),
|
|
gevent.spawn(self.subscribe, client, 'msg/#'),
|
|
gevent.spawn(self.subscribe, client, 'msg/#'),
|
|
])
|
|
])
|
|
|
|
+ """
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def subscribe(client, key):
|
|
def subscribe(client, key):
|