R410M latest firmware problem

Hi!

I recently received a couple of new SFF R410M to use in my project. However the software which I had previously written does not longer work. The only difference between the old boards which I have and the new ones is the firmware version (L0.0.00.00.05.08,A.02.04 on the new boards and an older version on my existing ones) and the GNSS module (M8M on the existing ones and 8M on the new ones).

The first problem I encountered was when I tried to connect to the NB-IoT network. Using the R4X library it straight up refuses to connect using the same codebase as I previously have proven working. The AT command exchange fails with an “Operation not supported” after a number of timeouts. I got this part working by changing my MNO profile parameter from SWD_DEFAULT to SIM_ICCID which connected to the network. However, I am still unable to send messages and keep an active connection to the network after failing to send a message. Reconnecting after failing also doesn’t work.

This is really frustrating since I finally had gotten my application to run smoothly and handle disconnects and reconnects and keep it running for long periods of time. Is there anything new needed to change with the latest firmware? I’m using version 2.0.2 of the R4X library.

I really need some guidelines since I’m currently very confused as to why nothing is working.

Hi @mmolder,

I recommend to update all boards to the latest firmware, since new boards will come with the latest ublox firmware. After we fixed the issues you have at the moment of course.

The ublox sara module isn’t backward compatible.
Like you already figured out, the main issue is the MNO profile.

Here is the list of profiles which can be used:

enum MNOProfiles {
SWD_DEFAULT     = 0,
SIM_ICCID       = 1,
ATT             = 2,
VERIZON         = 3,
TELSTRA         = 4,
T_MOBILE_US     = 5,
CHINA_TELECOM   = 6,
VODAFONE        = 19,
STANDARD_EUROPE = 100
};

SWD_DEFAULT, you should never use this one.
SIM_ICCID, this will get the profile from the sim card when it is stored here. Do not to use this one for a low power aplication.
Then you get some network profiles, if you have one of these select them.
STANDARD_EUROPE, for all other European profiles when your profile isn’t in the list.

Old:

// Turns on and initializes the modem, then connects to the network and activates the data connection.
    bool connect(const char* apn, const char* urat = DEFAULT_URAT, 
        const char* bandMask = BAND_MASK_UNCHANGED);

New:

bool connect(const char* apn, const char* uratSelect, uint8_t mnoProfile, 
    const char* operatorSelect = AUTOMATIC_OPERATOR, const char* bandMaskLTE = BAND_MASK_UNCHANGED, 
    const char* bandMaskNB = BAND_MASK_UNCHANGED);

Please update your application to use the new connect()

In the new firmware version PSM and eDRX are also enables by default.
You probably want to turn these off.

    // Turn off PSM and eDRX
    r4x.execCommand("AT+CPSMS=0");
    r4x.execCommand("AT+CEDRXS=0");
    r4x.execCommand("AT+UPSV=0");

This is an upgrade of the module, the 8M only supports GPS, the M8M supports multiple GNSS at the same time. The library should be able to handle both without you having to change anything.

I know how you feel, we had to update a lot of boards and software to be ready for the future :frowning:
The R4X module is the first one where we did experience a module to be not backwards compatible.

Let me know if these changes get your application working again and if you have other questions.

Best regards,
Jan

Hi!

Thank you for the quick reply! I saw now that I was actually already using STANDARD_EUROPE as the MNO profile since my operator is not listed in the list of profiles. This allows me to make a connection to the network. I am also already using the correct connect method you referred to above. However, I am still unable to send data to my backend which I could previously. I am using UDP and sockets for this and my sendMessage method looks something like this:

void sendMessage(const char* payload) {
    if (r4x.isConnected()) {
        if (!r4x.socketIsClosed(socketID)) {
            if(!r4x.socketClose(socketID)) {        
                DEBUG.println("Error: Failed to close socket");
                return;
            }
        }
        socketID = r4x.socketCreate(localPort, UDP);
        if (socketID >= 7 || socketID < 0) {  
            DEBUG.println("Failed to create socket");
        }
        if (strlen(payload) == r4x.socketSend(socketID, CDP, CDP_PORT, (const uint8_t*)payload, strlen(payload))) {          
            DEBUG.println("Message successufully sent!");
            if(!r4x.socketClose(socketID)) {       
                DEBUG.println("Error: Failed to close socket");
            }
        }
        else {              
            DEBUG.println("Error: Could not send message");
        }
    }
    else {
        DEBUG.println("Not connected to NB-IoT network");
        nbiotConnect();
    }
}

The exchange of AT commands after being powered on until the sending of a message fails looks like the following, I removed some information regarding my CDP and ports used:

Trying to connect..
13:01:33.149 -> >> AT
13:01:33.149 -> << timed out
13:01:33.660 -> >> AT
13:01:33.660 -> << timed out
13:01:34.169 -> >> AT
13:01:34.169 -> << timed out
13:01:34.685 -> >> AT
13:01:34.685 -> << timed out
13:01:35.190 -> >> AT
13:01:35.190 -> << AT
13:01:35.362 -> << OK
13:01:35.600 -> << timed out
13:01:36.617 -> << timed out
13:01:36.617 -> >> AT+CMEE=2
13:01:36.617 -> << AT+CMEE=2
13:01:36.651 -> << OK
13:01:36.651 -> >> AT+UGPIOC=16,255
13:01:36.651 -> << AT+UGPIOC=16,255
13:01:36.651 -> << OK
13:01:36.651 -> >> ATE0
13:01:36.651 -> << ATE0
13:01:36.683 -> << OK
13:01:36.683 -> >> AT+CFUN?
13:01:36.683 -> << +CFUN: 1
13:01:36.683 -> << OK
13:01:36.683 -> >> AT+UMNOPROF?
13:01:36.683 -> << +UMNOPROF: 0
13:01:36.717 -> << OK
13:01:36.717 -> >> AT+COPS=2
13:01:36.717 -> << OK
13:01:36.751 -> >> AT+UMNOPROF=100
13:01:36.751 -> << OK
13:01:36.921 -> >> AT+CFUN=15
13:01:36.921 -> << OK
13:01:38.181 -> >> AT+CPIN?
13:01:38.181 -> << timed out
13:01:43.246 -> >> AT+CPIN?
13:01:43.246 -> << AT+CPIN?
13:01:43.281 -> << +CPIN: READY
13:01:43.281 -> << OK
13:01:43.281 -> >> ATE0
13:01:43.281 -> << ATE0
13:01:43.281 -> << OK
13:01:43.553 -> << timed out
13:01:43.553 -> >> AT+URAT?
13:01:43.553 -> << +URAT: 7,8
13:01:43.586 -> << OK
13:01:43.586 -> >> AT+COPS=2
13:01:43.586 -> << OK
13:01:43.586 -> >> AT+URAT=8
13:01:43.586 -> << OK
13:01:43.620 -> >> AT+CFUN=15
13:01:43.620 -> << OK
13:01:44.878 -> >> AT+CPIN?
13:01:44.878 -> << timed out
13:01:49.965 -> >> AT+CPIN?
13:01:49.965 -> << AT+CPIN?
13:01:49.965 -> << +CPIN: READY
13:01:49.965 -> << OK
13:01:49.965 -> >> ATE0
13:01:49.965 -> << ATE0
13:01:49.999 -> << OK
13:01:50.233 -> << timed out
13:01:50.233 -> >> AT+COPS=3,2
13:01:50.233 -> << OK
13:01:50.267 -> >> AT+COPS?
13:01:50.267 -> << +COPS: 0
13:01:50.301 -> << OK
13:01:50.301 -> >> AT+CGDCONT?
13:01:50.301 -> << +CGDCONT: 1,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
13:01:50.301 -> << OK
13:01:50.301 -> >> AT+CGDCONT=1,"IP","lpwa.telia.iot"
13:01:50.301 -> << OK
13:01:50.403 -> >> AT+CSQ
13:01:50.403 -> << +CSQ: 99,99
13:01:50.437 -> << OK
13:01:50.912 -> >> AT+CSQ
13:01:50.912 -> << +CSQ: 99,99
13:01:50.947 -> << OK
13:01:52.443 -> >> AT+CSQ
13:01:52.443 -> << +CSQ: 99,99
13:01:52.476 -> << OK
13:01:54.977 -> >> AT+CSQ
13:01:54.977 -> << +CSQ: 22,99
13:01:56.200 -> << OK
13:01:56.200 -> >> AT+CGATT?
13:01:56.200 -> << +CGATT: 1
13:01:56.200 -> << OK
13:01:56.200 -> >> AT+CGDCONT?
13:01:56.200 -> << +CGDCONT: 1,"IP","lpwa.telia.iot","*.*.*.*",0,0,0,0
13:01:56.233 -> << OK
13:01:56.233 -> >> AT+CPIN?
13:01:56.233 -> << +CPIN: READY
13:01:56.268 -> << OK
13:01:56.268 -> Connected successfully!
13:01:56.268 -> >> AT+CPSMS=0
13:01:56.268 -> << OK
13:01:56.268 -> >> AT+CEDRXS=0
13:01:56.268 -> << OK
13:01:56.302 -> >> AT+UPSV=0
13:01:56.302 -> << OK
Sending startup message
13:01:56.336 -> >> AT+CGATT?
13:01:56.336 -> << +CGATT: 1
13:01:56.370 -> << OK
13:01:56.370 -> >> AT+CSQ
13:01:56.370 -> << +CSQ: 22,99
13:01:56.370 -> << OK
13:01:56.370 -> >> AT+CGDCONT?
13:01:56.370 -> << +CGDCONT: 1,"IP","lpwa.telia.iot","*.*.*.*",0,0,0,0
13:01:56.404 -> << OK
13:01:56.404 -> >> AT+USOCR=17,16666
13:01:56.404 -> << +USOCR: 0
13:01:56.438 -> << OK
13:01:56.438 -> >> AT+UDCONF=1,1
13:01:56.438 -> << OK
13:01:56.438 -> >> AT+USOST=0,"CDP",REMOTE_PORT,24,"5374617274696E672C333536373236313038303133313337"
13:01:56.438 -> << +CME ERROR: Operation not allowed
13:01:56.505 -> Error: Could not send message

If there is anything more I can provide for identifying my problem, please let me know!

Thank you again!

1 Like

Hi @mmolder,

Thanks for sharing the log and good that you removed your sensitive info.

Did you get a valid IP address from the server?
I believe so since you replaced by ..., just want to confirm.

Is the CDP a URL of IP address?
I have seen issues that the URL could’t be resolved.

Can you add a delay to test if the modem isn’t ready yet although it should be ready?

Best regards,
Jan

Hi!

Yes I do get an IP to my APN, I just removed it from the post.

The CDP I use is indeed an URL, not an IP address.

After changing this and adding a small delay I was able to send messages :smiley: thank you so much for guiding me in the right direction!

Thanks for letting me know that adding a small delay fixed your issue.

Can you share the size of the used delay?

Best regards,
Jan

I just used 200ms which is a time I’ve used in other parts of my program when I need some delay between events. However I think that using the IP instead of the URL was what actually solved the problem.

1 Like