I'm seeing inconsistency in reading the ICCID from the nRF9160 modem with modem_info_string_get(MODEM_INFO_ICCID, mystr,strlen(mystr));. All other modem_info calls work except this one.
I call it early in my program to get the ICCID in order to activate the virtual SIMM at my cellular provider but have had issues with it coming up blank in the past. I had it working in Golioth SDK 0.12.0 w/Nordic SDK 2.5.2 and am porting my code to Golioth SDK 0.15.0 w/Nordic SDK 2.7 and it never returns any data.
This code will run forever returning code -5 = EIO = I/O error
If I call the code later in the program after the modem connects it will return a valid ICCID, but I need it earlier than that and it shouldn't be dependent on modem connection.
while((err = modem_info_string_get(MODEM_INFO_ICCID, mystr, STRLEN - 1)) <= 0) {
LOG_ERR("Cannot read modem ICCID. err:%i line %i", err, __LINE__);
k_msleep(500);
}
I've copied in the old 2.5.2 network_info.c&h files and it didn't make a difference so it's not an issue with the helper library.