Commit d570f08750cce6a5aef885ed4f2943294c8465a8

Authored by mp-loki
1 parent cdc09f45

python clients fixed 'TypeError: on_connect() takes exactly 3 arguments (4 given)'

@@ -19,7 +19,7 @@ import paho.mqtt.client as mqtt @@ -19,7 +19,7 @@ import paho.mqtt.client as mqtt
19 import ssl, socket 19 import ssl, socket
20 20
21 # The callback for when the client receives a CONNACK response from the server. 21 # The callback for when the client receives a CONNACK response from the server.
22 -def on_connect(client, userdata, rc): 22 +def on_connect(client, userdata, rc, *extra_params):
23 print('Connected with result code '+str(rc)) 23 print('Connected with result code '+str(rc))
24 # Subscribing in on_connect() means that if we lose the connection and 24 # Subscribing in on_connect() means that if we lose the connection and
25 # reconnect then subscriptions will be renewed. 25 # reconnect then subscriptions will be renewed.
@@ -18,8 +18,9 @@ @@ -18,8 +18,9 @@
18 import paho.mqtt.client as mqtt 18 import paho.mqtt.client as mqtt
19 19
20 # The callback for when the client receives a CONNACK response from the server. 20 # The callback for when the client receives a CONNACK response from the server.
21 -def on_connect(client, userdata, rc): 21 +def on_connect(client, userdata, rc, *extra_params):
22 print('Connected with result code '+str(rc)) 22 print('Connected with result code '+str(rc))
  23 + #print('***' + str(r))
23 # Subscribing in on_connect() means that if we lose the connection and 24 # Subscribing in on_connect() means that if we lose the connection and
24 # reconnect then subscriptions will be renewed. 25 # reconnect then subscriptions will be renewed.
25 client.subscribe('v1/devices/me/attributes') 26 client.subscribe('v1/devices/me/attributes')
@@ -19,7 +19,7 @@ import paho.mqtt.client as mqtt @@ -19,7 +19,7 @@ import paho.mqtt.client as mqtt
19 import ssl, socket 19 import ssl, socket
20 20
21 # The callback for when the client receives a CONNACK response from the server. 21 # The callback for when the client receives a CONNACK response from the server.
22 -def on_connect(client, userdata, rc): 22 +def on_connect(client, userdata, rc, *extra_params):
23 print('Connected with result code '+str(rc)) 23 print('Connected with result code '+str(rc))
24 # Subscribing in on_connect() means that if we lose the connection and 24 # Subscribing in on_connect() means that if we lose the connection and
25 # reconnect then subscriptions will be renewed. 25 # reconnect then subscriptions will be renewed.