From 4de8b43a1b5303a1ab323bdc83b076a110fd6ae7 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 5 Feb 2021 11:01:36 +0100 Subject: [PATCH] Pybytes mqtt conflict --- content/tutorials/networkprotocols/mqtt.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/tutorials/networkprotocols/mqtt.md b/content/tutorials/networkprotocols/mqtt.md index 38d3549..eb82538 100644 --- a/content/tutorials/networkprotocols/mqtt.md +++ b/content/tutorials/networkprotocols/mqtt.md @@ -6,7 +6,7 @@ aliases: - chapter/tutorials/all/mqtt --- -MQTT is a lightweight messaging protocol that is ideal for sending small packets of data to and from IoT devices via WiFi. +MQTT is a lightweight messaging protocol that is ideal for sending small packets of data to and from IoT devices via WiFi. You will need to get the mqtt library file from our [Pycom libraries](https://github.com/pycom/pycom-libraries/tree/master/lib) repository on GitHub and place it in the `lib` folder of your project. The broker used in this example is the [IO Adafruit](https://io.adafruit.com) platform, which is free and allows for tinkering with MQTT. @@ -14,8 +14,11 @@ Visit [IO Adafruit](https://io.adafruit.com) and create an account. You'll need This example will send a message to a topic on the Adafruit MQTT broker and then also subscribe to the same topic, in order to show how to use the subscribe functionality. +In the Pybytes library, we use mqtt as well. If you want to use a separate mqtt connection in conjunction with Pybytes, you will need to rename the `class MQTTCLient:` in the `mqtt.py` file to (for example) `class MQTTClient_lib:`, and import using the commented statement to avoid a naming conflict. + ```python from mqtt import MQTTClient +# from mqtt import MQTTClient_lib as MQTTClient from network import WLAN import machine import time