<?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>Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122525/problem--116-error-using-mqtt-protocal-to-connect-emqx-broker-server-gcp-in-nrf9151-board</link><description>Hi, 
 
 I&amp;#39;m trying to connect to the EMQX(what I made on GCP) using mqtt protocal. I&amp;#39;m using the sample code that nordic provides in lesson. Based on the Exercise4 code which is l4_el_sol. 
 I successfully connected with a test server which is mqtt.nordicsemi</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Jun 2025 16:56:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122525/problem--116-error-using-mqtt-protocal-to-connect-emqx-broker-server-gcp-in-nrf9151-board" /><item><title>RE: Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board</title><link>https://devzone.nordicsemi.com/thread/540762?ContentTypeID=1</link><pubDate>Fri, 27 Jun 2025 16:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88674382-e287-4a90-b809-a768854667ea</guid><dc:creator>Junyoung Jeon</dc:creator><description>&lt;p&gt;Thank you for helping me out. I solved this problem. Appreciate it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jeon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board</title><link>https://devzone.nordicsemi.com/thread/540664?ContentTypeID=1</link><pubDate>Fri, 27 Jun 2025 07:39:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12615a2b-46da-4a28-8f8d-68dbfc4328bf</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="Junyoung Jeon"]Yes I can send the datas from my computer to &amp;quot;&lt;span&gt;mqtt.nordicsemi.academy&amp;quot;&lt;/span&gt;[/quote]
&lt;p&gt;If this works, then the issue sounds to be with the EMQX host IP, and not an issue with the nRF9151&lt;/p&gt;
[quote user="Junyoung Jeon"]Should I try using Mosquitto?[/quote]
&lt;p&gt;The reason for why I suggest this is to verify that you are able to connect to the EMQX host IP and if the issue is on the broker side or on the nRF9151 side.&amp;nbsp;&lt;/p&gt;
[quote user="Junyoung Jeon"]do you know why it says -12 or -116? I changed a liittle bit in broker_init() now it says -12 error[/quote]
&lt;p&gt;These error codes are found in e.g. nrfxlib/nrf_modem/include/nrf_errno.h.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NRF_ETIMEDOUT&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;116&lt;/span&gt;&lt;span&gt; /**&amp;lt; Connection timed out */&lt;/span&gt;&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;lt; Not enough space */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Not enough space could indicate that the EMQX broker needs certificates that are larger than 2k, part of the limitation of the device:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Limitations
***************
- TLS and DTLS
    - Secure socket buffer size is 2kB.
    - Maximum length of DTLS datagram is 1kB.
    - One TLS handshake at a time is supported.
    - Concurrent secure connections
        - Maximum server certificate chain size has a limit of 4kB.
        - Two active connections are supported when serialized DTLS connection exists.
        - Two active connections are supported when any client certificate size is over 1kB.
        - Two active connections are supported when GNSS acquisition is active.
        - Three active connections are supported when client certificate sizes are 1kB or less.
        - Four serialized DTLS connections are supported.
    - Server certificate expiry time is not verified.
    - pkcs#8 is not supported.
    - Maximum number of supported credentials is 32. The actual amount depends on the size of
      credentials as the memory area reserved for credentials may be a limiting factor as well.
    - TLS is not supported when the socket is configured in TCP server mode.
- IP fragmentation and reassembly are not supported.
- It is recommended to free the modem resources by closing unused network sockets and by undefining
  unused PDN connections with AT+CGDCONT.
- Maximum number of raw sockets is 4.
- User plane data is supported in Cat M1 mode only.
- Non-IP Data Delivery (NIDD) feature is verified only for NB-IoT. NIDD for LTE-M is not supported.
- The number of ownership keys is restricted to one. Multiple instances are not allowed.&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Perhaps the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/README.html"&gt;MQTT sample&lt;/a&gt; would be a better starting point for more advanced MQTT connections.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board</title><link>https://devzone.nordicsemi.com/thread/540622?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2025 16:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e14572a7-7c19-4332-87d9-c736749a5db5</guid><dc:creator>Junyoung Jeon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for reply. Yes I can send the datas from my computer to &amp;quot;&lt;span&gt;mqtt.nordicsemi.academy&amp;quot; which is the address Nordic provides. Should I try using Mosquitto? and do you know why it says -12 or -116? I changed a liittle bit in broker_init() now it says -12 error&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jeon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board</title><link>https://devzone.nordicsemi.com/thread/540548?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2025 08:30:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:321bd95c-651d-407c-a8d5-30384cfb250c</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]So I changed hostname to EMQX host IP.[/quote]
&lt;p&gt;Are you able to access this IP from your computer? I.e. can you use Mosquitto to send message from your computer to this MQTT broker?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>