This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MQTT AT-Commands

Good Day. I am wondering if anyone could maybe assist me in where I am going wrong with my software.

I have the intention of using a Nrf9160 as a serial modem through AT commands. As a chosen communication protocol we would like to use MQTT. 

Background info

Hardware : NRF9160

Firmware : mfwnrf9160120  (2020-04-29)

Software Image : Serial LTE Modem

I am attaching my project config file and the current AT-Commands that the modem will accept

My problem is that I cant seem to get the MQTT AT commands for the modem in.

When I started the GPS commands were initially not useable in the modem. So I modified the project config file and then the GPS commands became useable through AT-Commands. 

I am lost as to where I could be going wrong,  If any one would be able to help me out that would be very kind.

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
# General config
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_STACK_SENTINEL=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_RING_BUFFER=y

# Segger RTT
CONFIG_USE_SEGGER_RTT=n
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

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

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=n
CONFIG_MQTT_CLEAN_SESSION=y

# Modem library
CONFIG_NRF_MODEM_LIB=y
# Align the max FD entry to NRF_MODEM_MAX_SOCKET_COUNT(8)
CONFIG_POSIX_MAX_FDS=8
# Enable below for modem trace
#CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y

# Use GPIO
CONFIG_GPIO=y
CONFIG_GPIO_NRFX=y
CONFIG_GPIO_NRF_P0=y

# UART interface
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_TIMER2=y

# Stacks and heaps
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Device power management
CONFIG_PM_DEVICE=y

# FOTA
CONFIG_HTTP_PARSER_URL=y
CONFIG_FOTA_DOWNLOAD=y
CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y

# FLASH
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Settings
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# nRF Cloud
CONFIG_CLOUD_API=y
CONFIG_NRF_CLOUD_MQTT=y
CONFIG_NRF_CLOUD_FOTA=n
CONFIG_NRF_CLOUD_AGPS=y
CONFIG_NRF_CLOUD_PGPS=y
CONFIG_NRF_CLOUD_CELL_POS=y
CONFIG_NRF_CLOUD_LOG_LEVEL_INF=y
CONFIG_DATE_TIME=y
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_DATE_TIME=n
CONFIG_AT_MONITOR=y
CONFIG_MODEM_JWT=y
# Use "nrf-<IMEI>" as the default device_id format
# Use "<device_uuid>" as the device_id format by below
#CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y

#
# SLM-specific configurations
#

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

CONFIG_SLM_CUSTOMIZED=y
CONFIG_SLM_LOG_LEVEL_INF=y
CONFIG_SLM_EXTERNAL_XTAL=n
CONFIG_SLM_START_SLEEP=n
# Use UART_0 (when working with PC terminal)
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
# Use UART_2 (when working with external MCU)
#CONFIG_SLM_CONNECT_UART_2=y
#CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2


# nRF Cloud based location services
CONFIG_SLM_AGPS=y
CONFIG_SLM_PGPS=y
CONFIG_SLM_CELL_POS=y

(0.000) *** Booting Zephyr OS build v2.7.0-ncs1  *** (44)
(0.000) Flash regions		Domain		Permissions (34)
(0.000) 00 01 0x00000 0x10000 	Secure		rwxl (35)
(0.000) 02 31 0x10000 0x100000 	Non-Secure	rwxl (39)
(0.000)  (0)
(0.000) Non-secure callable region 0 placed in flash region 1 with size 32. (67)
(0.000)  (0)
(0.185) SRAM region		Domain		Permissions (32)
(0.000) 00 07 0x00000 0x10000 	Secure		rwxl (35)
(0.000) 08 31 0x10000 0x40000 	Non-Secure	rwxl (38)
(0.000)  (0)
(0.000) Peripheral		Domain		Status (26)
(0.000) 00 NRF_P0               Non-Secure	OK (37)
(0.000) 01 NRF_CLOCK            Non-Secure	OK (37)
(0.000) 02 NRF_RTC0             Non-Secure	OK (37)
(0.000) 03 NRF_RTC1             Non-Secure	OK (37)
(0.000) 04 NRF_NVMC             Non-Secure	OK (37)
(0.000) 05 NRF_UARTE1           Non-Secure	OK (37)
(0.000) 06 NRF_UARTE2           Secure		SKIP (36)
(0.000) 07 NRF_TWIM2            Non-Secure	OK (37)
(0.000) 08 NRF_SPIM3            Non-Secure	OK (37)
(0.000) 09 NRF_TIMER0           Non-Secure	OK (37)
(0.000) 10 NRF_TIMER1           Non-Secure	OK (37)
(0.000) 11 NRF_TIMER2           Non-Secure	OK (37)
(0.000) 12 NRF_SAADC            Non-Secure	OK (37)
(0.000) 13 NRF_PWM0             Non-Secure	OK (37)
(0.000) 14 NRF_PWM1             Non-Secure	OK (37)
(0.000) 15 NRF_PWM2             Non-Secure	OK (37)
(0.000) 16 NRF_PWM3             Non-Secure	OK (37)
(0.000) 17 NRF_WDT              Non-Secure	OK (37)
(0.000) 18 NRF_IPC              Non-Secure	OK (37)
(0.000) 19 NRF_VMC              Non-Secure	OK (37)
(0.000) 20 NRF_FPU              Non-Secure	OK (37)
(0.000) 21 NRF_EGU0             Non-Secure	OK (37)
(0.000) 22 NRF_EGU1             Non-Secure	OK (37)
(0.000) 23 NRF_EGU2             Non-Secure	OK (37)
(0.000) 24 NRF_EGU3             Non-Secure	OK (37)
(0.000) 25 NRF_EGU4             Non-Secure	OK (37)
(0.000) 26 NRF_EGU5             Non-Secure	OK (37)
(0.000) 27 NRF_DPPIC            Non-Secure	OK (37)
(0.000) 28 NRF_REGULATORS       Non-Secure	OK (37)
(0.000) 29 NRF_PDM              Non-Secure	OK (37)
(0.000) 30 NRF_I2S              Non-Secure	OK (37)
(0.000) 31 NRF_GPIOTE1          Non-Secure	OK (37)
(0.000)  (0)
(0.000) SPM: NS image at 0x10000 (24)
(0.000) SPM: NS MSP at 0x200185f0 (25)
(0.000) SPM: NS reset vector at 0x11ff5 (31)
(0.000) SPM: prepare to jump to Non-Secure image. (41)
(0.191) *** Booting Zephyr OS build v2.7.0-ncs1  *** (44)
(0.024) The AT host sample started (26)
(3.005) AT+Clac (7)
(0.017) AT+CFUN (7)
(0.000) AT%CONEVAL (10)
(0.146) AT+COPS (7)
(0.000) AT%COPS (7)
(0.000) AT+CGDCONT (10)
(0.000) AT+CGACT (8)
(0.000) AT+CEMODE (9)
(0.000) AT+CGATT (8)
(0.000) AT+CGEQOSRDP (12)
(0.000) AT+CPINR (8)
(0.000) AT+CPIN (7)
(0.000) AT+CPSMS (8)
(0.000) AT+CEDRXS (9)
(0.000) AT%XPTW (7)
(0.000) AT+CEDRXRDP (11)
(0.000) AT+CEREG (8)
(0.000) AT%XNEWCID (10)
(0.000) AT%XGETPDNID (12)
(0.000) AT+CLAC (7)
(0.000) AT+CMEE (7)
(0.000) AT+CGMI (7)
(0.000) AT+CGMM (7)
(0.000) AT+CGMR (7)
(0.000) AT+CGSN (7)
(0.000) AT+CIMI (7)
(0.000) AT+CSCON (8)
(0.000) AT+CMGS (7)
(0.000) AT+CNMA (7)
(0.000) AT+CNMI (7)
(0.000) AT+CMGF (7)
(0.000) AT+CPMS (7)
(0.000) AT+CGSMS (8)
(0.000) AT%XSMMA (8)
(0.000) AT%CMNG (7)
(0.000) AT+CNEC (7)
(0.000) AT+CGEREP (9)
(0.000) AT%MDMEV (8)
(0.000) AT%CESQ (7)
(0.000) AT%XPCO (7)
(0.000) AT+CESQ (7)
(0.000) AT%XSIM (7)
(0.000) AT%XBANDLOCK (12)
(0.000) AT+CGPIAF (9)
(0.000) AT+CPAS (7)
(0.000) AT+COPN (7)
(0.000) AT+CSQ (6)
(0.000) AT+CEER (7)
(0.000) AT+CNUM (7)
(0.000) AT+CRSM (7)
(0.000) AT+CIND (7)
(0.000) AT+CLCK (7)
(0.000) AT+CPWD (7)
(0.000) AT%XCBAND (9)
(0.000) AT+CGPADDR (10)
(0.000) AT+CGCONTRDP (12)
(0.000) AT%NBRGRSRP (11)
(0.000) AT+CSIM (7)
(0.000) AT%XOPNAME (10)
(0.000) AT%XTIME (8)
(0.000) AT%XRAI (7)
(0.000) AT%XCONNSTAT (12)
(0.000) AT+CEPPI (8)
(0.000) AT%XDATAPRFL (12)
(0.000) AT%XMAGPIO (10)
(0.000) AT%XANTDETMAGPIO (16)
(0.000) AT%XMIPIRFFEDEV (15)
(0.000) AT%XMIPIRFFECTRL (16)
(0.000) AT%XCOEX0 (9)
(0.000) AT%XCOEX2 (9)
(0.000) AT%XANTCFG (10)
(0.000) AT%XEMPR (8)
(0.000) AT%XSUDO (8)
(0.000) AT%XPMNG (8)
(0.000) AT%XRFTEST (10)
(0.000) AT%XAPNCLASS (12)
(0.000) AT%XTEMPHIGHLVL (15)
(0.000) AT%XTEMP (8)
(0.000) AT%XPRODDONE (12)
(0.000) AT%XMODEMTRACE (14)
(0.000) AT%XEPCO (8)
(0.000) AT%XVBATLOWLVL (14)
(0.000) AT%XVBATLVL (11)
(0.000) AT%XVBAT (8)
(0.000) AT+CCLK (7)
(0.000) AT%CCLK (7)
(0.000) AT%XOPCONF (10)
(0.000) AT%XIPV6FAIL (12)
(0.000) AT%XUSIMLCK (11)
(0.000) AT%XOPERID (10)
(0.000) AT%XSMSFALLBACK (15)
(0.000) AT%XSYSTEMMODE (14)
(0.000) AT%XSNRSQ (9)
(0.000) AT+CGAUTH (9)
(0.000) AT%XMONITOR (11)
(0.000) AT%SHORTSWVER (13)
(0.000) AT%HWVERSION (12)
(0.000) AT%XMODEMUUID (13)
(0.000) AT%2DID (7)
(0.000) AT%XICCID (9)
(0.000) AT+ODISNTF (10)
(0.000) AT+ODIS (7)
(0.000) AT%ODIS (7)
(0.000) AT%XFACTORYRESET (16)
(0.000) AT%XNETTIME (11)
(0.000) AT%XDEEPSEARCH (14)
(0.000) AT+CEINFO (9)
(0.000) AT%XPDNCFG (10)
(0.000) AT%XPOFWARN (11)
(0.000) AT%XFILEWRITE (13)
(0.000) AT+CSODCP (9)
(0.000) AT%XDATASTOP (12)
(0.000) AT%XAPNSTATUS (13)
(0.000) AT%XMODEMSLEEP (14)
(0.000) AT%XT3412 (9)
(0.000) AT%XCOUNTRYDATA (15)
(0.000) AT%RAI (6)
(0.000) AT%NCELLMEASSTOP (16)
(0.000) AT%NCELLMEAS (12)
(0.000) AT%JWT (6)
(0.000) AT%ATTESTTOKEN (14)
(0.000) AT%KEYGEN (9)
(0.000) AT%KEYINJECT (12)
(0.000) AT%REL14FEAT (12)
(0.000) AT%PERIODICSEARCHCONF (21)
(0.000) AT%APNRATECTRL (14)
(0.000) AT+CCHO (7)
(0.000) AT+CCHC (7)
(0.000) AT+CGLA (7)
(0.000) OK (2)

Parents
  • Hello,

    Do you mean controlling the Serial LTE Modem via internet? The intention of the SLM is that is receives the AT Commands over UART from an external computer or MCU.

    Could you please elaborate more on your intention?

    Thanks. 

    Kind regards,
    Øyvind

  • Good day, Thank you for responding. 

    I am using a nrf52832 as a microcontroller to communicate to the nRF9160 using UART.

    We plan to use the nRF9160 as a modem via AT-Commands from the nRF52832. 

  • Could you elaborate exactly where it fails on your side? What are you running on the nRF52832? Please provide more information for me to reproduce this issue. 

    Thank you!

    Kind regards,
    Øyvind

  • The nRF52832 is working correctly. I have zero issues when it comes to this.

    My problem is that the AT-Commands for MQTT are not currently in my command set. The MQTT commands are not part of the firmware on the nrf9160. I have added the following to my project config file for MQTT and they are still not in my command set

    CONFIG_SLM_MQTTC=y

    # MQTT
    CONFIG_MQTT_LIB=y
    CONFIG_MQTT_LIB_TLS=n
    CONFIG_MQTT_CLEAN_SESSION=y

  • The Serial LTE Modem is configured to work out of the box when it comes to MQTT. Have you read the MQTT AT Commands documentation

    Can you please elaborate what is failing on your side? From the log output you provided: "AT-commands.txt", the output does not reflect what the Serial LTE Modem prints. 


    PieterK said:
    CONFIG_SLM_MQTTC=y

    This is not a configuration available in the nRF Connect SDK

    PieterK said:
    The nRF52832 is working correctly. I have zero issues when it comes to this.

    How do you know this is working correctly? 

  • The nrf52832 is working correctly as we have a few running the codeset we have made for them. We chose to have the nrf52 as the "Master" of the two as we require BLE in our application.

    I am still developing on a nRF9160DK. I am currently using the device through a UART serial port to get all my AT-Commands ready for getting the device attached to the networks and to read GPS.

    All my other commands are currently useable, But the MQTT commands do not show when I send the command AT+CLAC then I get the reply in the file "AT-Commands.txt"

    When I send the AT command for MQTT connect I only get error.

    AT#XMQTTCON=1,"3001","MyUseName","MyPassword","MyBrokerDetails",1883

    6471.serial_lte_modem.zip

Reply
  • The nrf52832 is working correctly as we have a few running the codeset we have made for them. We chose to have the nrf52 as the "Master" of the two as we require BLE in our application.

    I am still developing on a nRF9160DK. I am currently using the device through a UART serial port to get all my AT-Commands ready for getting the device attached to the networks and to read GPS.

    All my other commands are currently useable, But the MQTT commands do not show when I send the command AT+CLAC then I get the reply in the file "AT-Commands.txt"

    When I send the AT command for MQTT connect I only get error.

    AT#XMQTTCON=1,"3001","MyUseName","MyPassword","MyBrokerDetails",1883

    6471.serial_lte_modem.zip

Children
Related