SLM 2.4.0 + RAI

Hi, 

We want to use RAI with SLM FW and not sure how to add it
I've read some tickets regarding it but still no walkthrough.

Here are the steps we do now:

1. Receive GPS fix

2. Connect to out server

3. Send data and GPS

4. Check shadow

5. Close connection

6. Send Sleep=2 command

After the sleep command there is a time when the modem is still active and consuming power, and when the network is release the current drops to what it should be (happen the same with PSM or EDRX)

We want to know how to add the RAI (in code or AT commands) that immediate after Sleep=2 the modem will go idle 

Any guide regarding this issue?

We connect with MQTT (LTE-M)

  • Hi Øyvind,

    Sorry it took time

    I really tried to do all we can to get modem trace but it is not possible

    The most I can give you is this:

    [5/9 17:21:17:730] Ready
    [5/9 17:21:19:095] [00:00:00.503,143] <inf> nrf_modem_lib_trace: Trace thread ready
    [5/9 17:21:19:100] [00:00:00.504,699] <inf> nrf_modem_lib_trace: Trace level override: 2
    [5/9 17:21:19:104] [00:00:00.504,730] <inf> slm: Serial LTE Modem
    [5/9 17:21:19:110] [00:00:00.504,760] <inf> slm_at_host: UART2 baud: 115200 d/p/s-bits: 3/0/1 HWFC: 1
    [5/9 17:21:19:119] [00:00:00.607,116] <inf> slm_at_host: at_host init done
    [5/9 17:21:41:828] AT%REL14FEAT=0,1,0,0,0
    [5/9 17:21:41:937] OK
    [5/9 17:21:46:168] AT%RAI=1
    [5/9 17:21:46:479] OK
    [5/9 17:21:49:860] AT+CEREG=5
    [5/9 17:21:51:043] OK
    [5/9 17:21:55:948] AT%XBANDLOCK=2,"100"
    [5/9 17:21:57:128] OK
    [5/9 17:22:00:124] AT+CSCON=3
    5/9 17:22:00:167] OK
    [5/9 17:22:03:717] AT+CPSMS=1,"","","10100001","00001010"
    [5/9 17:22:04:733] OK
    [5/9 17:22:08:727] AT+CFUN=1
    [5/9 17:22:09:298] OK
    [5/9 17:22:10:818] +CEREG: 2,"198D","00048801",7
    [5/9 17:22:10:822] +CSCON: 1,7,4
    [5/9 17:22:12:342] +CEREG: 5,"198D","00048801",7,,,"00001010","11100000"
    [5/9 17:22:13:992] AT#XSOCKETOPT=1,50
    [5/9 17:22:15:382] ERROR
    [5/9 17:22:15:382] [00:00:56.883,544] <err> slm_sock: setsockopt(50) error: -9
    [5/9 17:22:21:079] AT%RAI=1
    [5/9 17:22:21:467] OK
    [5/9 17:22:24:486] AT#XSOCKETOPT=1,50
    5/9 17:22:24:512] ERROR
    [5/9 17:22:26:032] [00:01:07.378,509] <err> slm_sock: setsockopt(50) error: -9
    [[5/9 17:22:27:552] +CSCON: 0,7,4
    [5/9 17:31:45:717] AT+CEREG?
    [5/9 17:31:45:908] +CEREG: 5,5,"198D","00048801",7,,,"00001010","11100000"
    [5/9 17:31:45:912] OK
    [5/9 17:31:48:583] AT+CFUN?
    [5/9 17:31:48:952] +CFUN: 1
    [5/9 17:31:48:952] OK
    [5/9 17:32:02:597] AT#XNRFCLOUD=1
    [5/9 17:32:04:167] OK
    [5/9 17:32:04:167] +CSCON: 1,7,4
    [5/9 17:32:06:951] AT#XSOCKETOPT=1,50
    [5/9 17:32:07:212] ERROR
    [5/9 17:32:07:212] [00:10:48.968,719] <inf> slm_gnss: NRF_CLOUD_EVT_TRANSPORT_CONNECTED
    [5/9 17:32:07:216] [00:10:49.862,243] <err> slm_sock: setsockopt(50) error: -9
    [5/9 17:32:08:731] #XNRFCLOUD: 1,0
    [5/9 17:32:08:736] [00:10:50.305,175] <inf> slm_gnss: NRF_CLOUD_EVT_READY
    [5/9 17:32:16:086] AT#XSOCKETOPT=1,50
    [5/9 17:32:16:342] ERROR
    [5/9 17:32:17:862] [00:10:58.997,436] <err> slm_sock: setsockopt(50) error: -9
    5/9 17:32:25:471] +CSCON: 0,7,4
    [5/9 17:32:26:152] AT+CFUN=0
    [5/9 17:32:26:992] #XNRFCLOUD: 0,0
    [5/9 17:32:28:516] [00:11:09.165,100] <inf> slm_gnss: NRF_CLOUD_EVT_TRANSPORT_DISCONNECTED: status 3
    [5/9 17:32:28:521] OK
    [5/9 17:32:28:521] +CSCON: 1,7,4
    [5/9 17:32:28:525] +CEREG: 0
    [5/9 17:32:28:525] +CSCON: 0,7,4

  • I still consider, that AS-RAI requires much more user documentation. I don't know, why Nordic invest in advertisement for a feature, but then leaves the user without adequate documentation.

    The log above shows me, that at least this user is suffering from the missing documentation.

    AS-RAI in difference to CP-RAI is not something, which is configured completely ahead. In CP-RAI it's possible to enable "ONE-RESP" once and this gets then used until the configuration is changed. That's all done with %XRAI.

    AS-RAI is different. It must be general enabled (using REL14FEAT and RAI), but then afterwards the application provides frequently the "LAST" or "NO DATA" via a socket option. For that socket you need to first establish the "connection". One downside I found is, that if the HTTP server already closes the connection, no AS-RAI option can be set. If you have a connection, then using the option should work. 

    I don't know, if XNRFCLOUD uses an socket, which is then accessible by the XSOCKETOPT cmd. If not, I guess, XNRFCLOUD doesn't support AS-RAI.

  • Thanks Achim

    I've tried to use it when the connection is open after I exit data mode and before closing the connection and still ERROR.

    Also after exiting data mode and closing connection there is still ERROR

    The command AT#XSOCKETOPT=1,50 doesn't seems to work

    [13/9 10:56:06:083] AT+CEREG=5
    [13/9 10:56:06:814] OK
    [13/9 10:56:08:973] AT+CPSMS=1,"","","10100001","00001010"
    [13/9 10:56:09:858] OK
    [13/9 10:56:11:033] AT+CSCON=3
    [13/9 10:56:11:383] OK
    [13/9 10:56:13:023] AT%REL14FEAT=0,1,0,0,0
    [13/9 10:56:15:598] AT%RAI=1
    [13/9 10:56:15:947] OK
    [13/9 10:56:28:472] AT+CFUN=1
    [13/9 10:56:29:647] OK
    [13/9 10:56:31:167] +CEREG: 2,"198D","00048801",7
    [13/9 10:56:31:167] +CSCON: 1,7,4
    [13/9 10:56:31:172] +CEREG: 5,"198D","00048801",7,,,"00001010","11100000"
    [13/9 10:56:36:177] AT#XMQTTCON=1,"..","","","..",8883,321
    [13/9 10:56:40:297] OK
    [13/9 10:56:40:297] #XMQTTEVT: 0,0
    [13/9 10:56:43:841] AT#XMQTTPUB="..","",1
    [13/9 10:56:44:861] OK
    [13/9 10:56:50:381] test
    [13/9 10:56:50:951] #XMQTTEVT: 3,0
    [13/9 10:56:52:056] test
    [13/9 10:56:53:996] #XMQTTEVT: 3,0
    [13/9 10:56:58:908] +++
    [13/9 10:57:00:081] #XDATAMODE: 0
    [13/9 10:57:01:857] AT#XSOCKETOPT=1,50
    [13/9 10:57:03:125] ERROR
    [13/9 10:57:05:225] AT#XMQTTCON=0
    [13/9 10:57:06:171] #XMQTTEVT: 1,0
    [13/9 10:57:06:171] OK
    [13/9 10:57:07:590] AT#XSOCKETOPT=1,50
    [13/9 10:57:07:765] ERROR
    [13/9 10:57:11:592] AT#XSLEEP=2
    [13/9 10:57:12:256] OK
    [13/9 10:57:14:607] low_power

    Still takes 16-60 seconds to get RRC idle

  • My understanding of that code is limited, but it seems, that connecting with XNRFCLOUD create a socket, which is then not accessible by AT#XSOCKETOPT.

    So, let me try to sum up my experience with AS-RAI:

    - AS-RAI is for no only rarely supported by the networks.

    - Due to the API from Nordic it's not easy to see, if your network supports it. It's also not easy to see, if something is done wrong, which prevents AS-RAI from working.

    There two things you may do:

    - check, if AS-RAI is supported by your network. One  way would be to use the UDP example, even if that doesn't help in the end. If you device fails to use AS-RAI with that example in your network, then I guess, you don't need to spend more time for now.

    - ask more specific, how that SLM application is intended to support AS-RAI.

    I guess, the complete mess around AS-RAI may be much larger than common users would expect. I would not be too surprised, if the current implementation is much behind the plans and works only in a very few special cases. But not in general, not for all apps and not for TCP.

  • mfw 1.3.5, NCS 2.4.2

    Doing some comparison tests with TCP and UDP, I stumbled over a nice update to TCP/AS-RAI.

    If you enable AS-RAI (AT%REL14FEAT=0,1,0,0,0 + AT%RAI=1) closing the TCP socket seems to already trigger SO_RAI_NO_DATA. In networks with AS-RAI my modem gets idle in 2-3s after closing. In networks without AS-RAI it takes about 10-12s (that depends on the network setting of the provider).

Related