nRF9610 Serial LTE Modem + MQTT with AT Commands over PC

Hi,

I want to test of MQTT communication with nb-IOT network before going for development.

For that I have updated pre-built firmware on development board using nRF Connect to Desktop application.

I am able to communicate with DK board over usb and virtual com port with general AT commands.

How should I send sequence of command so that I can get internet connectivity and able to communicate with MQTT. 

Need help in proper set and sequence of at command so that I can test mqtt communication.

I have already tested MQTT communication with 4G modem of  quectel with AT Command.

Any help will be appreciated.

Thanks & Regards,

Parents
  • Hello,

    How should I send sequence of command so that I can get internet connectivity and able to communicate with MQTT. 

    Open link monitor, and connect to the board. Enable 'Automatic requests". Reset the application, then you should see "READY" printed in the terminal. Then turn on modem with 'at+cfun=1', and run 'at+cfun?' to connect. Then you can run AT#XMQTTCON=1,"client-id","","","hostname",8883,sec_tag (if the broker uses MQTT with TLS, otherwise use 1883 as port number and omit sec_tag). You should get a '#XMQTTEVT: 0,0' message if it is successful.

  • Hi Hakon,

    Right now, I am not able to test this due to network coverage availability in our area and I have to implement development flow to use with external MCU, I am stuck in it.

    if possible could you help share logs for MQTT with AT commands which you have suggested in earlier response.

    It would be help full and is there any SDK or library available to communicate with external MCU over UART?

    Thanks & Regards,

    Ashvin Makwana

Reply
  • Hi Hakon,

    Right now, I am not able to test this due to network coverage availability in our area and I have to implement development flow to use with external MCU, I am stuck in it.

    if possible could you help share logs for MQTT with AT commands which you have suggested in earlier response.

    It would be help full and is there any SDK or library available to communicate with external MCU over UART?

    Thanks & Regards,

    Ashvin Makwana

Children
  • Ashvin Makwana said:
    if possible could you help share logs for MQTT with AT commands which you have suggested in earlier response.

    2022-05-03T12:57:48.125Z INFO Modem port is opened
    2022-05-03T12:57:48.139Z DEBUG modem >> AT+CFUN?
    2022-05-03T12:57:48.236Z DEBUG modem << +CFUN: 0
    2022-05-03T12:57:48.238Z DEBUG modem << OK
    2022-05-03T12:57:51.064Z DEBUG modem << Ready
    2022-05-03T12:57:54.045Z DEBUG modem >> AT+CFUN=1
    2022-05-03T12:57:54.092Z DEBUG modem << OK
    2022-05-03T12:57:56.476Z DEBUG modem >> AT+CFUN?
    2022-05-03T12:57:56.485Z DEBUG modem << +CFUN: 1
    2022-05-03T12:57:56.500Z DEBUG modem << OK
    2022-05-03T12:57:56.504Z DEBUG modem >> AT+CGSN=1
    2022-05-03T12:57:56.514Z DEBUG modem << +CGSN: "352656104485738"
    2022-05-03T12:57:56.517Z DEBUG modem << OK
    2022-05-03T12:57:56.519Z DEBUG modem >> AT+CGMI
    2022-05-03T12:57:56.532Z DEBUG modem << Nordic Semiconductor ASA
    2022-05-03T12:57:56.533Z DEBUG modem << OK
    2022-05-03T12:57:56.537Z DEBUG modem >> AT+CGMM
    2022-05-03T12:57:56.548Z DEBUG modem << nRF9160-SICA
    2022-05-03T12:57:56.550Z DEBUG modem << 
    2022-05-03T12:57:56.554Z DEBUG modem << OK
    2022-05-03T12:57:56.559Z DEBUG modem >> AT+CGMR
    2022-05-03T12:57:56.578Z DEBUG modem << mfw_nrf9160_1.2.2
    2022-05-03T12:57:56.581Z DEBUG modem << OK
    2022-05-03T12:57:56.585Z INFO Nordic Semiconductor ASA nRF9160-SICA [mfw_nrf9160_1.2.2] SerNr: 352656104485738
    2022-05-03T12:57:56.588Z DEBUG modem >> AT+CEMODE?
    2022-05-03T12:57:56.604Z DEBUG modem << +CEMODE: 2
    2022-05-03T12:57:56.607Z DEBUG modem << OK
    2022-05-03T12:57:56.618Z DEBUG modem >> AT%XCBAND=?
    2022-05-03T12:57:56.638Z DEBUG modem << %XCBAND: (1,2,3,4,5,8,12,13,18,19,20,25,26,28,66)
    2022-05-03T12:57:56.639Z DEBUG modem << OK
    2022-05-03T12:57:56.650Z DEBUG modem >> AT+CMEE?
    2022-05-03T12:57:56.666Z DEBUG modem << +CMEE: 0
    2022-05-03T12:57:56.668Z DEBUG modem << OK
    2022-05-03T12:57:56.671Z DEBUG modem >> AT+CMEE=1
    2022-05-03T12:57:56.681Z DEBUG modem << OK
    2022-05-03T12:57:56.687Z DEBUG modem >> AT+CNEC?
    2022-05-03T12:57:56.698Z DEBUG modem << +CNEC: 0
    2022-05-03T12:57:56.699Z DEBUG modem << OK
    2022-05-03T12:57:56.704Z DEBUG modem >> AT+CNEC=24
    2022-05-03T12:57:56.714Z DEBUG modem << OK
    2022-05-03T12:57:56.718Z DEBUG modem >> AT+CGEREP?
    2022-05-03T12:57:56.725Z DEBUG modem << +CGEREP: 0,0
    2022-05-03T12:57:56.731Z DEBUG modem << 
    2022-05-03T12:57:56.732Z DEBUG modem << OK
    2022-05-03T12:57:56.736Z DEBUG modem >> AT+CGDCONT?
    2022-05-03T12:57:56.751Z DEBUG modem << +CGDCONT: 0,"IPV4V6","telenor.smart","10.153.230.32 2A02:2121:0349:9BBB:0000:0051:18FD:0A01",0,0
    2022-05-03T12:57:56.752Z DEBUG modem << OK
    2022-05-03T12:57:56.766Z DEBUG modem >> AT+CGACT?
    2022-05-03T12:57:56.782Z DEBUG modem << +CGACT: 0,1
    2022-05-03T12:57:56.784Z DEBUG modem << OK
    2022-05-03T12:57:56.790Z DEBUG modem >> AT+CGEREP=1
    2022-05-03T12:57:56.805Z DEBUG modem << OK
    2022-05-03T12:57:56.808Z DEBUG modem >> AT+CIND=1,1,1
    2022-05-03T12:57:56.823Z DEBUG modem << OK
    2022-05-03T12:57:56.832Z DEBUG modem >> AT+CEREG=5
    2022-05-03T12:57:56.849Z DEBUG modem << OK
    2022-05-03T12:57:56.853Z DEBUG modem >> AT+CEREG?
    2022-05-03T12:57:56.872Z DEBUG modem << +CEREG: 5,1,"76C1","014A0302",7,,,"00001010","11000001"
    2022-05-03T12:57:56.874Z DEBUG modem << 
    2022-05-03T12:57:56.876Z DEBUG modem << OK
    2022-05-03T12:57:56.892Z DEBUG modem >> AT+COPS=3,2
    2022-05-03T12:57:56.907Z DEBUG modem << OK
    2022-05-03T12:57:56.914Z DEBUG modem >> AT+COPS?
    2022-05-03T12:57:56.932Z DEBUG modem << +COPS: 0,2,"24201",7
    2022-05-03T12:57:56.934Z DEBUG modem << OK
    2022-05-03T12:57:56.942Z DEBUG modem >> AT%XCBAND
    2022-05-03T12:57:56.959Z DEBUG modem << %XCBAND: 20
    2022-05-03T12:57:56.963Z DEBUG modem << OK
    2022-05-03T12:57:56.973Z DEBUG modem >> AT+CGDCONT?
    2022-05-03T12:57:56.998Z DEBUG modem << +CGDCONT: 0,"IPV4V6","telenor.smart","10.153.230.32 2A02:2121:0349:9BBB:0000:0051:18FD:0A01",0,0
    2022-05-03T12:57:57.001Z DEBUG modem << OK
    2022-05-03T12:57:57.009Z DEBUG modem >> AT+CGACT?
    2022-05-03T12:57:57.019Z DEBUG modem << +CGACT: 0,1
    2022-05-03T12:57:57.020Z DEBUG modem << OK
    2022-05-03T12:57:57.025Z DEBUG modem >> AT%CESQ=1
    2022-05-03T12:57:57.033Z DEBUG modem << OK
    2022-05-03T12:57:57.040Z DEBUG modem >> AT+CESQ
    2022-05-03T12:57:57.049Z DEBUG modem << %CESQ: 63,3,12,1
    2022-05-03T12:57:57.052Z DEBUG modem << +CESQ: 99,99,255,255,12,63
    2022-05-03T12:57:57.054Z DEBUG modem << OK
    2022-05-03T12:57:57.064Z DEBUG modem >> AT%XSIM=1
    2022-05-03T12:57:57.071Z DEBUG modem << OK
    2022-05-03T12:57:57.074Z DEBUG modem >> AT%XSIM?
    2022-05-03T12:57:57.082Z DEBUG modem << %XSIM: 1
    2022-05-03T12:57:57.084Z DEBUG modem << OK
    2022-05-03T12:57:57.091Z DEBUG modem >> AT+CPIN?
    2022-05-03T12:57:57.108Z DEBUG modem << +CPIN: READY
    2022-05-03T12:57:57.112Z DEBUG modem << OK
    2022-05-03T12:57:57.122Z DEBUG modem >> AT+CPINR="SIM PIN"
    2022-05-03T12:57:57.148Z DEBUG modem << +CPINR: "SIM PIN",3
    2022-05-03T12:57:57.149Z DEBUG modem << OK
    2022-05-03T12:57:57.154Z DEBUG modem >> AT+CIMI
    2022-05-03T12:57:57.169Z DEBUG modem << 242016001371430
    2022-05-03T12:57:57.171Z DEBUG modem << OK
    2022-05-03T12:57:57.172Z INFO IMSIdentity: 242016001371430
    2022-05-03T12:58:07.653Z DEBUG modem >> AT#XMQTTCON=2,"blah","","","blahblah.com",8883,123
    2022-05-03T12:58:08.665Z ERROR Error: 'AT#XMQTTCON=2,"blah","","","blahblah.com",8883,123
    ' timed out
    2022-05-03T12:58:11.661Z DEBUG modem << OK
    2022-05-03T12:58:11.868Z DEBUG modem << #XMQTTEVT: 0,0
    2022-05-03T12:58:20.072Z DEBUG modem << %CESQ: 65,3,17,2
    2022-05-03T12:58:23.662Z DEBUG modem >> AT#XMQTTPUB="test/publ","heeeey",0,0
    2022-05-03T12:58:23.681Z DEBUG modem << OK
    2022-05-03T12:58:23.772Z DEBUG modem << %CESQ: 62,3,11,1
    2022-05-03T12:58:30.953Z DEBUG modem << %CESQ: 65,3,16,2
    2022-05-03T12:58:50.583Z DEBUG modem << %CESQ: 255,0,255,0

    Ashvin Makwana said:
    It would be help full and is there any SDK or library available to communicate with external MCU over UART?

    There are lots of ways to do this, like the zephyr UART driver. The SLM sample is also used to communicate with an external MCU, so you can just look at that.

Related