コード例 #1
0
def on_message(client, userdata, msg):
    print(msg.topic + " " + str(msg.payload))
    message = str(msg.payload)

    if msg.topic == "backendIn/led":
        publish_new("arduinoIn/led", message, "192.168.43.252")

    if msg.topic == "backendIn/motr":
        publish_new("arduinoIn/motor", message, "192.168.43.252")
コード例 #2
0
ファイル: mqtt_server.py プロジェクト: tharukaboss/iothub
def on_message(client, userdata, msg):
	print(msg.topic + " " + str(msg.payload))
	message = str(msg.payload)

	if msg.topic == "arduinoOut/led"
		publish_new("backendOut/led",str(msg.payload),BACK_END_MQTT_SERVER)

	if msg.topic == "arduinoOut/motor"
		publish_new("backendOut/led",str(msg.payload),BACK_END_MQTT_SERVER)
コード例 #3
0
ファイル: test1.py プロジェクト: DeshanKTD/iothub
def on_message(client, userdata, msg):
	print(msg.topic + " " + str(msg.payload))
	message = str(msg.payload)

	if msg.topic == "backendIn/led":
		publish_new("arduinoIn/led",message,"192.168.43.252")

	if msg.topic == "backendIn/motr":
		publish_new("arduinoIn/motor",message,"192.168.43.252")