Hi,
Just trying to run mqtt sample with TLS and AWS IoT backend. Everything worked fine in the beginning, but then after I tweaked the code a bit I suddenly started getting error -95 during the connect.
Error -95 is not documented in NRF, but I found that it might be EOPNOTSUPP. More debugging showed that it is probably coming from modem and might be related to the certificates somehow. At the same time same certificates worked before and also I tested them using command line.
Few hours later I narrowed down the scope and basically found that absolutely any code change produces the error.
As an example below, a simple printk on line 325 basically breaks the mqtt connection. By commenting that line everything works again. This is 100% consistent.
Can it be somehow related to memory management or something?
Just in case attached my .prj file.
# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_LOG=y
CONFIG_LOG_STRDUP_MAX_STRING=164
CONFIG_LOG_STRDUP_BUF_COUNT=10
CONFIG_DEBUG=y
CONFIG_LOG_IMMEDIATE=y
CONFIG_TEST_RANDOM_GENERATOR=y
# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y
CONFIG_LTE_NETWORK_MODE_NBIOT=n
CONFIG_LTE_LEGACY_PCO_MODE=n
CONFIG_LTE_PSM_REQ_RPTAU="00000110"
CONFIG_LTE_PSM_REQ_RAT="00000000"
# Modem info
CONFIG_MODEM_INFO=y
# BSD library
CONFIG_BSD_LIBRARY=y
CONFIG_BSD_LIBRARY_TRACE_ENABLED=n
# AT Host
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=y
# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y
# Application
CONFIG_MQTT_PUB_TOPIC="topic1"
CONFIG_MQTT_SUB_TOPIC="topic2"
CONFIG_MQTT_CLIENT_ID="same as certificate common name to conform attached policy in AWS"
CONFIG_MQTT_BROKER_HOSTNAME="a44d87bf4oe9dc-ats.iot.ap-southeast-2.amazonaws.com"
CONFIG_MQTT_BROKER_PORT=8883
# Main thread
CONFIG_MAIN_THREAD_PRIORITY=7
# Heap and stacks
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=8192
Thanks