<?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[simple mqtt client not working]]></title><description><![CDATA[<p dir="auto">Trying to run simple mqtt example but always get error at 140 of <a href="http://mqtt.py" target="_blank" rel="noopener noreferrer nofollow">mqtt.py</a></p>
<p dir="auto">♦Traceback (most recent call last):<br />
File &quot;&lt;stdin&gt;&quot;, line 14, in &lt;module&gt;<br />
File &quot;/flash/lib/mqtt.py&quot;, line 140, in subscribe<br />
TypeError: function missing 1 required positional arguments</p>
<pre><code>    struct.pack_into(&quot;!BH&quot;, pkt, 1, 2 + 2 + len(topic) + 1, self.pid)
    #print(hex(len(pkt)), hexlify(pkt, &quot;:&quot;))
    self.sock.write(pkt)
    self._send_str(topic)
    self.sock.write(qos.to_bytes(1))  # LINE 140
    while 1:
        op = self.wait_msg()
        if op == 0x90:
            resp = self.sock.read(4)</code></pre>
]]></description><link>https://forum.pycom.io/topic/2092/simple-mqtt-client-not-working</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 11:20:39 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2092.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Nov 2017 13:43:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to simple mqtt client not working on Tue, 07 Nov 2017 13:43:21 GMT]]></title><description><![CDATA[<p dir="auto">Trying to run simple mqtt example but always get error at 140 of <a href="http://mqtt.py" target="_blank" rel="noopener noreferrer nofollow">mqtt.py</a></p>
<p dir="auto">♦Traceback (most recent call last):<br />
File &quot;&lt;stdin&gt;&quot;, line 14, in &lt;module&gt;<br />
File &quot;/flash/lib/mqtt.py&quot;, line 140, in subscribe<br />
TypeError: function missing 1 required positional arguments</p>
<pre><code>    struct.pack_into(&quot;!BH&quot;, pkt, 1, 2 + 2 + len(topic) + 1, self.pid)
    #print(hex(len(pkt)), hexlify(pkt, &quot;:&quot;))
    self.sock.write(pkt)
    self._send_str(topic)
    self.sock.write(qos.to_bytes(1))  # LINE 140
    while 1:
        op = self.wait_msg()
        if op == 0x90:
            resp = self.sock.read(4)</code></pre>
]]></description><link>https://forum.pycom.io/post/12421</link><guid isPermaLink="true">https://forum.pycom.io/post/12421</guid><dc:creator><![CDATA[misterlisty]]></dc:creator><pubDate>Tue, 07 Nov 2017 13:43:21 GMT</pubDate></item><item><title><![CDATA[Reply to simple mqtt client not working on Wed, 08 Nov 2017 21:04:10 GMT]]></title><description><![CDATA[<p dir="auto">Hey... I had a same issue and it was fairly simple to fix it.<br />
I've created a pull request to the GitHub repo (<a href="https://github.com/pycom/pycom-libraries/pull/36" target="_blank" rel="noopener noreferrer nofollow">https://github.com/pycom/pycom-libraries/pull/36</a>) so you can check what is changed.<br />
I'll struggle with the CLA agreement tomorrow to make the PR mergeable.</p>
]]></description><link>https://forum.pycom.io/post/12480</link><guid isPermaLink="true">https://forum.pycom.io/post/12480</guid><dc:creator><![CDATA[St3veV]]></dc:creator><pubDate>Wed, 08 Nov 2017 21:04:10 GMT</pubDate></item><item><title><![CDATA[Reply to simple mqtt client not working on Thu, 09 Nov 2017 14:46:29 GMT]]></title><description><![CDATA[<p dir="auto">This is my mqtt <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow">main.py</a> which sends msg ok but the subscribe is not returning anything?  ANyone see anything wrong?</p>
<p dir="auto">from network import WLAN<br />
from mqtt import MQTTClient<br />
import machine<br />
import time</p>
<p dir="auto">print(&quot;Setup::event&quot;)<br />
def sub_cb(topic, msg):<br />
print(&quot;mqtt::&quot;,topic,&quot;msg[&quot;,msg,&quot;]&quot;)</p>
<p dir="auto">print(&quot;Connected to Wifi\n&quot;)<br />
client = MQTTClient(&quot;demo&quot;, &quot;<a href="http://test.smallbiz.com.au" target="_blank" rel="noopener noreferrer nofollow">test.smallbiz.com.au</a>&quot;, port=1883)<br />
client.settimeout = 10000<br />
client.set_callback(sub_cb)<br />
client.connect()<br />
client.subscribe(topic=&quot;lopy01/inbox&quot;)</p>
<p dir="auto">while True:<br />
print(&quot;Sending ON&quot;)<br />
client.publish(&quot;lopy01/outbox/&quot;, &quot;ON&quot;)<br />
time.sleep(1)<br />
print(&quot;Sending OFF&quot;)<br />
client.publish(&quot;lopy01/outbox/&quot;, &quot;OFF&quot;)<br />
time.sleep(1)</p>
]]></description><link>https://forum.pycom.io/post/12517</link><guid isPermaLink="true">https://forum.pycom.io/post/12517</guid><dc:creator><![CDATA[misterlisty]]></dc:creator><pubDate>Thu, 09 Nov 2017 14:46:29 GMT</pubDate></item><item><title><![CDATA[Reply to simple mqtt client not working on Fri, 10 Nov 2017 08:15:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1981">@misterlisty</a> The tutorial is broken. You have to manually check for new messages. I created another PR for the tutorial: <a href="https://github.com/pycom/pycom-documentation/pull/15" target="_blank" rel="noopener noreferrer nofollow">https://github.com/pycom/pycom-documentation/pull/15</a></p>
]]></description><link>https://forum.pycom.io/post/12549</link><guid isPermaLink="true">https://forum.pycom.io/post/12549</guid><dc:creator><![CDATA[St3veV]]></dc:creator><pubDate>Fri, 10 Nov 2017 08:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to simple mqtt client not working on Fri, 10 Nov 2017 13:42:42 GMT]]></title><description><![CDATA[<p dir="auto">thanks its working now</p>
]]></description><link>https://forum.pycom.io/post/12561</link><guid isPermaLink="true">https://forum.pycom.io/post/12561</guid><dc:creator><![CDATA[misterlisty]]></dc:creator><pubDate>Fri, 10 Nov 2017 13:42:42 GMT</pubDate></item><item><title><![CDATA[Reply to simple mqtt client not working on Fri, 24 Nov 2017 15:00:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1966">@st3vev</a> thx so much. This should really be mentioned in the tutorial. I also think that this polling needs to be activated automatically once a subscribe happens.</p>
]]></description><link>https://forum.pycom.io/post/13101</link><guid isPermaLink="true">https://forum.pycom.io/post/13101</guid><dc:creator><![CDATA[hansamann]]></dc:creator><pubDate>Fri, 24 Nov 2017 15:00:38 GMT</pubDate></item></channel></rss>