This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disabling serial interface from nrf-9160: Cloud_Client for PSM current measurements

Hi,

I have been able to use the NRF-9160: Cloud_Client sample for sending data to my AWS IoT MQTT broker on PSM mode from my Thingy91 with a CLOUD_MESSAGE_PUBLICATION_INTERVAL set to 10. The code works fine and I can see the strings being received on AWS IoT console every ten seconds.

Now, I want to disable serial interface between the Thingy91 and the computer to measure actual current consumption on PSM mode. For this I set following configuration in my Cloud Client prj.conf file:

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_RESET_ON_FATAL_ERROR=n
# CONFIG_NCS_SAMPLES_DEFAULTS=y

# Log level
# For more verbose and detailed log output, set the log level to
# CONFIG_CLOUD_CLIENT_LOG_LEVEL_DBG=y instead.
CONFIG_SERIAL=n
CONFIG_LOG=n
# CONFIG_LOG_IMMEDIATE=y
# CONFIG_CLOUD_CLIENT_LOG_LEVEL_DBG=y
# CONFIG_CLOUD_CLIENT_LOG_LEVEL_INF=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_NBIOT=y
CONFIG_LTE_LEGACY_PCO_MODE=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_POWER_SAVING_MODE_ENABLE=y

# BSD library
CONFIG_BSD_LIBRARY=y

# DK
CONFIG_DK_LIBRARY=y

# AT commands interface
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_AT_HOST_LIBRARY=y

# Generic cloud API
CONFIG_CLOUD_API=y
CONFIG_CLOUD_PUBLICATION_SEQUENTIAL=y

# nRF Cloud
CONFIG_NRF_CLOUD=n

# AWS IoT library
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_PORT=8883
CONFIG_AWS_IOT_CLIENT_ID_STATIC=""
CONFIG_AWS_IOT_BROKER_HOST_NAME=""
CONFIG_AWS_IOT_SEC_TAG=
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_CONNECTION_POLL_THREAD=y

# Heap and stacks
# Extended memory heap size needed for encoding nRF Cloud messages to JSON
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Modem information
CONFIG_MODEM_INFO=y

Also, I added CONFIG_SERIAL=n in nrf-9160:SPM sample as well.

But with this Cloud Client configuration my code doesn't run and I am not sure what is the problem as I can't debug it without serial interface. The same configuration works when I set the following settings to true:

CONFIG_SERIAL=y
CONFIG_LOG=y
CONFIG_LOG_IMMEDIATE=y
CONFIG_CLOUD_CLIENT_LOG_LEVEL_DBG=y
CONFIG_CLOUD_CLIENT_LOG_LEVEL_INF=y

So I am sure that my other settings are correct and only disabling serial interface makes my code block at some point and I am not sure where.

Is there some setting here which can block the execution of code if the serial is disabled? Can someone please help me debug this issue? I am attaching the full code as well. if that helps4137.cloud_client-psm.rar

Thank you.

Regards,

Haris Ahmed

Parents
  • Hi Haris,

    Check out the UDP example (link to doc), it is the most low power example we have atm. it has logging and serial turned off.  Look at the prj.conf there and see how it is set up. 
    If you still have trouble then pleas update and i will test it out and se if we can produce a solution.
    Regards,
    Jonathan

  • Hi Jonathan,

    Thank you for your response.

    Following your recommendation I tried UDP example and I was able to observe sleep current of 6 - 7 micro amps which seems perfect. But I want to achieve such values during sleep mode in Cloud Client.

    After some more tinkering with my Cloud Client prj.conf, I was able to turn off serial and the problem was I needed to disable CONFIG_AT_HOST_LIBRARY as well. But even with Serial tuned off in SPM as well as Cloud Client and PSM enabled, I was seeing too much current consumption (in mA) during sleep and it fluctuated a lot. Some thing is wrong with that one and I need to optimise it for low currents in sleep mode.

    Do you see some settings or configuration there which are producing this behaviour?

    Thank you.

    Regards,

    Haris Ahmed

Reply
  • Hi Jonathan,

    Thank you for your response.

    Following your recommendation I tried UDP example and I was able to observe sleep current of 6 - 7 micro amps which seems perfect. But I want to achieve such values during sleep mode in Cloud Client.

    After some more tinkering with my Cloud Client prj.conf, I was able to turn off serial and the problem was I needed to disable CONFIG_AT_HOST_LIBRARY as well. But even with Serial tuned off in SPM as well as Cloud Client and PSM enabled, I was seeing too much current consumption (in mA) during sleep and it fluctuated a lot. Some thing is wrong with that one and I need to optimise it for low currents in sleep mode.

    Do you see some settings or configuration there which are producing this behaviour?

    Thank you.

    Regards,

    Haris Ahmed

Children
Related