May 2020
Intermediate to advanced
262 pages
6h 48m
English
For sending messages from the edge device to the cloud, we will use the MQTT protocol. We only need to publish to our MQTT server. This makes our code very simple. In Chapter 6, Using MicroPython for Edge Analytics, we set up a CloudMQTT account. Please refer to this account for the values needed in this step:
import paho.mqtt.client as mqttclass Message: def update(self, face_name): mqttc = mqtt.Client(client_id="smart-doorbell") mqttc.username_pw_set('<<username>>', '<<password>>') mqttc.connect('<<server name>>', <<port number>>) mqttc.publish("face_name", face_name)
Read now
Unlock full access