<?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[M5 Stack unable to subscribe and recieve new messages]]></title><description><![CDATA[<p dir="auto">Hello everyone, I am trying to print new messages on my m5 stick c plus, through hive mq. I am able to publish, but not able to subscribe. Not sure what is the issue here, please advise! Thank you in advance!</p>
<p dir="auto">Here is my code:</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import time

setScreenColor(0x111111)


PASSW = None
CLIENTID = None
USER = None
HOST = None



label0 = M5TextBox(47, 49, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(47, 176, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)


PASSW = 'password'
CLIENTID = 'm5stack'
USER = 'user'
HOST = '07ecd30c.s1.eu.hivemq.cloud'
from m5mqtt import M5mqtt

m5mqtt = M5mqtt(CLIENTID,HOST,8883,USER,PASSW,300,ssl=True,ssl_params={'server_hostname':HOST})
m5mqtt.start()
label0.setText('Hello M5')

a = None

def callback(topic_data):
  a = topic_data
  label0.setText(str(a))
  pass

while True:
  m5mqtt.subscribe(str('topic/1'), callback)
</code></pre>
<p dir="auto">My StickCPlus is currently v1.9.8-plus</p>
]]></description><link>https://community.m5stack.com/topic/4607/m5-stack-unable-to-subscribe-and-recieve-new-messages</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:21:39 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4607.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Sep 2022 14:59:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5 Stack unable to subscribe and recieve new messages on Thu, 15 Sep 2022 19:04:14 GMT]]></title><description><![CDATA[<p dir="auto">what do you mean by "Not able to subscribe" ?<br />
Does it not connect or does it not return data?<br />
Does the data turn up in HiveMQ?</p>
<p dir="auto">This looks like Micropython but the functions look strange, you have SSL set to true but no keys and certificates set.</p>
]]></description><link>https://community.m5stack.com/post/18613</link><guid isPermaLink="true">https://community.m5stack.com/post/18613</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 15 Sep 2022 19:04:14 GMT</pubDate></item><item><title><![CDATA[Reply to M5 Stack unable to subscribe and recieve new messages on Thu, 15 Sep 2022 18:30:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/sleepyfatcat" aria-label="Profile: sleepyfatcat">@<bdi>sleepyfatcat</bdi></a></p>
<p dir="auto">any particular reason you subscribe in an infinite while loop? Last time I tried mqtt I called <code>m5mqtt.subscribe()</code> only once and just before calling <code>m5mqtt.start()</code>.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/18611</link><guid isPermaLink="true">https://community.m5stack.com/post/18611</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 15 Sep 2022 18:30:00 GMT</pubDate></item></channel></rss>