not able to send AT commands on on nrf9160 module

When I connect on tera term and try sending AT commands, the device doesn't identify them, 

My prj.conf file looks like this:

I don't want to use AT_SHELL, so can u please suggest:

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

# Firmware version string v<major>.<minor>.<build>
CONFIG_FIRMWARE_VERSION="v0.200.01"

# Enable Zephyr application to be booted by MCUboot
# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMG_MANAGER=y

CONFIG_DEBUG=y
CONFIG_REBOOT=y
# RESET_ON_FATAL_ERROR is y by default if !DEBUG
CONFIG_RESET_ON_FATAL_ERROR=y
# CONFIG_DEBUG_OPTIMIZATIONS=y
# CONFIG_DEBUG_THREAD_INFO=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Provisioning mode
CONFIG_PROD_TEST=y

# Shell configurations
CONFIG_PRINTK=y
CONFIG_SHELL=y
# CONFIG_SHELL_BACKENDS=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_SHELL_MINIMAL=y
# CONFIG_SHELL_STACK_SIZE=4096
# CONFIG_USE_SEGGER_RTT=y
# CONFIG_SHELL_CMDS=y
# CONFIG_SHELL_CMDS_RESIZE=y
# CONFIG_SHELL_TAB=y
# CONFIG_SHELL_HISTORY=y

# AT Shell
# CONFIG_AT_SHELL=y
# disable * and ? wildcards for at commands
CONFIG_SHELL_WILDCARD=n
# CONFIG_RING_BUFFER=n

# logging configurations
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4

CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_MODE_IMMEDIATE=y

# NEWLIB C
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# Modem library
# CONFIG_NRF_MODEM_LIB=y

# Modem
CONFIG_MODEM_INFO=y

# AT Host
CONFIG_UART_INTERRUPT_DRIVEN=y
# CONFIG_AT_HOST_LIBRARY=y
# CONFIG_AT_HOST_UART_0=y

# Modbus
CONFIG_MODBUS=y
CONFIG_MODBUS_SERIAL=y
CONFIG_MODBUS_ROLE_CLIENT=y

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

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_TIMEOUT=120

# LTE Mode
CONFIG_LTE_NETWORK_MODE_LTE_M=y
# CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT=y
# CONFIG_LTE_NETWORK_USE_FALLBACK=y
# CONFIG_LTE_MODE_PREFERENCE_LTE_M=y
# CONFIG_LTE_MODE_PREFERENCE_NBIOT=y



# Only enable bands: 2,4,12,13 This will provide coverage for the USA and Canada (Rogers, Telus, AT&T and Verizon).
# The rational: Limiting the bands will allow the modem to find a suitable network faster the first time.
# After running for a few days, the modem writes it's band history to NV and will remember
# the previous bands used which shortens the registration time. We can also remove this capability if
# are ok with long registration times for the first power up. Depending on our final unit
# test process, removing this logic would likely increase our test times. I am putting in for now.  

# First enable modem to disable the extra/unused frequency bands.
CONFIG_LTE_LOCK_BANDS=y
# Then only enable bands 2, 4, 12, 13 (it's a bitmask starting at Band #1 in the LSB)
CONFIG_LTE_LOCK_BAND_MASK="1100000001010"

# Set the PDP Context - for Rogers OR Eseye SIM cards. Change the default APN setting below for Rogers or Eseye
CONFIG_PDN=y
CONFIG_PDN_DEFAULTS_OVERRIDE=y
CONFIG_PDN_SYS_INIT=y
CONFIG_PDN_DEFAULT_APN="\"m2minternet.apn\""
# CONFIG_PDN_DEFAULT_APN="\"eseye1\""
CONFIG_PDN_DEFAULT_FAM_IPV4V6=y

CONFIG_TELEMETRY_PAYLOAD_BUFFER_SIZE=1024
CONFIG_BASE64=y

CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y   # For aws MQTT TLS

# AWS IoT library
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_APP=y
CONFIG_AWS_IOT_BROKER_HOST_NAME="a1hxntjfjh5450-ats.iot.ca-central-1.amazonaws.com"
CONFIG_AWS_IOT_SEC_TAG=12345678
CONFIG_AWS_IOT_LOG_LEVEL_DBG=y
CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=n
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_LAST_WILL=y
CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
#CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
# CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
# CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
# CONFIG_AWS_IOT_TOPIC_UPDATE_ACCEPTED_SUBSCRIBE=y
# CONFIG_AWS_IOT_TOPIC_UPDATE_REJECTED_SUBSCRIBE=y
CONFIG_AWS_IOT_CLIENT_ID_MAX_LEN=50

# MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
CONFIG_MQTT_KEEPALIVE=1200

CONFIG_SNTP=y

# Date Time library
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_NTP=n
CONFIG_DATE_TIME_MODEM=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

CONFIG_FPU=y
CONFIG_FPU_SHARING=y

# AWS FOTA
CONFIG_AWS_FOTA=y
CONFIG_AWS_FOTA_DOWNLOAD_SECURITY_TAG=12345678
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS=y

# Settings
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y

# Non-volatile Storage
CONFIG_NVS=y

# CJSON
CONFIG_CJSON_LIB=y

# Download client (needed by AWS FOTA)
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096

####### THUNDER

CONFIG_THREAD_NAME=y

CONFIG_CMSIS_DSP=y
CONFIG_CMSIS_DSP_SUPPORT=y
CONFIG_CMSIS_DSP_FASTMATH=y
CONFIG_CMSIS_DSP_COMPLEXMATH=y
CONFIG_CMSIS_DSP_STATISTICS=y
CONFIG_CMSIS_DSP_TRANSFORM=y
CONFIG_CMSIS_DSP_TABLES_ALL_FFT=n
CONFIG_CMSIS_DSP_TABLES_RFFT_FAST_F32_1024=y
# CONFIG_CMSIS_DSP_TABLES_RFFT_FAST_F32_2048=y

# Filesystem
CONFIG_SPI=y
CONFIG_SPI_ASYNC=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_DISK_ACCESS=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_SDMMC_OVER_SPI=y

# Enable flash operations.
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
# CONFIG_FILE_SYSTEM_SHELL=y

# Partition manager settings
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n

# logging configurations
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_NRF_CLOUD_LOG_LEVEL_DBG=y

# logging configurations when debugging
# CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_IMMEDIATE=y

CONFIG_I2C=y
CONFIG_SENSOR=y

# Temp, Pressure, Humidity and gas sensor
CONFIG_BME688=y
# CONFIG_BME688_TEMP_OVER_4X=y

# Accelerometer
# CONFIG_BMA280=y
# CONFIG_BMA280_TRIGGER_GLOBAL_THREAD=y
# CONFIG_BMA280_PMU_RANGE_2G=y
# # 15.63Hz
# CONFIG_BMA280_PMU_BW_2=y

# battery / VSYS
CONFIG_ADC=y

CONFIG_STATS=y
CONFIG_STATS_SHELL=y

# Zephyr Device Power Management
CONFIG_PM=y
# Required to disable default behavior of deep sleep on timeout
CONFIG_PM_DEVICE=y

# configure to Enable Modem sleep notifications
CONFIG_LTE_LC_MODEM_SLEEP_NOTIFICATIONS=y   # see if this is working



## PSM
# CONFIG_UDP_PSM_ENABLE=y
CONFIG_LTE_PSM_REQ_RPTAU="00000110"
CONFIG_LTE_PSM_REQ_RAT="00000101"

#PDM
CONFIG_NRFX_PDM=y
Parents
  • Hello there, 


    Can you please provide more information on what version of nRF Connect SDK you are running? And what modem FW on your nRF9160?

    I don't want to use AT_SHELL, so can u please suggest:

    What sample are you working on? The following is from the Asset Tracker v2 application, which uses the AT Host library

    # AT Host library - Used to send AT commands directy from an UART terminal and to allow
    #                   integration with nRF Connect for Desktop LTE Link monitor application.
    CONFIG_AT_HOST_LIBRARY=y
    Kind regards,
    Øyvind
Reply
  • Hello there, 


    Can you please provide more information on what version of nRF Connect SDK you are running? And what modem FW on your nRF9160?

    I don't want to use AT_SHELL, so can u please suggest:

    What sample are you working on? The following is from the Asset Tracker v2 application, which uses the AT Host library

    # AT Host library - Used to send AT commands directy from an UART terminal and to allow
    #                   integration with nRF Connect for Desktop LTE Link monitor application.
    CONFIG_AT_HOST_LIBRARY=y
    Kind regards,
    Øyvind
Children
  • SDK-1.9.0

    modem FW- 1.3.2

    The actual problem that im facing is not being able to write aws certificates to the board. I tried using AT_SHELL, which wants me send the command in the format: 

    at at%%cmng=0,12345678,0,"\n
    -----BEGIN CERTIFICATE-----\n
    MIIDQT....................................\n
    .................................................\n
    .........................................QVVg5\n
    -----END CERTIFICATE-----"\r\n

    But for some reason, AT_SHELL is not allowing multiline commands. As you might know each line in the command needs to end with LF (\n), which is what I'm doing but AT_SHELL terminates the command at \n and begins a new command, so the next command line is where the rest of the certificate gets written. The shell output looks like this:

    uart:~$ at at%%cmng=0,12345678,0,"
    not terminated: "
    uart:~$ -----BEGIN CERTIFICATE-----
    -----BEGIN: command not found
    Please specify a subcommand.
    uart:~$ MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG
    9w0BAQsF
    MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF: command not found
    Please specify a subcommand.
    uart:~$ ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQD
    ExBBbWF6
    ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6: command not found
    Please specify a subcommand.
    NVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv: command not found
    Please specify a subcommand.

    So I tried using AT_HOST and disabling AT_SHELL, it won't recognise AT commands

    uart:~$ at at%%cmng=1
    at: command not found
    Please specify a subcommand.
    uart:~$ AT%%CMNG=1
    AT%%CMNG=1: command not found
    Please specify a subcommand.
    uart:~$ AT%CMNG=1
    AT%CMNG=1: command not found
    Please specify a subcommand.
    uart:~$ help

    Available commands:
    adc
    audio
    distance
    flash
    help
    i2c
    log
    mcuboot
    nrf_clock_control
    prod
    stats
    thunder
    uart:~$

    Can you please suggest?

  • Adding to the above reply:

    I have a python script sending the command through the at.py module:

    The command that the script is sending looks like below:

    at at%%cmng=0,12345678,0,"
    -----BEGIN CERTIFICATE-----
    MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
    ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
    b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
    MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
    b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
    ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
    9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
    IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
    VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
    93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
    rqXRfboQnoZsG4q5WTP468SQvvG5
    -----END CERTIFICATE-----"

  • Øyvind said:
    What sample are you working on?

    Do you need to use AT_SHELL or can you use AT_HOST? In you application please add 

    CONFIG_AT_HOST_LIBRARY=y
    Looking at the AWS IOT samples, this should already have AT Host enabled.
  • Tried using both together and individually too. Doesn't work.

    When i use just AT_HOST, it's not recognizing AT commands.

    And also for one of my firmware builds, AT_HOST shows an error that it cant bind UART0.

    I'm sorry I'm new to firmware. I'm not sure if something else is binding UART0 already. UART1 and UART2 on our device are being used for other purposes and can't be used for this.

    Is there a way to send a multiline command in just AT_SHELL without "\n" being considered as command termination. It should be considered as just a new line feed.

  • I dont know what you mean by a sample. Can you explain?

Related