Problem -116 error using mqtt protocal to connect EMQX broker server(GCP) in nRF9151 board

Hi,

I'm trying to connect to the EMQX(what I made on GCP) using mqtt protocal. I'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.academy. So I changed hostname to EMQX host IP. And it doesn't work. I just changed the client->username, password

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Logging
CONFIG_LOG=y
# Button and LED support
CONFIG_DK_LIBRARY=y
# Newlib
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y
# Memory
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=2048
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <ncs_version.h>
#include <zephyr/kernel.h>
#include <zephyr/net/socket.h>
#include <zephyr/logging/log.h>
#include <modem/nrf_modem_lib.h>
#include <modem/lte_lc.h>
/* Include the header file for the MQTT Library*/
#include <zephyr/net/mqtt.h>
#include "mqtt_connection.h"
/* I2C Headers */
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/i2c.h>
#define SEN66_NODE DT_NODELABEL(sen66)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
if you can find what problem is, please let me know. 

-ps connection.c and connection.h is exactly same as a l4_le_sol sample file