<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Can&#x27;t instantiate MQTT class (M5 Stick C Plus with Micropython)]]></title><description><![CDATA[<p dir="auto">Hello! I have a small MicroPython program running on my M5 Stick C Plus (with UI Flow firmware version 1.6.5.1-plus, as I get screen errors with 1.6.6-plus) and I wanted to add MQTT communication. I was following <a href="https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/mqtt" target="_blank" rel="noopener noreferrer nofollow ugc">loboris' documentation and examples</a>. However, I get the following error:</p>
<pre><code>  File "main.py", line 289, in &lt;module&gt;
AttributeError: 'module' object has no attribute 'mqtt'
MicroPython 7021d9419-dirty on 2020-10-30; M5StickC-Plus with ESP32
</code></pre>
<p dir="auto">Line 289 looks as follows (I imported <code>network</code> earlier in the code):</p>
<pre><code class="language-python">client = network.mqtt(NAME, SERVER, user="mosquitto", password="mosquitto", cleansession=True, connected_cb=conncb, disconnected_cb=disconncb, subscribed_cb=subscb, published_cb=pubcb, data_cb=datacb)
</code></pre>
<p dir="auto">I'm completely dumbfounded, as the same method call appears in the M5 Cloud MQTT example. Does anybody know what could be causing this behavior?</p>
<p dir="auto">Thanks in advance,</p>
<p dir="auto">Rosa</p>
]]></description><link>https://community.m5stack.com/topic/2539/can-t-instantiate-mqtt-class-m5-stick-c-plus-with-micropython</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 14:21:02 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2539.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Dec 2020 10:16:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can&#x27;t instantiate MQTT class (M5 Stick C Plus with Micropython) on Fri, 04 Dec 2020 08:48:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/5074">@sodoku</a> I see! I'll try that code. Thank you!</p>
]]></description><link>https://community.m5stack.com/post/11024</link><guid isPermaLink="true">https://community.m5stack.com/post/11024</guid><dc:creator><![CDATA[rousveiga]]></dc:creator><pubDate>Fri, 04 Dec 2020 08:48:32 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t instantiate MQTT class (M5 Stick C Plus with Micropython) on Thu, 03 Dec 2020 15:28:37 GMT]]></title><description><![CDATA[<p dir="auto">If I use the mqtt blocks in UIFlow.1.6.6 it generates the following python code:</p>
<pre><code class="language-python">from m5mqtt import M5mqtt

m5mqtt = M5mqtt('NAME', 'SERVER', 1883, 'mosquitto', 'mosquitto', 300)

m5mqtt.publish(str('topic'),str('message'))
</code></pre>
]]></description><link>https://community.m5stack.com/post/11007</link><guid isPermaLink="true">https://community.m5stack.com/post/11007</guid><dc:creator><![CDATA[sodoku]]></dc:creator><pubDate>Thu, 03 Dec 2020 15:28:37 GMT</pubDate></item></channel></rss>