<?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>Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118827/using-mqtt-helper-library-for-tls</link><description>Hi, 
 in Cellular Iot Fundamentals there is in lesson 4 an exercise to move to MQTT with TLS. 
 As I used MQTT helper library, I wonder if it is enough to modify the structure 
 
 struct mqtt_helper_conn_params conn_params = { 
 
 
 . hostname = CONFIG_MQTT_BROKER_HOSTNAME</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Feb 2025 18:49:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118827/using-mqtt-helper-library-for-tls" /><item><title>RE: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522735?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 18:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a3bc98b-fba6-4d26-bc62-99228fed05b3</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Sorry, I have a lot of red squiggles. But In effect the program compiles.&lt;br /&gt;Thanks very much.&lt;/p&gt;
&lt;p&gt;Really I am getting crazy with this red squiggles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522570?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 07:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:735ae869-1c0c-4729-aa04-419272b6b52a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please share your error output.&lt;/p&gt;
&lt;p&gt;the bsd socket interface shall be included with this:&lt;/p&gt;
[quote user="Marbro1965"]&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr/net/socket.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
[/quote]
&lt;p&gt;including getaddrinfo().&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: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522433?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 12:35:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab93e91b-1c22-4f1b-905f-b0c8e8a1a54d</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Hi.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Sorry, I am trying to import code of&amp;nbsp;v2.8.x-v2.7.0\l4\l4_e2_sol example in a cpp project but it neds the&lt;/p&gt;
&lt;p&gt;library for&amp;nbsp;&lt;span&gt;&lt;span&gt;getaddrinfo, addrinfo,&lt;/span&gt;&lt;/span&gt;inet_ntop,freeaddrinfo.&lt;/p&gt;
&lt;div&gt;I have include the headers&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr/kernel.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr/net/socket.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr/net/mqtt.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;like in the example but it looks like they are not declared in this header. So I wonder if they are implicitly &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;loaded somewhere else.&lt;br /&gt;If I do not get compiled I cannot solve the problem of missing config.&lt;br /&gt;&lt;br /&gt;Thanks. Regards.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522407?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 11:27:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1d7d4f1-d79b-4d70-a190-59d6d54641e5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you share a log, it will be easier to understand what is happening. Can you share the full output?&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: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522397?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 10:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cac620a5-df95-47d4-b727-9e9bf21daed7</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Yes, it is perfect.&lt;/p&gt;
&lt;p&gt;I am importing this code but why I&amp;nbsp;cannot define&lt;/p&gt;
&lt;p&gt;CONFIG_MQTT_BROKER_HOSTNAME in my prj file?&lt;/p&gt;
&lt;p&gt;I am using actinius icarus board v2.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522395?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 10:20:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c70c0feb-ac7b-4869-858f-d7cbcfe0a4f4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a bit more than that. You can have a peek at the solution if you want:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicDeveloperAcademy/cell-fund/blob/master/v2.6.2-v2.4.0/l4/l4_e2_sol/src/main.c"&gt;https://github.com/NordicDeveloperAcademy/cell-fund/blob/master/v2.6.2-v2.4.0/l4/l4_e2_sol/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522391?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 10:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:989e96ab-a096-4d64-a988-0b43a1ee0e2e</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Probably it is better if I change my code to the l4 example. The samples/net/mqtt is not so clear for me.&lt;br /&gt;&lt;br /&gt;Please tell me , if I only publish and subscribe, is it necessary to call&amp;nbsp;&lt;/p&gt;
&lt;p&gt;fds_init(&amp;amp;client,&amp;amp;fds);&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using MQTT helper library for TLS</title><link>https://devzone.nordicsemi.com/thread/522373?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 09:12:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec39158c-7c03-4055-864b-de1bee300da3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]&lt;div&gt;&lt;div&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;hostname &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; CONFIG_MQTT_BROKER_HOSTNAME&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;port &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; CONFIG_MQTT_BROKER_PORT&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;transport&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;type &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; MQTT_TRANSPORT_SECURE&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;transport&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;tls&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;sec_tag &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; CONFIG_MQTT_TLS_SEC_TAG&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;transport&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;tls&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;hostname &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; CONFIG_MQTT_BROKER_HOSTNAME&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;transport&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;tls&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;peer_verify &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; TLS_PEER_VERIFY_REQUIRED&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;The struct &amp;quot;mqtt_helper_conn_params&amp;quot; does not hold those members. This is the way to do it if you use the mqtt library directly.&lt;/p&gt;
&lt;p&gt;For the net/mqtt sample documentation, see here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/doc/description.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/doc/description.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And the linked documentation for&amp;nbsp;changing mqtt broker:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/doc/provisioning.html#mqtt-sample-provisioning"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/doc/provisioning.html#mqtt-sample-provisioning&lt;/a&gt;&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>