<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MQTT Example - About Broker&amp;#39;s IP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15055/mqtt-example---about-broker-s-ip</link><description>Hi, I use the following. 
 
 Raspberry Pi 3 (RPi3 with Raspbian Jessie 4.4) as a router, 
 
 RPi3 is connected to a Wi-Fi router to access the Internet by using the built-in Wi-Fi BLE BCM43438 chip. 
 
 
 IoT SDK 0.9 
 
 
 MQTT Publisher Example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Aug 2016 10:31:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15055/mqtt-example---about-broker-s-ip" /><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57465?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 10:31:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92d001df-b004-4890-b820-179370dccf95</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, I just meant that I don&amp;#39;t know how the data is represented at your end.. If you see raw data, only the payload, or if the payload is decoded into text strings or whatever. But if you got it working now it doesn&amp;#39;t matter:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57464?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 14:27:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bce318c-0aac-4b1f-852b-8c8ac4fb35fd</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Sorry for the late response. The expected string was received and Wireshark showed the topic and payload as you mentioned.&lt;/p&gt;
&lt;p&gt;Lastly, about &lt;strong&gt;&amp;quot;But I&amp;#39;m not sure at which level you can read the message on your broker.&amp;quot;&lt;/strong&gt;,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what you mean about the &amp;quot;level&amp;quot;.&lt;/p&gt;
&lt;p&gt;Which &amp;quot;level&amp;quot; are you inferring?&lt;/p&gt;
&lt;p&gt;-Best Regards, Mango&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57463?ContentTypeID=1</link><pubDate>Sat, 30 Jul 2016 18:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51421aba-595c-44cd-9ffc-c837e8e2c9ce</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Oh, I will check it with Wireshark.&lt;/p&gt;
&lt;p&gt;I think the nRF52 send a hexadecimal value. The Mosquitto client which subscribed &amp;quot;led/state&amp;quot; didn&amp;#39;t show any character but created new line after pressing button from the nRF52.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57462?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2016 16:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0af8899c-01e9-48fb-a4c7-a9ad43f8c2e4</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;It should receive more than two bytes. The message consists of the topic: &amp;quot;led/state&amp;quot;, a 2 byte message counter and one byte describing on or off. But I&amp;#39;m not sure at which level you can read the message on your broker. Maybe it only shows the last byte describing the led state (and translates it into a 16 bit integer). What is the value of the bytes you receive?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57461?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2016 17:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a049d2-6aae-44bd-9b6f-09dd7ea32568</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Testing with your provided hex file, my broker received 2 bytes when pressing button 2.&lt;/p&gt;
&lt;p&gt;Is this correct?&lt;/p&gt;
&lt;p&gt;About the this &amp;quot;weird&amp;quot; phenomenon, maybe I selected an incorrect source (.c) file when using Keil MDK 5.&lt;/p&gt;
&lt;p&gt;I will reconfigure the project settings again.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57460?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 09:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16473113-7359-45df-ac6e-73c611707af3</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;This is really weird. I&amp;#39;ve not seen that before. I can provide you with a hex that I know is working. I&amp;#39;ll post it in my answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57459?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2016 06:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:869d52ff-8771-40e3-beb6-7efcca45c492</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;&lt;strong&gt;I cannot understand why the destination port is 8883 (shown in Wireshark),&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;even though I configured the port to 1883, the non secure port, with Keil MDK.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;What seems to be the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57458?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 08:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a97b6aa-03bc-49a2-8098-4bf0d1c2c1a3</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;After executing 6tunnel you get: bind, address already in use. Try to &lt;code&gt;ps aux | grep 6tunnel&lt;/code&gt; to see what command is actually running. If it is not the correct one, kill the process and start it again.&lt;/p&gt;
&lt;p&gt;What happens if you sniff the BT0 interface in wireshark? Do you see any activity?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57457?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2016 15:54:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ef14770-0889-4f16-920b-8134f010c5e2</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Well, I posted the result after installing 6tunnel in my edited answer.&lt;/p&gt;
&lt;p&gt;What seems to be the problem?&lt;/p&gt;
&lt;p&gt;-Best Regards, Mango&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57456?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2016 13:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87903043-3877-43ab-a011-16eef53284f9</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;It is on your RPi3. You can use the ip address the way you describe. The command is correct.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Because no matter what the destination ip address is, the 6tunnel will forward every packet arriving on port 1883 to the ip address you specify in the 6tunnel command.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Remember that the MQTT example uses secure connections and port 8883 as default. You can read &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.iotsdk.v0.9.0/iot_sdk_app_mqtt_publisher.html?cp=6_1_0_5_6_0_1_1#iot_sdk_app_mqtt_publisher_setup_button"&gt;here&lt;/a&gt; on how to not use secure connections and port 1883 instead. (Or you can use secure connections and 6tunnel with port 8883 instead. But it might require some extra setup on the EC2 side.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57455?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2016 13:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6278d135-45d8-4f15-841e-b45ab5f507d0</guid><dc:creator>MANGO</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Do I have to install &lt;code&gt;6tunnel&lt;/code&gt; in RPi3 Jessie or my cloud service (Amazon EC2)?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In my case, my EC2 instance is using Ubuntu v14.&lt;/p&gt;
&lt;p&gt;Suppose the &amp;quot;cloud_hostname&amp;quot; (in Amazon, it is called as public IP) is 11.22.33.44&lt;/p&gt;
&lt;p&gt;and I use port 1883.&lt;/p&gt;
&lt;p&gt;So I should type&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# 6tunnel -6 1883 11.22.33.44 1883
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in my RPi3 after installing 6tunnel?&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;&amp;quot;And just leave the m_broker_addr as it is.&amp;quot; Why is that?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Example - About Broker's IP</title><link>https://devzone.nordicsemi.com/thread/57454?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 14:39:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a233204-8062-4294-bade-4ba2f07204d4</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;The IoT SDK only supports ipv6, and the &lt;code&gt;m_broker_addr&lt;/code&gt; variable should contain the ipv6 address of the MQTT broker. If your cloud service don&amp;#39;t support ipv6, you need to translate the ipv6 packets into ipv4 somehow. You can try 6tunnel: &lt;a href="http://toxygen.net/6tunnel/"&gt;http://toxygen.net/6tunnel/&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install 6tunnel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And forward packets from port 1883 (8883 if you are using secure connection)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;6tunnel -6 1883 cloud_hostname 1883
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And just leave the &lt;code&gt;m_broker_addr&lt;/code&gt; as it is.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;hex file modified to use non secure connection: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf52832_5F00_xxaa_5F00_s1xx_5F00_iot.hex"&gt;nrf52832_xxaa_s1xx_iot.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>