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

AT+CESQ signal strength 255 (unknown) yet connection works great

Hi,

In order to determine signal strength we parse the AT+CESQ response and regularly get +CESQ: 99,99,255,255,255,255 (the final number being the strength), but the connection and connectivity is perfectly fine. Is there a reason 255 is returned for the strength even though all connectivity is good?

Thanks! 

Parents Reply Children
  • Hi Carl, 

    Ahh you're right, the device was in a PSM state, and I'd say 2 out of 10 times we get 'unknown'. Our intent is to send the signal strength over MQTT, but if PSM isn't exited until the modem is awoken when sending the MQTT payload then there is a good chance of receiving unknown. Is the only workaround to send a dummy HTTP request at the beginning of our wake cycle, then poll the signal strength, then upload our main payload?

    Thanks!

  • Hi again!

    Glad we figured that out! It's unfortunately a sort of "chicken and egg" scenario as you must be out of PSM before RSRP can be fetched. A dummy HTTP request should be an ok workaround, but any transmission from the modem will trigger a wakeup so from a power consumption perspective a dummy UDP message could be cheaper.

    Best regards,
    Carl Richard

  • Now, I also encountered this problem, when I started my project, I used the AT command to query CESQ, it returned was 255. However, when i call the sample code for MQTT and find that it can connect to an LTE network, and even more bizarrely, on my other PCBA board, I write the same firmware and CESQ returns the correct values, which is very strange!

    I confirm that I did not control the modem to enter PSM mode. This is my prj.conf file:

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    # General config
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    CONFIG_GPIO=y
    CONFIG_TRUSTED_EXECUTION_NONSECURE=y
    
    # Log
    CONFIG_LOG=y
    CONFIG_LOG_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_DEFAULT_LEVEL=4
    CONFIG_LOG_MODE_OVERFLOW=y
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=y
    CONFIG_LOG_BACKEND_SHOW_COLOR=n
    CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n
    
    # Modem info
    CONFIG_MODEM_INFO=y
    
    # BSD library
    CONFIG_BSD_LIBRARY=y
    CONFIG_BSD_LIBRARY_TRACE_ENABLED=n
    
    # Flash
    CONFIG_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    # NVS
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_NVS_LOG_LEVEL_DBG=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # GPS
    CONFIG_AT_CMD=y
    CONFIG_AT_NOTIF=y
    
    # AT_CMD
    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # Console
    CONFIG_CONSOLE_SUBSYS=n
    CONFIG_CONSOLE_HANDLER=n
    CONFIG_CONSOLE_GETCHAR=n
    CONFIG_CONSOLE=n
    CONFIG_RTT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    
    # Enable SUPL client support AGPS
    CONFIG_SUPL_CLIENT_LIB=n
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
    
    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    #add by liming
    #CONFIG_POWER_OPTIMIZATION_ENABLE=n
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=n
    #CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y
    CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y
    CONFIG_LTE_LEGACY_PCO_MODE=y
    #CONFIG_LTE_PSM_REQ_RPTAU="00000110"
    #CONFIG_LTE_PSM_REQ_RAT="00000010"
    
    # MQTT
    CONFIG_MQTT_LIB=y
    CONFIG_MQTT_LIB_TLS=y   
    #add by liming
    CONFIG_MQTT_CLIENT_ID="devzone_client"
    CONFIG_MQTT_BROKER_HOSTNAME="test.mosquitto.org"
    CONFIG_MQTT_BROKER_PORT=8884
    CONFIG_SEC_TAG=51966
    CONFIG_PEER_VERIFY=1
    
    # Appliaction
    #CONFIG_MQTT_PUB_TOPIC="/my/publish/topic"
    #CONFIG_MQTT_SUB_TOPIC="/my/subscribe/topic"
    #CONFIG_MQTT_CLIENT_ID="my-client-id"
    #CONFIG_MQTT_BROKER_HOSTNAME="mqtt.eclipse.org"
    #CONFIG_MQTT_BROKER_PORT=1883
    
    # Library for buttons and LEDs
    CONFIG_DK_LIBRARY=y
    CONFIG_DK_LIBRARY_INVERT_LEDS=n
    
    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_HW_STACK_PROTECTION=y
    
    # MCUBOOT
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    
    # SPI
    CONFIG_SPI=y
    CONFIG_SPI_NRFX=y
    CONFIG_SPI_2=y
    CONFIG_SPI_2_NRF_SPIM=y
    CONFIG_SPI_3=y
    CONFIG_SPI_3_NRF_SPIM=y
    
    # I2C
    CONFIG_I2C=y
    CONFIG_I2C_NRFX=y
    CONFIG_I2C_1=y
    CONFIG_I2C_1_NRF_TWIM=y
    CONFIG_I2C_2=n
    CONFIG_I2C_2_NRF_TWIM=n
    CONFIG_I2C_INIT_PRIORITY=60
    
    # UART
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    #CONFIG_UART_LINE_CTRL=y
    #CONFIG_UART_0_NRF_UART=y
    #CONFIG_UART_0_NRF_UARTE=y
    #CONFIG_UART_0_NRF_FLOW_CONTROL=n
    #CONFIG_UART_1_NRF_UARTE=n
    #CONFIG_UART_1_NRF_FLOW_CONTROL=n
    
    # Use smaller buffers for net_buf as CANBUS packets are quite small.
    CONFIG_NET_BUF_DATA_SIZE=64
    CONFIG_NET_BUF_USER_DATA_SIZE=1
    
    # Main thread
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_HEAP_MEM_POOL_SIZE=4096

  • Hi!

    To me it sounds like your device is not actually connected to the network when CESQ is queried. The problem in this ticket was due to PSM being used, so I would appreciate if you could open a new ticket on the matter as it's somewhat unrelated. 

    I cannot see anything out of the ordinary in your prj.conf, but I guess this behavior is more related to the program flow of the application.

    Best regards,
    Carl Richard

Related