MC7455 CID allocation MBIM connect

Hello!
I’m working with MC7455 module and working with both AT commands and mbim. The module is working with a double APN SIM and i’m having some trouble during activation on data traffic of the activated data APN in LTE.
The sequence of commands are:

at+cgdcont=1,"IP",""
at+cgdcont=3,"IP","APN_DATA_1"
ip link set wwan0 up
ip link add link wwan0 name wwan0.1 type vlan id 1
ip link add link wwan0 name wwan0.2 type vlan id 2
mbimcli -d /dev/cdc-wdm0 --query-device-caps --no-close
mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close
mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=X --no-close
mbimcli -d /dev/cdc-wdm0 --connect=session-id=**2**,apn="APN_DATA_1",auth="CHAP",username="XXXX",password="YYYYY" --no-open=x --no-close
AT+CGACT?

+CGACT: 1,1
+CGACT: 3,1
AT+CGCONTRDP
+CGCONTRDP: 1,5,DEFAULT_APN,ip_addr,
+CGCONTRDP: 3,6,APN_DATA_1,
AT+CGDCONT?
+CGDCONT: 1,“IPV4V6”,"","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0"
+CGDCONT: 3,“IP”,“APN_DATA_1”,“0.0.0.0”,0,0,0,0
at+cgdcont=2,“IP”,“APN_DATA_2”
mbimcli -d /dev/cdc-wdm0 --connect=session-id=1,apn=“APN_DATA_2” --no-open=X --no-close
AT+CGDCONT?
+CGDCONT: 1,“IPV4V6”,“APN_DATA_2”,“0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0”,0,0,0,0
+CGDCONT: 3,“IP”,“APN_DATA_1”,“0.0.0.0”,0,0,0,0
+CGDCONT: 2,“IP”,“APN_DATA_2”,“0.0.0.0”,0,0,0,0
AT+CGCONTRDP
+CGCONTRDP: 1,5,APN_DATA_2,ip_addr,

After done this sequence and mounted properly the VLANs, added the IP and routed properly. The result is that the data traffic is correctly routed on the first connected APN (APN_DATA_1) but to the second connected (APN_DATA_2) on session 1 no data traffic is routed.
What i’m doing wrong on this sequence?

Thanks in advance!!
Kliti

Maybe “SINGLEAPNSWITCH" is enabled? If so, then you’ll only be able to connect to one APN. Existiing sessions will be disconnected when you connect a new one. Somewhat annoying…

Check/set with AT!CUSTOM.

Your commands look basically fine. Just a few minor things I would have done differently:

  • Use the mbim-proxy. I.e add ‘-p’ to all mbimcli commands.
  • The AT commands are unnecessary. Contexts are configured by the MBIM requests
  • Add --no-open=X to the --query-subscriber-ready-status too
  • Maybe use MBIM session ID 0 and 1 instead of 1 and 2? 0 is mapped to VLAN ID 4094, so you’d create the link using ip link add link wwan0 name wwan0.0 type vlan id 4094

But none of these are critical. Your version should also work. So the SINGLEAPNSWITCH is the most likely explanation.

Hi Bjorn,
thank for your fast replay!
The SINGLEAPNSWITCH was active. Deactivating the SINGLEAPNSWITCH the things didn’t change.
I tried to change APN with AT command of CID that was active but no attach and de-attach happens when SINGLEAPNSWITCH was set to 1.
The attach and de-attach happens only in MBIM mode when executing the connection command?

Thanks,

Kliti

Assuming the network allows connections to both APN1 and APN2. If you do

mbimcli -p -d /dev/cdc-wdm0  --connect=session-id=0,apn=APN1 --no-close --no-open=X 
mbimcli -p -d /dev/cdc-wdm0  --connect=session-id=1,apn=APN2 --no-close --no-open=X 

then APN1 will be disconnected and only APN2 connected if SINGLEAPNSWITCH is enabled (set to 1 or 2). Both APNs will be connected if SINGLEAPNSWITCH is 0.

Using AT+CGDCONT to change the APN of a specific entry makes no difference either way. That’s not related to this setting at all. The profiles are mostly irrelevant to the MBIM sessions, which are established according to the APN and authentication data given in the MBIM connect request.

You may have to reset the modem after changing the SINGLEAPNSWITCH setting. Not sure…

Hello Bjorn,
The tests that i was done by changing APN with AT+CGDCONT.
I did some tests by changing SINGLEAPNSWITCH status, so with SINGLEAPNSWITCH setted to 1:

AT+CGDCONT=1,“IP”
sudo mbimcli -d /dev/cdc-wdm1 --query-device-caps --no-close
sudo mbimcli -d /dev/cdc-wdm1 --query-subscriber-ready-status --no-close
sudo mbimcli -d /dev/cdc-wdm1 --attach-packet-service --no-open=X --no-close
sudo mbimcli -d /dev/cdc-wdm1 --connect=session-id=1,apn=“APN_DATA1” --no-open=X --no-close
sudo mbimcli -d /dev/cdc-wdm1 --connect=session-id=2,apn=“APN_DATA2” --no-open=X --no-close
AT+CGCONTRDP
+CGCONTRDP: 1,5,APN_DATA2,source_addr,DNS_prim_addr,DNS_sec_addr
at+cgact?
+CGACT: 1,1

With SINGLEAPNSWITCH setted to 0

AT+CGDCONT=1,“IP”
sudo mbimcli -d /dev/cdc-wdm1 --query-device-caps --no-close
sudo mbimcli -d /dev/cdc-wdm1 --query-subscriber-ready-status --no-close
sudo mbimcli -d /dev/cdc-wdm1 --attach-packet-service --no-open=X --no-close
sudo mbimcli -d /dev/cdc-wdm1 --connect=session-id=1,apn=“APN_DATA1” --no-open=X --no-close
sudo mbimcli -d /dev/cdc-wdm1 --connect=session-id=2,apn=“APN_DATA2” --no-open=X --no-close
AT+CGCONTRDP
+CGCONTRDP: 1,5,DEFAULT_APN,source_addr,DNS_prim_addr,DNS_sec_addr
+CGCONTRDP: 1,5,DEFAULT_APN,source_addr,DNS_prim_addr,DNS_sec_addr
+CGCONTRDP: 1,5,DEFAULT_APN,source_addr,DNS_prim_addr,DNS_sec_addr
at+cgact?
+CGACT: 1,1

So with the SINGLEAPNSWITCH setted to 0 both session opened with MBIM are active.
Is normal that only CID 1 is active and the Dynamic parameters are equal?

Thank you so much Bjorn, the information given was so helpful!!

Great! Then we have the expected behaviour.

If you are talking about the AT command interface, then I must admit I don’t know. I don’t use AT commands for connection management. But I don’t think all the MBIM (or QMI) stuff is reflected there, and vice versa. I guess the assumption is that you use either QMI, MBIM or AT for connection management. The actual radio resources are obviously shared, but the connection related config and state cache isn’t necessarily.

Hello,
sorry for the late replay.
I have done some test this days and the problem seems solved.
Doing some search, the reason why AT didn’t reflect MBIM was because i haven’t set the authentication requirements for both APN in AT mode.
Its mandatory , if you want to have more than one context activated, to set SINGLEAPNSWITCH at 0.

thank’s a lot Bjorn for your help!