<?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[How can I set the payload for MQTT v1.6]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">In the mysensors v1.6 notes (<a href="https://docs.google.com/document/d/1NKq5uuNdnxF5jWnum7VT32mbKLjuvqlx2A5D1qQ-H3Q/edit#" rel="nofollow ugc">https://docs.google.com/document/d/1NKq5uuNdnxF5jWnum7VT32mbKLjuvqlx2A5D1qQ-H3Q/edit#</a>) it was mentioned that the following pattern is used for mqtt usage</p>
<pre><code>MY-MQTT-TOPIC-PREFIX/NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE

Example topic:
my-mqtt-gateway/1/2/2/0/1
</code></pre>
<p dir="auto">But Actually I don't understand where do I assign the payload ?  Also the gateways subscribes only to mygateway/+/+/+/+/+</p>
<p dir="auto">They are 5 not 6.</p>
<p dir="auto">Using the serial interface there is a payload to be set<br />
7;5;1;0;2;1</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.mysensors.org/topic/2378/how-can-i-set-the-payload-for-mqtt-v1-6</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 04:19:24 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/2378.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Nov 2015 09:35:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Sat, 14 Nov 2015 00:48:51 GMT]]></title><description><![CDATA[<p dir="auto">I guess I solved the problem. Please check <a href="http://forum.mysensors.org/topic/2193/gatewayesp8266mqttclient-in-development-branch/11" rel="nofollow ugc">http://forum.mysensors.org/topic/2193/gatewayesp8266mqttclient-in-development-branch/11</a></p>
]]></description><link>https://forum.mysensors.org/post/24514</link><guid isPermaLink="true">https://forum.mysensors.org/post/24514</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Sat, 14 Nov 2015 00:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 18:31:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hek" aria-label="Profile: hek">@<bdi>hek</bdi></a> sorry this was a typo.</p>
<p dir="auto">Actually it printed Message arrived on topic: mygateway1-in/23/19/1/0/2 on arduino serial. meaning that it received it correctly. I just copied the one without dash with mistake because I was testing with a topic without the dash, cas I thought that this line</p>
<pre><code>    if (strcmp_P(str, MY_MQTT_SUBSCRIBE_TOPIC_PREFIX) != 0)
</code></pre>
<p dir="auto">have problem with the dash.</p>
]]></description><link>https://forum.mysensors.org/post/24498</link><guid isPermaLink="true">https://forum.mysensors.org/post/24498</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Fri, 13 Nov 2015 18:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 18:24:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ahmedadelhosni" aria-label="Profile: ahmedadelhosni">@<bdi>ahmedadelhosni</bdi></a> said:</p>
<blockquote>
<p dir="auto"><code>mosquitto_pub -t mygateway1-in/7/5/1/0/2 -m 1</code><br />
It was received by the gateway and printed</p>
<p dir="auto"><code>Message arrived on topic: mygateway1in/23/19/1/0/2</code></p>
</blockquote>
<p dir="auto">Looks like the dash-character is swallowed when you don't quote the topic on windows.</p>
<p dir="auto">Can't debug this on my mac. Just change the topic prefix in sketch to something without without dash.</p>
<p dir="auto">You seem to have problem with your radio. This has been discussed elsewhere on forum and there is a troubleshoot guide on man site.</p>
]]></description><link>https://forum.mysensors.org/post/24495</link><guid isPermaLink="true">https://forum.mysensors.org/post/24495</guid><dc:creator><![CDATA[hek]]></dc:creator><pubDate>Fri, 13 Nov 2015 18:24:13 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 18:06:32 GMT]]></title><description><![CDATA[<p dir="auto">Still unable to connect with a node.</p>
<p dir="auto">Serial gateway is working with the same pattern sent.</p>
<p dir="auto">I made sure that the buffer sent using serial or using mqtt are the same. I send ;23;19;1;0;2;1 using serial, and mygateway1in/23/19/1/0/2 using mqtt. and both printed same buffer.</p>
<p dir="auto">RF24::write &gt; startFastWrite &gt; RF24::write_payload<br />
023101219490</p>
<p dir="auto">I changed the nRF also but it didn't solve the problem.</p>
]]></description><link>https://forum.mysensors.org/post/24493</link><guid isPermaLink="true">https://forum.mysensors.org/post/24493</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Fri, 13 Nov 2015 18:06:32 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 16:34:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hek" aria-label="Profile: hek">@<bdi>hek</bdi></a> well I don't have a problem in setting the mqtt environment using mosquitto. I just noticed two things now.</p>
<p dir="auto">First, I am working on windows and using chrome plugin MQTTlens. I decided using mosiquitto as you said.But using</p>
<pre><code>mosquitto_pub -t 'mygateway1-in/7/5/1/0/2' -m '1' 
</code></pre>
<p dir="auto">didn't work, I used instead</p>
<pre><code>mosquitto_pub -t mygateway1-in/7/5/1/0/2 -m 1
</code></pre>
<p dir="auto">It was received by the gateway and printed</p>
<pre><code>Message arrived on topic: mygateway1in/23/19/1/0/2
</code></pre>
<p dir="auto">But the second thing is that incomingMQTT() function, the frame is not evaluated at all. It goes to case 0 and return</p>
<pre><code>case 0: {
    // Topic prefix
    if (strcmp_P(str, MY_MQTT_SUBSCRIBE_TOPIC_PREFIX) != 0)
    {
        // Message not for us or malformed!
	    Serial.println("DOOLA - incomingMQTT - case 0 ERROR");
            return;
     }
    Serial.println("DOOLA - incomingMQTT - case 0");
    break;
}

</code></pre>
<p dir="auto">I tried commenting the if condition and I frame was evaluated but i received st=fail:1</p>
<p dir="auto">I suppose that it is working and tested and maybe I have a problem, right ?</p>
]]></description><link>https://forum.mysensors.org/post/24488</link><guid isPermaLink="true">https://forum.mysensors.org/post/24488</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Fri, 13 Nov 2015 16:34:26 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 12:04:05 GMT]]></title><description><![CDATA[<p dir="auto">Using moquitto_pub command line tool you would send it like this:</p>
<p dir="auto"><code>&gt; mosquitto_pub -t 'mygateway1-in/7/5/1/0/2' -m '1'</code></p>
]]></description><link>https://forum.mysensors.org/post/24477</link><guid isPermaLink="true">https://forum.mysensors.org/post/24477</guid><dc:creator><![CDATA[hek]]></dc:creator><pubDate>Fri, 13 Nov 2015 12:04:05 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 11:32:23 GMT]]></title><description><![CDATA[<p dir="auto">Looks like I misunderstood something..payload will be the message itself. I'll test it now and will be back again</p>
]]></description><link>https://forum.mysensors.org/post/24474</link><guid isPermaLink="true">https://forum.mysensors.org/post/24474</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Fri, 13 Nov 2015 11:32:23 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 11:27:28 GMT]]></title><description><![CDATA[<p dir="auto">Sorry Hek but I still don't get it.</p>
<p dir="auto">When I set my mqtt gateway, it subscribes to mygateway-prefex/+/+/+/+/+</p>
<p dir="auto">When I was using serial gateways, I was doing the following to turn on or off a relay.</p>
<p dir="auto">7;5;1;0;2;1 This sets node id 7, child id 5, message type '1' (set), no ack, sub-type '2' (V_LIGHT), to be &gt;&gt;&gt; equal 1 (ON)<br />
7;5;1;0;2;0 This sets node id 7, child id 5, message type '1' (set), no ack, sub-type '2' (V_LIGHT), to be &gt;&gt;&gt; equal 0 (OFF)</p>
<p dir="auto">While using mqtt, what I expected that we subscribe to a topic name like mygateway1-in then I shall normally add my 6 bits which are 7/5/1/0/2/1 or 7/5/1/0/2/0</p>
<p dir="auto">So my question is about setting the payload to 1 or 0. I still can see that you mentioned that MQTT frame is like this<br />
MY-MQTT-TOPIC-PREFIX/NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE<br />
while the serial frame has one more option for payload<br />
node-id;child-sensor-id;message-type;ack;sub-type;<strong>payload</strong>\n</p>
<p dir="auto">I hope that you understood my problem. Thanks.</p>
]]></description><link>https://forum.mysensors.org/post/24473</link><guid isPermaLink="true">https://forum.mysensors.org/post/24473</guid><dc:creator><![CDATA[ahmedadelhosni]]></dc:creator><pubDate>Fri, 13 Nov 2015 11:27:28 GMT</pubDate></item><item><title><![CDATA[Reply to How can I set the payload for MQTT v1.6 on Fri, 13 Nov 2015 10:45:21 GMT]]></title><description><![CDATA[<p dir="auto"><a href="http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway" rel="nofollow ugc">http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway</a></p>
]]></description><link>https://forum.mysensors.org/post/24472</link><guid isPermaLink="true">https://forum.mysensors.org/post/24472</guid><dc:creator><![CDATA[hek]]></dc:creator><pubDate>Fri, 13 Nov 2015 10:45:21 GMT</pubDate></item></channel></rss>