Skip to content

Commit 4de8b43

Browse files
gijsiopeter-pycom
authored andcommitted
Pybytes mqtt conflict
1 parent 23fc6e0 commit 4de8b43

File tree

1 file changed

+4
-1
lines changed
  • content/tutorials/networkprotocols

1 file changed

+4
-1
lines changed

content/tutorials/networkprotocols/mqtt.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ aliases:
66
- chapter/tutorials/all/mqtt
77
---
88

9-
MQTT is a lightweight messaging protocol that is ideal for sending small packets of data to and from IoT devices via WiFi.
9+
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.
1010

1111
The broker used in this example is the [IO Adafruit](https://io.adafruit.com) platform, which is free and allows for tinkering with MQTT.
1212

1313
Visit [IO Adafruit](https://io.adafruit.com) and create an account. You'll need to get hold of an API Key as well as your credentials. Visit this [guide](https://learn.adafruit.com/adafruit-io/mqtt-api) for more information about MQTT and how to use it with Adafruit's Broker.
1414

1515
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.
1616

17+
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.
18+
1719
```python
1820
from mqtt import MQTTClient
21+
# from mqtt import MQTTClient_lib as MQTTClient
1922
from network import WLAN
2023
import machine
2124
import time

0 commit comments

Comments
 (0)