Arm Mbed OS support forum

C030-R412m: Mbed OS cellular network interface IP always 0.0.0.0

Hi!

Mbed OS: 5.15.7
Target: Ublox C030 R412m

Implementing the network (NetworkInterface) with iface = CellularContext::get_default_instance(); the modem starts an does many AT commands. But at the point to get the IP address I have the following in my log:

...
[00012734ms][INFO][CELL]: AT TX ( 6): AT+CSQ
[00012739ms][INFO][CELL]: AT TX ( 1): <cr>
[00012744ms][INFO][CELL]: AT RX (20): <cr><ln>+CSQ: 9,99<cr><ln><cr><ln>OK<cr><ln>
[00012752ms][DBG ][CELL]: callback: 4104, err: 0, data: 4098
[00012759ms][INFO][CELL]: RSSI -95 dBm
[00012764ms][DBG ][CELL]: callback: 4106, err: 0, data: 4098
[00012770ms][INFO][CELL]: AT TX ( 9): AT+CGREG?
[00012776ms][INFO][CELL]: AT TX ( 1): <cr>
[00012781ms][INFO][CELL]: AT RX (21): <cr><ln>+CGREG: 2,2<cr><ln><cr><ln>OK<cr><ln>
[00012789ms][DBG ][CELL]: +CGREG: SearchingNetwork, LAC -1, cell -1, RAT unknown
[00012798ms][INFO][CELL]: Network registration (timeout 180000 ms)
[00012805ms][DBG ][CELL]: callback: 4106, err: 0, data: 4098
[00012811ms][DBG ][CELL]: Registering network: retry 2/10
[00012818ms][DBG ][CELL]: callback: CellularStateRetryEvent, err: 0, data: 4098, retrycount: 2
[00012827ms][INFO][CELL]: Continue after 4 seconds
[00013973ms][DBG ][CELL]: AT OoB readable 1, len 0
[00013978ms][INFO][CELL]: AT RX (29): <cr><ln>+CGREG: 1,"XXXX","XXXX",3<cr><ln>
[00013987ms][DBG ][CELL]: +CGREG: RegisteredHomeNetwork, LAC XXXXX cell XXXXX, EGPRS
[00013995ms][DBG ][CELL]: callback: 4101, err: 0, data: 3
[00014002ms][DBG ][CELL]: callback: 4098, err: 0, data: 1
[00014008ms][INFO][CELL]: Registering network => Attaching network
[00014015ms][DBG ][CELL]: callback: 4100, err: 0, data: 18852
[00014022ms][DBG ][CELL]: AT OoB done
[00014026ms][INFO][CELL]: AT TX ( 6): AT+CSQ
[00014032ms][INFO][CELL]: AT TX ( 1): <cr>
[00014037ms][INFO][CELL]: AT RX (20): <cr><ln>+CSQ: 9,99<cr><ln><cr><ln>OK<cr><ln>
[00014045ms][DBG ][CELL]: callback: 4104, err: 0, data: -1
[00014052ms][INFO][CELL]: RSSI -95 dBm
[00014056ms][DBG ][CELL]: callback: 4106, err: 0, data: 4102
[00014063ms][INFO][CELL]: Attaching network (timeout 60000 ms)
[00014070ms][INFO][CELL]: AT TX ( 9): AT+CGATT?
[00014075ms][INFO][CELL]: AT TX ( 1): <cr>
[00014080ms][INFO][CELL]: AT RX (19): <cr><ln>+CGATT: 1<cr><ln><cr><ln>OK<cr><ln>
[00014089ms][DBG ][CELL]: callback: 4102, err: 0, data: 1
[00014095ms][INFO][CELL]: AT TX ( 8): AT+URAT?
[00014100ms][INFO][CELL]: AT TX ( 1): <cr>
[00014105ms][INFO][CELL]: AT RX (16): <cr><ln>+URAT: 8,9,7<cr><ln>
[00014113ms][INFO][CELL]: AT RX ( 6): <cr><ln>OK<cr><ln>
[00014119ms][INFO][CELL]: AT TX ( 9): AT+CGACT?
[00014124ms][INFO][CELL]: AT TX ( 1): <cr>
[00014129ms][INFO][CELL]: AT RX (21): <cr><ln>+CGACT: 1,0<cr><ln><cr><ln>OK<cr><ln>
[00014138ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00014144ms][INFO][CELL]: AT TX ( 1): 1
[00014148ms][INFO][CELL]: AT TX ( 1): <cr>
[00014154ms][INFO][CELL]: AT RX (18): <cr><ln>+CGPADDR: 1,0.0.
[00014160ms][INFO][CELL]: AT RX (11): 0.0<cr><ln><cr><ln>OK<cr><ln>
[00014368ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00014373ms][INFO][CELL]: AT TX ( 1): 1
[00014378ms][INFO][CELL]: AT TX ( 1): <cr>
[00014383ms][INFO][CELL]: AT RX (18): <cr><ln>+CGPADDR: 1,0.0.
[00014390ms][INFO][CELL]: AT RX (11): 0.0<cr><ln><cr><ln>OK<cr><ln>
[00014597ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00014602ms][INFO][CELL]: AT TX ( 1): 1
[00014607ms][INFO][CELL]: AT TX ( 1): <cr>
[00014612ms][INFO][CELL]: AT RX (15): <cr><ln>+CGPADDR: 1,0
[00014619ms][INFO][CELL]: AT RX (14): .0.0.0<cr><ln><cr><ln>OK<cr><ln>
[00014826ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00014831ms][INFO][CELL]: AT TX ( 1): 1
[00014836ms][INFO][CELL]: AT TX ( 1): <cr>
[00014841ms][INFO][CELL]: AT RX (29): <cr><ln>+CGPADDR: 1,0.0.0.0<cr><ln><cr><ln>OK<cr><ln>
[00015050ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00015055ms][INFO][CELL]: AT TX ( 1): 1
[00015060ms][INFO][CELL]: AT TX ( 1): <cr>
[00015065ms][INFO][CELL]: AT RX (23): <cr><ln>+CGPADDR: 1,0.0.0.0<cr><ln>
[00015073ms][INFO][CELL]: AT RX ( 6): <cr><ln>OK<cr><ln>
[00015279ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00015284ms][INFO][CELL]: AT TX ( 1): 1
[00015289ms][INFO][CELL]: AT TX ( 1): <cr>
[00015294ms][INFO][CELL]: AT RX (17): <cr><ln>+CGPADDR: 1,0.0
[00015301ms][INFO][CELL]: AT RX (12): .0.0<cr><ln><cr><ln>OK<cr><ln>
[00015508ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00015513ms][INFO][CELL]: AT TX ( 1): 1
[00015518ms][INFO][CELL]: AT TX ( 1): <cr>
[00015523ms][INFO][CELL]: AT RX (18): <cr><ln>+CGPADDR: 1,0.0.
[00015530ms][INFO][CELL]: AT RX (11): 0.0<cr><ln><cr><ln>OK<cr><ln>
[00015737ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00015742ms][INFO][CELL]: AT TX ( 1): 1
[00015747ms][INFO][CELL]: AT TX ( 1): <cr>
[00015752ms][INFO][CELL]: AT RX (17): <cr><ln>+CGPADDR: 1,0.0
[00015759ms][INFO][CELL]: AT RX (12): .0.0<cr><ln><cr><ln>OK<cr><ln>
[00015966ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00015971ms][INFO][CELL]: AT TX ( 1): 1
[00015976ms][INFO][CELL]: AT TX ( 1): <cr>
[00015981ms][INFO][CELL]: AT RX (17): <cr><ln>+CGPADDR: 1,0.0
[00015988ms][INFO][CELL]: AT RX (12): .0.0<cr><ln><cr><ln>OK<cr><ln>
[00016195ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00016200ms][INFO][CELL]: AT TX ( 1): 1
[00016205ms][INFO][CELL]: AT TX ( 1): <cr>
[00016210ms][INFO][CELL]: AT RX (18): <cr><ln>+CGPADDR: 1,0.0.
[00016217ms][INFO][CELL]: AT RX (11): 0.0<cr><ln><cr><ln>OK<cr><ln>
[00016424ms][INFO][CELL]: AT TX (11): AT+CGPADDR=
[00016429ms][INFO][CELL]: AT TX ( 1): 1
[00016434ms][INFO][CELL]: AT TX ( 1): <cr>
[00016439ms][INFO][CELL]: AT RX (16): <cr><ln>+CGPADDR: 1,0.
[00016446ms][INFO][CELL]: AT RX (13): 0.0.0<cr><ln><cr><ln>OK<cr><ln>
[00016453ms][INFO][CELL]: Cellular local IP: 0.0.0.0
...

After this point I open a socket, but that fails!

Connection Established.
[00016461ms][INFO][CELL]: Socket 0 open
[00016466ms][INFO][CELL]: AT TX (12): AT+UDNSRN=0,
[00016472ms][INFO][CELL]: AT TX ( 1): "
[00016477ms][INFO][CELL]: AT TX (18): myreal.endpoint.x
[00016483ms][INFO][CELL]: AT TX ( 1): "
[00016488ms][INFO][CELL]: AT TX ( 1): <cr>
[00019083ms][INFO][CELL]: AT RX ( 1): <cr>
[00019088ms][INFO][CELL]: AT RX (10): <ln>+UDNSRN: 
[00019224ms][INFO][CELL]: AT RX ( 9): "1.234.56
[00019229ms][INFO][CELL]: AT RX (13): .789"<cr><ln><cr><ln>OK<cr><ln>
[00019237ms][INFO][CELL]: AT TX (10): AT+USOCR=6
[00019242ms][INFO][CELL]: AT TX ( 1): <cr>
[00019251ms][INFO][CELL]: AT RX (11): <cr><ln>+USOCR: 0
[00019257ms][INFO][CELL]: AT RX ( 8): <cr><ln><cr><ln>OK<cr><ln>
[00019264ms][INFO][CELL]: AT TX ( 9): AT+USOCO=
[00019269ms][INFO][CELL]: AT TX ( 1): 0
[00019274ms][INFO][CELL]: AT TX ( 1): ,
[00019279ms][INFO][CELL]: AT TX ( 1): "
[00019284ms][INFO][CELL]: AT TX (12): 1.234.56.789
[00019289ms][INFO][CELL]: AT TX ( 1): "
[00019294ms][INFO][CELL]: AT TX ( 1): ,
[00019299ms][INFO][CELL]: AT TX ( 4): 1234
[00019304ms][INFO][CELL]: AT TX ( 1): <cr>
[00019309ms][INFO][CELL]: AT RX (16): <cr><ln>+CME ERROR: 3<cr>
[00019316ms][INFO][CELL]: AT RX ( 3): <ln><cr><ln>
[00019321ms][WARN][CELL]: AT error code 3
[00019326ms][DBG ][CELL]: AT error -3012

On page nr. 863 of https://www.u-blox.com/sites/default/files/u-blox-CEL_ATCommands_UBX-13002752.pdf, +CME ERROR: 3 is described as “Operation not allowed”.

After a lot of debugging hours the forum here is my last chance. :sweat: