<?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>nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19876/nrf51-iot-mqtt-publisher-example-problems</link><description>Hi,
I just read IoT-MQTT example and have almost exactly the same problem but with the Publisher.
I am running a PI with Raspberian 4.4.34-v7+. I have installed mosquitto on the PI and have radvd installed. I turned on the IPV6 forwarding ( echo 1 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2017 13:55:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19876/nrf51-iot-mqtt-publisher-example-problems" /><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77347?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 13:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d5b2c47-7565-456e-82dc-1ba9386d9479</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Awesome! Glad to hear that you&amp;#39;re up and running!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77346?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 13:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf446c3-6ec5-446f-8f6f-b0ca6eb45b34</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Thank you for all the help. The last ifconfig fixed the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77348?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 13:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec04597c-1cdf-46c9-a8ad-28a5e9196edd</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;FINALLY it works.  Used the 2001:db8::/64 address for the radvd config file and BT0.  Set ifconfig BT0 add 2001:db8::1/64 and set 2001:db8::1 for the broker address in the program.  Also used NON_SECURE setting and 1883 for the broker port.  Ran mosquitto on the PI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77345?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 10:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35f61851-ab00-40c1-bc8d-9680e550c5f5</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Ok, I went back to the 2001:db8::/64 addresses used in the original instructions with the same result.  The instructions in the IOT_SDK are rather unclear about where to run mosquitto.  I have put in on the Raspberry PI.  I have tried putting on a PC (with the FD00:b:: addresses) and that didn&amp;#39;t work either.  I assume if you put it on the PC you have to set up IPV6 routing there but it is NOT in the IOT_SDK instructions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77343?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 13:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8555e20d-ddfe-43f9-a1a6-829438af9793</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Further work and I have found the 0C942 error code.  This occurs in the button press for connect routine. It gets an error_code from mqtt_connect() and then calls APP_ERROR_CHECK(). The error code returned is 51522 = 0xC942. And APP_ERROR_CHECK() is a fron tend for app_error_handler() which sets all the LEDs ON and then enters a endless loop. And that effectively ends the program.  So the connect is failing. Found the problem by tracing down into the code.  It is failing on the tcp_connect() and fails because NO ROUTE TO HOST .  I guess I need a route for the FD00:a:: to FD00:b::2 In the PI&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77344?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 13:11:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c6cfa31-c277-4cec-9c7d-0acf42b81091</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hmm, I do not know if using a different prefix than the one we provide in the IoT SDK would cause this issue. Could you try to use the setup described in the doc, i.e. use the 2001:db8::1/64 prefix? I have not seen that the SoftDevice asserts upon connection to the mosquitto broker( rem.c is one of the internal source files of the SoftDevice). Are you stepping through the code when attempting to connect?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77333?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98c44035-4421-4e34-803e-d7f4fe5f31e8</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;These addresses are all based on this &lt;a href="https://visualgdb.com/tutorials/arm/nrf51/6lowpan/"&gt;Article&lt;/a&gt; which I went through to get IPV6 working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77332?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:42:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68241cbe-731b-428f-b812-1606d8c7bad8</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;I am using different IPV6 addresses (FD00:a::xx for the Nordic) FD00:b::1 for the PI and FD00:b::2 for the PC. but I have the line ifconfig bt0 add fd00:a::/64 and ifconfig eth0 add fd00:b::1/64 in my setup script.  The problem is as soon as I try to make the connection I get the error deep in the Softdevice (file rem.c line 610) and it goes to the app_error_handler and into an infinite loop in that routine. This file doesn&amp;#39;t seem to be in my IOT sources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77340?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a155344e-fb32-461b-9031-e633a7bedc72</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, I have been seeing that issue as well(same setup with an unsecured connection), the solution in my case was to repeatedly try to make a connection with the MQTT broker untill it returns NRF_SUCCESS. I also think that I spottet a mistake in my bash script, there should be a&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo ifconfig btX add 2001:db8::1/64 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after for loop that connects to the devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77339?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eeab480-bfb0-45e0-a878-ac5a9be165a5</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;I never see a message on the mosquitto on the pc that a connection is attempted. The Nordic board goes into an infinite loop after it gets the 0C942 error (app_error_handler())&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77337?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:25:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9b285c5-c248-4f53-99b0-128b72b92018</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;FWIW when I am connected I can ping6 the Nordic board from the PC (where I run mosquitto) so the routing seems to be correct.  Also I am doing the development with Eclipse and the gcc makefile. I have changed the MQTT programs to use the non secure connection and changed the broker port to 1883. The mosquitto that I use comes up with 1883.  I can use mosquitto_pub and mosquitto_sub on the Raspberry Pi and talk to the mosquitto on the PC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77336?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:24:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa64ba32-ea60-4fe3-9cae-d4b28adb3b0b</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I was referring to the connection to the MQTT broker, i.e. mqtt_connect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77331?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c864af1-f6cc-4d31-8321-b393638beeff</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;I have no trouble connecting, it works on the first try every time.  But I have now switched to a Nordic development board instead of the BMD-300 and it has exactly the same results. Cannot connect to with the Publisher and it fails with the 0xC942 error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77330?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2017 14:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:495834fc-13f5-4ac7-b83f-02b7b5327554</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I have observed that sometimes you have to repeatedly try to reconnect, so I&amp;#39;ve set up a timer that repeatedly tries to connect to the broker, e.g. every 10 seconds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77341?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 09:27:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a1b4f62-7941-45c8-bae9-acc8ed7c0e6c</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;The connection is never made.  (Watching the output of mosquitto).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77342?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 09:07:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c6255e-0162-481d-8a52-b4fd1613c8c0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Jim, is it mqtt_connect that returns the 0xC942 error code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77338?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 14:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ab50542-1393-4544-9496-1fa9454a37b4</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Further work, got the APP_LOG working.  To do this I had to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add CFLAGS += -DENABLE_LOG_SUPPORT to the Make file&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit app_trace.c to set the baud rate to 115200 and disable Flow control
3 Add a hardware USB&amp;lt;-&amp;gt;Serial device (3V) TX -&amp;gt; pin 8 RX -&amp;gt; pin 6
With the board connected (I can ping6 it&amp;#39;s address) and mosquitto running on the PC I get&lt;/p&gt;
&lt;p&gt;[APPL]: Physical layer in connectable mode.
[APPL]: Physical layer: connected`.&lt;/p&gt;
&lt;p&gt;[APPL]: IPv6 Interface Up.&lt;/p&gt;
&lt;p&gt;[** ASSERT **]: Error 0x0000C942, Line 0, File ?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77335?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2017 12:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2419db4e-8523-4865-9cf8-42b8da33506d</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Had not thought of this before but I am using the RIGADO BMD-300 eval board 320-00050, is that part of my problem ?
--jim schimpf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77334?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2017 10:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17bcb674-f108-424d-b993-315460cdf4f7</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Hi,
I have duplicated your script and also followed this article &lt;a href="https://visualgdb.com/tutorials/arm/nrf51/6lowpan/"&gt;link text&lt;/a&gt;. When I follow the article I get an IPV6 connection from my PC at FD00:b::2 -&amp;gt; FD00:b::1 (the PI) and can ping my Nordic card at FD00:a::02EF:0bFF:FEA4:88a6 . Then I run mosquitto on the PC (and change the address in the PUB program to FD00:b::2) and still no connection.  I have checked the mosquitto on the PC by running mosquitto_pub and mosquitto_sub on the PI and they publish and subscribe just fine. When I press button 0 all four LED&amp;#39;s come on and stay on. (have to reset to recover).  Also single stepping in gdb (Eclipse) I cannot step through the process of connection as the program jumps to run on the connect step.&lt;/p&gt;
&lt;p&gt;What is step 8 in the process, &amp;quot;Prepare the IPv6 global prefix for the btX interface.&amp;quot; Is that where I assign FD00:b::1 to bt0 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77329?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 20:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6e8de29-33d6-45be-9cd1-10d151e3f08d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;device_list=(
&amp;quot;00:8B:5C:0C:09:AC&amp;quot;
&amp;quot;00:C0:1E:C1:49:66&amp;quot;
&amp;quot;00:BA:F2:90:B8:FB&amp;quot;
)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#echo $PATH
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

# 6lowpan Initialization
modprobe  bluetooth-6lowpan
echo 1 &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_enable

# Enabling IPv6 Forwarding
echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/forwarding

# Restart radvd service
sudo service radvd restart

# Connect to devices in the list

for i in ${device_list[@]}; do
    con_grep=$(hcitool con | grep -o $i)
    if [ &amp;quot;$(hcitool con | grep -o $i)&amp;quot; = &amp;quot;$i&amp;quot; ]; then
        #echo $(hcitool con | grep -o $i)
        #echo &amp;quot;$i&amp;quot;
        echo &amp;quot;Already connected to: $i&amp;quot;
    else
        echo &amp;quot;Connecting to: $i&amp;quot;
        echo &amp;quot;connect $i 1&amp;quot; &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_control
    fi
done
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77328?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 15:49:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:348e2416-83c1-4ee0-a297-e8e4c15fba64</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Thank you again, my script is ( I have two boards)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;


modprobe bluetooth_6lowpan


echo 1 &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_enable


hciconfig

hciconfig hci0 reset 

echo &amp;quot;Connecting..&amp;quot;

echo &amp;quot;connect 00:EF:0B:A4:88:A6 1&amp;quot; &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_control

sleep 5

echo &amp;quot;connect 00:CB:11:CB:73:15 1&amp;quot; &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_control

echo &amp;quot;Forwarding..&amp;quot;

echo 1 &amp;gt;  /proc/sys/net/ipv6/conf/all/forwarding

sleep 1

service radvd restart

sleep 1

ifconfig bt0 add 2001:db8::1/64


Also have you tried connecting to the log output of the Nordic board ?  I can connect but get only garbage at 115200, but nothing prints at 38400. Have tried on OSX and Windows and it&amp;#39;s the same in both.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77327?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 14:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5083316-d3be-4afb-b41e-df1b73fa3a49</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hmm, I&amp;#39;ll post my bash script that does the configuration and connects to my nRF52 devices when I get home((my Raspberry Pi i setup there).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77326?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 14:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7020e904-aed2-4330-9b6f-8083732830ea</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Thank you very much for the help.  I have done as you suggested and added the ifconfig line to my script also I do the forward cmd and restart of radvd.  I have the producer using the default address of 2001:db8::1 and running mosquitto on my PI and still no connection.  The bt0 shows inet6 addr: 2001:db8::1/64 Scope:Global.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51: IoT-MQTT Publisher Example problems</title><link>https://devzone.nordicsemi.com/thread/77325?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 13:29:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14305ae5-bff1-432a-946c-334a111f381a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I have this running on a Raspberry Pi and I  have to manually add the prefix, i.e. &lt;code&gt;sudo ifconfig btX add 2001:db8::1/64&lt;/code&gt; every time after I disconnect and want to re-connect to the broker. Also make sure that every time you run &lt;code&gt;sudo echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/forwarding&lt;/code&gt; and  &lt;code&gt;sudo service radvd restart&lt;/code&gt; after you reboot your pi.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>