I have followed the instructions from @rickkas7 (this post) and I managed to build a sample with debug using my custom connection.
This is the output I got:
0000005999 [ncp.at] TRACE: > AT+CGDCONT=1,“IP”,""
0000006040 [ncp.at] TRACE: < OK
0000006041 [ncp.at] TRACE: > AT+CEREG=2
0000006090 [ncp.at] TRACE: < OK
0000006091 [hal] TRACE: NCP connection state changed: 1
0000006093 [net.pppncp] TRACE: NCP event 2
0000006094 [net.pppncp] TRACE: State changed event: 1
> 0000006095 [ncp.at] TRACE: > AT+COPS=1,2,"21401"
0000006096 [hal] TRACE: PPP thread event LOWER_DOWN
> Serial connection closed. Attempting to reconnect…
Serial monitor opened successfully:
0000000404 [hal] TRACE: Cellullar Config – APN: USER: PASS:
0000000429 [hal] TRACE: Updated file: /sys/cellular_config.bin
0000000458 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000000461 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000000462 [hal] TRACE: PPP netif -> 8
0000000463 [net.ifapi] INFO: Netif pp3 state UP
> 0000000465 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000001026 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
> 0000002388 [hal] TRACE: Modem powered off
0000002388 [hal] TRACE: Powering modem on
0000002540 [hal] TRACE: Modem powered on
The modification of device-os I have done is this: from sara_ncp_client.cpp, function registerNet(), line 807 (release v0.8.0-rc.27) I have replaced
r = CHECK_PARSER(parser_.execCommand(3 * 60 * 1000, “AT+COPS=0”));
r = CHECK_PARSER(parser_.execCommand(3 * 60 * 1000, "AT+COPS=1,2,“21401"”));
NB-IoT vodafone Spain network doesn’t use apn, user and password and this is shown in the log. But later the serial connection resets, and we don’t know if this is a normal behaviour or not (we don’t have any other SIM card to try).
Apparently after a while, the network connection is up but then the modem power off and we don’t know why.
Any hints on that?
Thank @ScruffR and @rickkas7 for all your support.