how to set mode of Serial LTE Modem

Im currently using a nRF9160 with SLM application as a modem on a nRF52840.

How can I configure the modem for NB-IOT or LTE by using the nrf52840?

My project is working, I just need a way to set it to NB-IOT only for example.

I found CONFIG_LTE_NETWORK_MODE, but this gives some errors.

kind regards,

Jonas

Parents Reply Children
  • Hi Jonas,

    Sorry for misunderstanding. Do you mean by which application? I thought your nRF52840 as modem controlling chip already run applications like following, so you can send the commands from nRF52840 to nRF9160 through UART.

    Cellular: SLM Shell (nordicsemi.com)

    nRF91 Series as a Zephyr-compatible modem (nordicsemi.com)(Using Zephyr Cellular modem sample)

    If the application means nRF9160 SLM, you can add an overlay-linkcontrol.conf with following configurations:

    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_NETWORK_MODE_NBIOT=y

    Then add lte_lc_connect function after nrf_modem_lib_init.

    	const int ret = nrf_modem_lib_init();
    
    	if (ret) {
    		LOG_ERR("Modem library init failed, err: %d", ret);
    		if (ret != -EAGAIN && ret != -EIO) {
    			return ret;
    		} else if (ret == -EIO) {
    			LOG_ERR("Please program full modem firmware with the bootloader or "
    				"external tools");
    		}
    	}
    
            lte_lc_connect();

    The SLM will connect with NB-IoT network automatically after reboot. The connection may take some time according to my test:

    Ready
    > AT%XSYSTEMMODE?
    
    %XSYSTEMMODE: 0,1,0,0
    
    OK
    > AT+CFUN?
    
    +CFUN: 1
    
    OK
    > AT+CEREG?
    
    +CEREG: 5,1,"A8B3","03238D6E",9,,,"11100000","11100000"
    
    OK
    
    +CSCON: 0
    
    +CEREG: 1,"A8B3","03238D69",9,,,"11100000","11100000"

    Best regards,

    Charlie

  • the nRF52 runs my own application and I want a way to configure the modem from the software running on the nRF52. How would I send AT commands? Is there any special function for this? the uart is already used by the network interface to communicate with the modem I guess?

  • jonas.woerner said:
    How would I send AT commands? Is there any special function for this?

    Just send AT commands as you send a string through UART, for example 'AT+CFUN=1', it should be terminated with CRLF every time in order to let modem know the AT command is done. Try to learn how to send print string through nRF52 UART port first.

    jonas.woerner said:
    the uart is already used by the network interface to communicate with the modem I guess?

    I am not sure what you mean here. nRF52 and nRF91 has to communicate though UART connection, as you can see from the samples I refereed before.

  • the nRF52 uses the cellular modem driver to communicate with the nRF91. This driver already uses the uart that connects the nRF52 to the nRF91. It is not possible to use the uart to send AT commands directly, the driver would need to expose some API / pipe that accepts AT commands and sends them to the nRF91. I asked the same question on discord and was told that this feature is talked about about the current status is unknown.

    I tried using the cellular API and it kinda works (only tried the get_signal yet) but seems to crash when called from any thread but the main thread.

  • Hi Jonas,

    Thanks for letting me know. If you are using cellular modem driver, this is maintained by Zephyr open-source project, so discord is a good channel, you can also report the issue to Issues · zephyrproject-rtos/zephyr (github.com), remember to check before raising a new issue.

    Best regards,

    Charlie

Related