<?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>nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89701/nrf9160-mqtt-simple-example-configured-to-talk-to-test-mosquitto-org-using-mutual-tls-on-port-8884</link><description>Is there a configuration / sample available of mqtt simple to talk to the mosquitto server using an authenticated client on port 8884? I saw a message on here that was about 2 years old that looked like it was trying to solve the same issue, but the modified</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jul 2022 06:43:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89701/nrf9160-mqtt-simple-example-configured-to-talk-to-test-mosquitto-org-using-mutual-tls-on-port-8884" /><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376325?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2022 06:43:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bbdba0b-fe38-4446-a67a-46c76edc87d1</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;[quote user="mincher"]&amp;nbsp;[00:01:46.104,125] &amp;lt;err&amp;gt; mqtt_simple: mqtt_+CEREG: 2,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7,0,9 connect -115 [/quote]&lt;/p&gt;
&lt;p&gt;From &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/cereg_read.html"&gt;the CEREG response&lt;/a&gt; we can see that your device is rejected by the network (&lt;a href="https://telecompedia.net/lte-release-causes/"&gt;https://telecompedia.net/lte-release-causes/&lt;/a&gt;)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Cause #9 – UE identity cannot be derived by the network.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This EMM cause is sent to the UE when the network cannot derive the UE’s identity from the GUTI/S-TMSI/P-TMSI and RAI e.g. no matching identity/context in the network or failure to validate the UE’s identity due to integrity check failure of the received message.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;We will need to see more via the modem trace.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Regarding the errno -12. Have you increased the memory in mqtt_simple? From&amp;nbsp;&lt;em&gt;nrf\samples\nrf9160\mqtt_simple\prj.conf&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# Memory
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=2048&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376283?ContentTypeID=1</link><pubDate>Sat, 09 Jul 2022 00:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21c1f45d-0b97-4c3a-b420-a02ff0ed4175</guid><dc:creator>Richard W Mincher</dc:creator><description>&lt;p&gt;After doing a lot more trial and error&amp;nbsp; (comparing source code and configs) it appears that we can get&amp;nbsp;the failing code to work if we build for a non-debug configuration.&amp;nbsp; If I build for a debug configuration I get random failures.&amp;nbsp; This is unfortunate.&lt;br /&gt;&lt;br /&gt;Is this an indication of some issue?&amp;nbsp; Stack?&amp;nbsp; Heap?&amp;nbsp; Optimization timing?&amp;nbsp; I&amp;#39;m hoping we can resolve debugging -- I&amp;#39;m use to debugging with print and gpio lines, but having a debugger (either in VC or Ozone) is a big plus.&lt;br /&gt;&lt;br /&gt;FYI, we are using SDK 2.0.0, and modem firmware 1.3.2 (the latest).&lt;br /&gt;&lt;br /&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376281?ContentTypeID=1</link><pubDate>Fri, 08 Jul 2022 22:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac2daeee-5d47-4107-bf5c-5ca1f30e6847</guid><dc:creator>Richard W Mincher</dc:creator><description>&lt;p&gt;I&amp;#39;ll take a look at the ticket you reference above and see if I can figure out how to get tracing to work with the feather board.&lt;br /&gt;&lt;br /&gt;In the meantime, we seem to have enabled some modem debugging messages.&amp;nbsp; Are these messages useful?&amp;nbsp; You can see the -12 failures from the client in there.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;LTE Link Connecting...+CEREG: 2,&amp;quot;8B3B&amp;quot;,&amp;quot;0A141511&amp;quot;,7
+CSCON: 1
+CEREG: 5,&amp;quot;8B3B&amp;quot;,&amp;quot;0A141511&amp;quot;,7,,,&amp;quot;00100011&amp;quot;,&amp;quot;00101000&amp;quot;
+CEDRXP: 4,&amp;quot;1001&amp;quot;,&amp;quot;1001&amp;quot;,&amp;quot;0001&amp;quot;
LTE Link Connected![00:01:27.160,888] &amp;lt;inf&amp;gt; mqtt_simple: The MQTT simple sample started
[00:01:28.102,325] &amp;lt;inf&amp;gt; mqtt_simple: IPv4 Address found 5.196.95.208
[00:01:28.109,222] &amp;lt;dbg&amp;gt; mqtt_simple: client_id_get: client_id = xyzzy.hello.world
[00:01:28.117,187] &amp;lt;inf&amp;gt; mqtt_simple: TLS enabled
+CSCON: 0
+CEREG: 5,&amp;quot;8B3B&amp;quot;,&amp;quot;0A150111&amp;quot;,7,,,&amp;quot;00100011&amp;quot;,&amp;quot;00101000&amp;quot;
+CSCON: 1
+CSCON: 0
+CEREG: 2
+CEREG: 5,&amp;quot;8B3B&amp;quot;,&amp;quot;0A141511&amp;quot;,7,,,&amp;quot;00100011&amp;quot;,&amp;quot;00101000&amp;quot;
+CEREG: 5,&amp;quot;8B3B&amp;quot;,&amp;quot;0A150111&amp;quot;,7,,,&amp;quot;00100011&amp;quot;,&amp;quot;00101000&amp;quot;
+CSCON: 1
+CSCON: 0
+CEREG: 2
+CEREG: 2,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7
+CSCON: 1
[00:01:46.104,125] &amp;lt;err&amp;gt; mqtt_simple: mqtt_+CEREG: 2,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7,0,9
connect -115
[00:01:46.113,342] &amp;lt;inf&amp;gt; mqtt_simple: Reconnecting in 60 seconds...
+CSCON: 0
+CEREG: 2,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5904&amp;quot;,7
+CSCON: 1
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5904&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEDRXP: 4,&amp;quot;1001&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;
+CSCON: 0
+CSCON: 1
+CSCON: 0
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5904&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CSCON: 1
+CSCON: 0
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CSCON: 1
+CSCON: 0
+CSCON: 1
[00:02:57.253,051] &amp;lt;err&amp;gt; mqtt_simple: mqtt_connect -12
[00:02:57.258,880] &amp;lt;inf&amp;gt; mqtt_simple: Reconnecting in 60 seconds...
+CSCON: 0
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5904&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CSCON: 1
+CSCON: 0
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5905&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CSCON: 1
+CSCON: 0
+CEREG: 5,&amp;quot;3A66&amp;quot;,&amp;quot;02DD5904&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CSCON: 1
[00:04:08.701,690] &amp;lt;err&amp;gt; mqtt_simple: mqtt_connect -12
[00:04:08.707,519] &amp;lt;inf&amp;gt; mqtt_simple: Reconnecting in 60 seconds...
+CSCON: 0&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376135?ContentTypeID=1</link><pubDate>Fri, 08 Jul 2022 08:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f73be7cd-541c-4858-85b6-b702325c961e</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Sorry to hear about this frustration.&amp;nbsp;&lt;/p&gt;
[quote user="mincher"]Any suggestions on how to debug this?&amp;nbsp; How to get more information from the system as to what&amp;#39;s going on?[/quote]
&lt;p&gt;Yes, we will need to &lt;a href="https://infocenter.nordicsemi.com/topic/ug_trace_collector/UG/trace_collector/collect_modem_trace.html"&gt;see a modem trace&lt;/a&gt; captured with the Trace Collector v2. Make sure to follow instructions and reset device after starting the trace collector. What modem FW and nRF Connect SDK version are you working on?&lt;/p&gt;
[quote user="mincher"]rrors -12, -111, -116, and -104 after some period of trying to connect to the server.[/quote]
&lt;p&gt;When do you get the errors? From&amp;nbsp;nrfxlib\nrf_modem\include\nrf_errno.h&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; NRF_ENOMEM &lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /**&amp;lt; Not enough space */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; NRF_ECONNRESET &lt;/span&gt;&lt;span&gt;104&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;/**&amp;lt; Connection reset */&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; NRF_ECONNREFUSED &lt;/span&gt;&lt;span&gt;111&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp;/**&amp;lt; Connection refused */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; NRF_ETIMEDOUT &lt;/span&gt;&lt;span&gt;116&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; /**&amp;lt; Connection timed out */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Are you able to share more information on you configuration?&amp;nbsp;I found this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/78449/nrf9160-mqtt-client-error--12-enomem-when-host-url-is-very-long"&gt;support ticket regarding ENOMEM and ECONNRESET&lt;/a&gt; when connecting to MQTT.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376104?ContentTypeID=1</link><pubDate>Fri, 08 Jul 2022 06:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14dddf1a-5f11-4690-8e1c-20cf831b571e</guid><dc:creator>Richard W Mincher</dc:creator><description>&lt;p&gt;Another oddity.&amp;nbsp; We modified the MQTT sample to configure it for TLS as described 9 hours ago.&lt;/p&gt;
&lt;p&gt;We took the&amp;nbsp;code that connected to port 8884 and the proj.cnf file and merged it into our working code (with GPS, I2C, SPI Flash, etc.) and we can not connect to test.mosquitto.org on port 8884.&amp;nbsp; We seem to get random errors.&amp;nbsp; &amp;nbsp;Errors -12, -111, -116, and -104 after some period of trying to connect to the server.&lt;br /&gt;&lt;br /&gt;Any suggestions on how to debug this?&amp;nbsp; How to get more information from the system as to what&amp;#39;s going on?&lt;br /&gt;&lt;br /&gt;Back to frustrated...&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/376087?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2022 21:42:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2c7e3c5-e2f6-4f57-9fef-452eb0ae9b4e</guid><dc:creator>Richard W Mincher</dc:creator><description>&lt;p&gt;We were able to configure the CA, device public cert (signed by mosquito), and device private key (generated locally by openssl) using the Certificate Manager in the LTE Link Monitor and get it to connect to mosquitto&amp;#39;s port 8884.&lt;br /&gt;&lt;br /&gt;We tried using what we thought was the correct interface (modem_key_mgmt_write) to programmatically set the above information but that did not work.&amp;nbsp; No error was returned.&amp;nbsp; Is that expected to be in PEM format or does it need to be the un-base64&amp;#39;d binary of the key/cert?&lt;br /&gt;&lt;br /&gt;I read the comments about using the link manager to pre-program the security information, but did want to understand how to do it programmatically.&lt;br /&gt;&lt;br /&gt;We also tried connecting to port 8887 which has an intentionally expired certificate and using the verify_peer set to 2 (required) it doesn&amp;#39;t fail, which I would expect.&amp;nbsp; How can I turn on logging in the modem or TLS so I can see why the expired certificate is not being flagged.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/375771?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 11:59:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b695725a-3041-4b79-8705-de0cf1c08b98</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have a look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_modem/doc/tls_dtls_configuration.html#tls-dtls-configuration"&gt;TLS/DTLS configuration chapter in the modem library documentation&lt;/a&gt;. You can also provision certificates in the Certificate Manager found in the LTE Link Monitor. Both issue &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/security/cmng_set.html"&gt;AT command CMNG&lt;/a&gt; to provision certs.&lt;/p&gt;
&lt;p&gt;The AWS IoT uses Root CA, Client certificate and private key as described in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/libraries/networking/aws_iot.html#id5"&gt;the AWS IoT library documentation&lt;/a&gt;. When provisioning certificates to your board it is important to use correct sec_tag and then refer to this in the MQTT sample with&amp;nbsp;CONFIG_MQTT_TLS_SEC_TAG&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Let me know how that works for you&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Kind regards&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 mqtt simple example configured to talk to test.mosquitto.org using mutual TLS on port 8884?</title><link>https://devzone.nordicsemi.com/thread/375676?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 07:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4735fe3-87ec-46fa-b263-e2266d8b06f5</guid><dc:creator>Richard W Mincher</dc:creator><description>&lt;p&gt;Decided to look at the aws_iot code as a reference to what needed to be done.&amp;nbsp; Took the certificate provisioning code and put in the private key I generated and the CA file referenced on test.mosquitto.org (&lt;a href="https://test.mosquitto.org/ssl/mosquitto.org.crt"&gt;mosquitto.org.crt (PEM format)&lt;/a&gt;).&amp;nbsp; Not sure what to use for the server certificate.&amp;nbsp; And not sure what to do with the signed certificate I got back from mosquito via&amp;nbsp;&lt;a id="" href="https://test.mosquitto.org/ssl/"&gt;https://test.mosquitto.org/ssl/&lt;/a&gt;&amp;nbsp; Also set the port to 8884.&lt;/p&gt;
&lt;p&gt;When I try to connect I get a -111 error (connection refused).&lt;/p&gt;
&lt;p&gt;The certificates are in proper PEM format.&lt;/p&gt;
&lt;p&gt;Any suggestions on how to get this working?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>