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

nRF9160 at_client sample project

After much work I can build the nRF9160 at_client sample project and flash it into the development kit. Using nRF Connect, the at_client sample project  only prints the line "The AT host sample started" as per the source code (shouldn't this be "AT client sample started"?).  AT commands entered into nRF Connect timeout with no response.  Inspecting the file main.c of at_client and there is no code to read the UART and no code to parse AT commands.  I have flashed an at_client.hex file supplied by Nordic and that firmware does respond to AT commands.

Is something missing from the at_client sample project?  I would need to modify the firmware so that it can switch the UART to a data mode upon registration with the LTE data network. In order to do this I need access to the UART and AT command handlers. How do I get this and the source for the working at_client.hex file?

I'm evaluating the nRF9160 for a project and need confirmation that it can work.

Thanks

  • Due to Easter Holiday, our support team has not been fully staffed. We apologize for the late answer, and any inconvenience this may have caused.


    Hello, 

    What version of the nRF Connect SDK are you using? When was the last time you updated the nRF Connect SDK (NCS) code? Please ensure you are using the latest version of NCS. How old is the at_client.hex file you received?

    For convenience, please update your modem FW to the latest version. Click here to go to the nRF9160 download page, and scroll to nRF9160 Modem Firmware and Modem DFU Tool.


    Thanks!

    Kind regards,
    Øyvind

  • I'm using nRF Connect v2.6.2 and cloned the SDK on 4/11 and again on 4/18 with no different results. Is there a file with the installed version?

    On the repository at_client main.c tagged v0.3.0 has references to functions at_host_init() and at_host_process() which were removed from the latest SDK. This looks like the reason the latest at_client is broken.

  • Can you please give me the output with the errors you are seeing when compiling? Please add the log file from the LTE Link Monitor.

    The examples following our SDK should work out of the box without any need to edit the code. How old is your board? Can you please add the IMEI number on the back of your DK?

    I tested the at_client here without any issues.

    To ensure that the SDK is installed correctly, please follow the instructions in this link. The SDK v0.3.0 is old and outdated.

    Let me know how that works for you!

    Kind regards,
    Øyvind

  • There are no errors when compiling. I am using the latest SDK. I The mention of v0.3.0 was a comment. The main() function contain one line, a printk() statement, there is no code in main.c that references AT command handling. I slightly modified the printk statement to verify that I was flashing and running the code. How can it handle AT commands when there is no software do so?

    SDK IMEI #: 3526561000477995

    My local copy of the code was created with 

    west init -m https://github.com/NordicPlayground/fw-nrfconnect-nrf 

    I just did
    git pull
    and
    west update

    and rebuilt, flashed, and ran.

    The terminal screen: 

    ***** Booting Zephyr OS v1.14.99-ncs1-rc1-2-g33c06133c197 *****
    
    
    
    
    !! The AT host sample started
    
    
    
    
    AT_CFUN?

     

    The log screen:

    12:16:51.247
    Modem port is opened
    12:17:43.763
    Error: 'AT+CFUN? ' timed out
    All AT commands are ignored. Either entered by myself or by the LTE monitor when selecting one of the serial ports.
  • Hello,

    The nRF9160 is an advanced device that uses the Zephyr OS to handle events, communications etc. 

    CWallach said:
    The main() function contain one line, a printk() statement, there is no code in main.c that references AT command handling.

    Zephyr OS will configure the device according to prj.conf (Read more here):

    # General config
    CONFIG_ASSERT=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    
    # BSD library
    CONFIG_BSD_LIBRARY=y
    
    # AT host library
    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=1024
    
     

    Upon boot, Zephyr OS uses System Drivers that run misc. functions configured in our libraries. With this in mind, one can have a completely empty main file.


    Back to the original problem. 

    I downloaded the latest version (into a new folder) following the same instructions as you above, and it is working fine: 

    ***** Booting Zephyr OS v1.14.99-ncs1-rc1-2-g33c06133c197 *****
    Flash region		Domain		Permissions
    00 0x00000 0x02000 	Secure		rwxl
    01 0x02000 0x04000 	Non-Secure	rwxl
    02 0x04000 0x06000 	Non-Secure	rwxl
    03 0x06000 0x08000 	Non-Secure	rwxl
    04 0x08000 0x0a000 	Non-Secure	rwxl
    05 0x0a000 0x0c000 	Non-Secure	rwxl
    06 0x0c000 0x0e000 	Non-Secure	rwxl
    07 0x0e000 0x10000 	Non-Secure	rwxl
    08 0x10000 0x12000 	Non-Secure	rwxl
    09 0x12000 0x14000 	Non-Secure	rwxl
    10 0x14000 0x16000 	Non-Secure	rwxl
    11 0x16000 0x18000 	Non-Secure	rwxl
    12 0x18000 0x1a000 	Non-Secure	rwxl
    13 0x1a000 0x1c000 	Non-Secure	rwxl
    14 0x1c000 0x1e000 	Non-Secure	rwxl
    15 0x1e000 0x20000 	Non-Secure	rwxl
    16 0x20000 0x22000 	Non-Secure	rwxl
    17 0x22000 0x24000 	Non-Secure	rwxl
    18 0x24000 0x26000 	Non-Secure	rwxl
    19 0x26000 0x28000 	Non-Secure	rwxl
    20 0x28000 0x2a000 	Non-Secure	rwxl
    21 0x2a000 0x2c000 	Non-Secure	rwxl
    22 0x2c000 0x2e000 	Non-Secure	rwxl
    23 0x2e000 0x30000 	Non-Secure	rwxl
    24 0x30000 0x32000 	Non-Secure	rwxl
    25 0x32000 0x34000 	Non-Secure	rwxl
    26 0x34000 0x36000 	Non-Secure	rwxl
    27 0x36000 0x38000 	Non-Secure	rwxl
    28 0x38000 0x3a000 	Non-Secure	rwxl
    29 0x3a000 0x3c000 	Non-Secure	rwxl
    30 0x3c000 0x3e000 	Non-Secure	rwxl
    31 0x3e000 0x40000 	Non-Secure	rwxl
    
    SRAM region		Domain		Permissions
    00 0x00000 0x01000	Secure		rwxl
    01 0x01000 0x02000	Secure		rwxl
    02 0x02000 0x03000	Secure		rwxl
    03 0x03000 0x04000	Secure		rwxl
    04 0x04000 0x05000	Secure		rwxl
    05 0x05000 0x06000	Secure		rwxl
    06 0x06000 0x07000	Secure		rwxl
    07 0x07000 0x08000	Secure		rwxl
    08 0x08000 0x09000	Non-Secure	rwxl
    09 0x09000 0x0a000	Non-Secure	rwxl
    10 0x0a000 0x0b000	Non-Secure	rwxl
    11 0x0b000 0x0c000	Non-Secure	rwxl
    12 0x0c000 0x0d000	Non-Secure	rwxl
    13 0x0d000 0x0e000	Non-Secure	rwxl
    14 0x0e000 0x0f000	Non-Secure	rwxl
    15 0x0f000 0x10000	Non-Secure	rwxl
    16 0x10000 0x11000	Non-Secure	rwxl
    17 0x11000 0x12000	Non-Secure	rwxl
    18 0x12000 0x13000	Non-Secure	rwxl
    19 0x13000 0x14000	Non-Secure	rwxl
    20 0x14000 0x15000	Non-Secure	rwxl
    21 0x15000 0x16000	Non-Secure	rwxl
    22 0x16000 0x17000	Non-Secure	rwxl
    23 0x17000 0x18000	Non-Secure	rwxl
    24 0x18000 0x19000	Non-Secure	rwxl
    25 0x19000 0x1a000	Non-Secure	rwxl
    26 0x1a000 0x1b000	Non-Secure	rwxl
    27 0x1b000 0x1c000	Non-Secure	rwxl
    28 0x1c000 0x1d000	Non-Secure	rwxl
    29 0x1d000 0x1e000	Non-Secure	rwxl
    30 0x1e000 0x1f000	Non-Secure	rwxl
    31 0x1f000 0x20000	Non-Secure	rwxl
    
    Peripheral		Domain		Status
    00 NRF_P0		Non-Secure	OK
    01 NRF_CLOCK		Non-Secure	OK
    02 NRF_RTC1		Non-Secure	OK
    03 NRF_NVMC		Non-Secure	OK
    04 NRF_UARTE1		Non-Secure	OK
    05 NRF_UARTE2		Secure		SKIP
    06 NRF_IPC		Non-Secure	OK
    07 NRF_VMC		Non-Secure	OK
    08 NRF_FPU		Non-Secure	ERROR
    09 NRF_EGU1		Non-Secure	OK
    10 NRF_EGU2		Non-Secure	OK
    11 NRF_TWIM2		Non-Secure	OK
    12 NRF_SPIM3		Non-Secure	OK
    13 NRF_TIMER0		Non-Secure	OK
    14 NRF_TIMER1		Non-Secure	OK
    15 NRF_TIMER2		Non-Secure	OK
    16 NRF_SAADC		Non-Secure	OK
    17 NRF_GPIOTE1		Non-Secure	OK
    
    SPM: MSP_NS 200236c8
    SPM: prepare to jump to Non-Secure image
    ***** Booting Zephyr OS v1.14.99-ncs1-rc1-2-g33c06133c197 *****
    The AT host sample started
    AT+CFUN?
    +CFUN: 4
    OK
    AT+CFUN=1
    OK
    AT+CFUN?
    +CFUN: 1
    OK
    AT+CGSN=1
    +CGSN: "352656100033177"
    OK
    AT+CGMI
    Nordic Semiconductor ASA
    OK
    AT+CGMM
    nRF9120
    OK
    AT+CGMR
    mfw-m1_nrf9160_0.6.8-30.alpha
    OK
    AT+CEMODE?
    +CEMODE: 2
    OK
    AT%XCBAND=?
    %XCBAND: (3,4,13,20)
    OK
    AT+CMEE?
    +CMEE: 0
    OK
    AT+CMEE=1
    OK
    AT+CNEC?
    +CNEC: 0
    OK
    AT+CNEC=24
    OK
    AT+CGEREP?
    +CGEREP: 0,0
    OK
    AT+CGDCONT?
    OK
    AT+CGACT?
    OK
    AT+CGEREP=1
    OK
    AT+CIND=1,1,1
    OK
    AT+CEREG=2
    OK
    AT+CEREG?
    +CEREG: 2,4,"FFFE","FFFFFFFF",7
    OK
    AT%CESQ=1
    OK
    AT+CESQ
    +CESQ: 99,99,255,255,255,255
    OK
    AT%XSIM=1
    OK
    AT%XSIM?
    %XSIM: 1
    OK
    AT+CPIN?
    +CPIN: READY
    OK
    AT+CPINR="SIM PIN"
    +CPINR: "SIM PIN",3
    OK
    AT+CIMI
    204080813513243
    OK
    
    

    Not that I think it will do anything of difference, but have you inserted the SIM card?

    How are you compiling the project? Using Segger Embedded Studio or command line?

    Kind regards,
    Øyvind

Related