<?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>Sending I2C data over MQTT on nRF9160DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62504/sending-i2c-data-over-mqtt-on-nrf9160dk</link><description>Hello, 
 I am working on MQTT sample ncs\nrf\samples\nrf9160\mqtt_simple. I am sending data from UART and I2C to the mqtt server. For sending data I am using Workqueue thread. This program works properly. I am publishing data from UART and I2C on 2 different</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jun 2020 06:47:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62504/sending-i2c-data-over-mqtt-on-nrf9160dk" /><item><title>RE: Sending I2C data over MQTT on nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/255143?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 06:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d023bac-3765-412b-a9e9-7661b05d7831</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Glad to hear that you found a solution.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending I2C data over MQTT on nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/254943?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 09:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a0c07e2-3417-4633-a1be-c868a027dac0</guid><dc:creator>Jagruti</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I solved the issue.&lt;/p&gt;
&lt;p&gt;I used mqtt_live() after the data_publish function. Now the loop does not stop after the interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending I2C data over MQTT on nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/254772?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 14:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60be8a05-1b0e-446c-ab0f-447aa48244e8</guid><dc:creator>Jagruti</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, I am using one function out of the two (&lt;span&gt;&amp;quot;pub_icm_mqtt&amp;quot; or &amp;quot;data_publish(&amp;amp;client, MQTT_QOS_1_AT_LEAST_ONCE, ICM, strlen(ICM));&amp;quot;&lt;/span&gt;) at a time. I did it for testing.&lt;/p&gt;
&lt;p&gt;Yes the array is zero terminated. I checked the return code from&amp;nbsp;&lt;span&gt;data_publish(), it is working properly. It does not return error.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But I tried few things and observed this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. I disabled UART and sent the I2C data to the cloud and sending the SMS on button press. This program worked properly. Even after the button press, the I2C data was on the cloud. The while(connected) loop did not stop.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Now in the above program I enabled UART and sent both the data (UART and I2C) to the cloud. This program worked properly until the button press like the original problem. On button press, while(connected) loop stopped, but the UART data was still on the cloud. I am using one LED inside while(connected) loop to check. It also stops.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It means that the problem occurs when I use both the peripherals with button. One peripheral with button works without any problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How can I solve this problem, I am not understanding.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending I2C data over MQTT on nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/254730?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 12:37:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cb7a314-a5b7-4a45-830c-d7f99fde0127</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user=""]But If I don&amp;#39;t publish the I2C data, the while(connected) loop continues to work on the button press also.[/quote]
&lt;p&gt;Are you pushing data both to the work queue function &amp;quot;pub_icm_mqtt&amp;quot; and &amp;quot;data_publish(&amp;amp;client, MQTT_QOS_1_AT_LEAST_ONCE, ICM, strlen(ICM));&amp;quot;, or is this an experiment to choose one of these? If both are called, one will overwrite the other.&lt;/p&gt;
&lt;p&gt;strlen() assumes that &amp;quot;\0&amp;quot; is found in the input array. Is the array zero-terminated? Could you also check the return code from data_publish() to see if there&amp;#39;s anything that goes wrong?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>