<?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[Code Generating Bug existing in the &quot;Subscribe&quot; Block of Software MQTT Module]]></title><description><![CDATA[<p dir="auto">When using Software MQTT Component, the code genrated is wrong. Because the "Subscribe" Block is not a "Statement" but a "Root" block, I can't change the subscribe action after mqtt successfully initialized. So the generated code looks like this:</p>
<pre><code>def setup():
  global kb, mqtt_client ......
==========BAD CODE HERE================
  mqtt_client.subscribe('/cardputer', mqtt__cardputer_event, qos=0)
=====================================

  M5.begin()
  kb = MatrixKeyboard()
  kb.set_callback(kb_pressed_event)
  mqtt_client = MQTTClient('cardputer', 'xxx.xxx.xxx.xxx', port=1883, user='xxx', password='xxx', keepalive=0)
  mqtt_client.reconnect()

.....
</code></pre>
<p dir="auto">Note that the subscribe code generated Even Before M5.begin()!</p>
<p dir="auto">You have to fix this BLOCKING Issue asap to make the block coding mqtt code useful. I can now only manually modify code to make sure the subscribe action works.</p>
]]></description><link>https://community.m5stack.com/topic/6805/code-generating-bug-existing-in-the-subscribe-block-of-software-mqtt-module</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 22:36:37 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6805.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Sep 2024 05:16:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Code Generating Bug existing in the &quot;Subscribe&quot; Block of Software MQTT Module on Wed, 25 Sep 2024 01:25:56 GMT]]></title><description><![CDATA[<p dir="auto">Please use connect instead of reconnect.</p>
]]></description><link>https://community.m5stack.com/post/26498</link><guid isPermaLink="true">https://community.m5stack.com/post/26498</guid><dc:creator><![CDATA[lbuque]]></dc:creator><pubDate>Wed, 25 Sep 2024 01:25:56 GMT</pubDate></item></channel></rss>