Which library to use with the Ubee based on ublox sara R410m

Hi,
I recently bought a Ubee based on the Ublox Sara R410m. is there a specific library to use with this device. I also have a an older Ubee based on Ublox Sara U201 - for this i used the sodaq_3gbee library - what should i be using with the Sara R410?

Any help is much appreciated.

Cheers.

Hi @katesfb,

For the ublox R410M and R412M you need the Sodaq_R4X library.

I have updated the support page.
Let me know if you need more information or if some things are not clear.

Best regards,
Jan

Hi Jan,
Thanks for the reply.

When the unit powers up should the green light come on immediately or is there a fairly long delay. i am having an issue where the R410 doesn’t seem to power up occasionally. i have been using the pass-through sketch on the support page for testing and using an autonomo board, if it does power up (green light comes on after about 20 - 30 secs and stays on) then i can communicate with it sending various AT commands etc. However sometimes it will simply not power up at all (green light does not come on at all) then obviously i cant communicate with it.

What should be the behavior of the R410/LED on power up?

Should the passthrough sketch require the library?

Any help is much appreciated.

Cheers.

Hi @katesfb,

I know the passthrough for the R410M isn’t perfect.
The problem is most likely the toggle pin.
We assume the module is off, we toggle the pin to turn it on, however when the module is on, the toggle pin will turn the module off.

We are currently making adjustments in the R4X library.
I will have made a note that we should also update the passthrough sketch to handle the on/off better when the library is released.

Best regards,
Jan

Hi Jan,
i have a query regarding the examples that come with the Sodaq_R4X library - specifically the http_test example. I cannot seem to get this to work. i have changed “CURRENT_APN “data.mono”” to the apn of our supplier which has no effect. Is CURRENT_URAT “7” important, i tried both 7 and 8 (these seem to be the only two options) both did not change anything. I s this issue also related to the toggle pin?

The output after i run the example sketch is as follows:
Booting up…
Network connection failed (after about 10s)
Setup done

If i then attempt to enter AT commands in the console, these commands are echoed but there is no response from the modem.

Any help with this is much appreciated.

Cheers.

Hi,

Line 56, If you pass a third parameter “1” does it work ?

isReady = r4x.connect(CURRENT_APN, CURRENT_URAT, 1);

It is necessary to pass the profile MNO it seems to me with the new firmware.

Hi Pogprop, and thanks for the reply. Adding “1” as third parameter had no effect - this fails to get a network connection.

The following code works in terms of being able to communicate with the modem via AT commands and gets around the toggle pin issue (see above);

#include <Sodaq_R4X.h>

/* Create an r410 object */
Sodaq_R4X R410;

#define ser   SerialUSB
#define modem    Serial1
#define powerPin BEE_VCC
#define enablePin BEEDTR
#define powerTogglePin BEERTS

int togglePinState = 0;

#define APN      "internet"
#define URAT     "8"
#define HTTP_HOST        "time.sodaq.net"
#define HTTP_PORT        80
#define HTTP_QUERY       "/"
#define LED LED_BUILTIN
char buffer[80];
bool isReady;

void setup() {
  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH );

  pinMode(powerPin, OUTPUT); 
  digitalWrite(powerPin, HIGH);

  pinMode(enablePin, OUTPUT);
  digitalWrite(enablePin, HIGH);

  pinMode(powerTogglePin, OUTPUT);
  togglePinState = digitalRead(powerTogglePin);
  if (togglePinState == HIGH) {digitalWrite(powerTogglePin, LOW);} 

  ser.begin(115200);
  
  while ((!ser) && (millis() < 10000)) {
    digitalWrite(LED, HIGH );
    delay(30);
    digitalWrite(LED, LOW);
    delay(500);
  }
    
  ser.println("Starting...");

  modem.begin(115200);
  R410.setDiag(ser);
  ser.println("40s delay");
  delay(40000); //wait for unit to register on network
  
  ser.println("try to connect");
  //isReady = R410.connect(APN);
  //isReady = R410.connect(APN, "8", "1");
  //ser.println(isReady);
  //ser.println(isReady ? "Network connected" : "Network connection failed");

  //ser.println("Setup done");

void loop() {
    if (ser.available()) {
        int i = ser.read();
        modem.write(i);
    }

    if (modem.available()) {
        ser.write(modem.read());
    }
}

However if i un-comment the commented out code to connect to the network, it hangs and i have to reset the autonomo. It also seems to take a very long time (~30s) to gain network registration i.e get successful responses to ‘AT+CREG?’ and ‘AT+CSQ’ etc - is this normal? The Ubee based on the ublox Sara U201 that i have is much quicker. If i wait for network registration to occur before attempting to connect to the network (see 40s delay in code above) then it still hangs.

Any help with this is much appreciated.

Cheers.

HI,
I have done some more work on this and it seems that the ublox Sara R410 is fully functional but only when using AT commands directly for example i can send sms messages and it looks like FTP will work but only using direct AT commands however most of the library methods don’t seem to work so is it possible that i have not created an R410 object correctly so is the following correct?

#include <Sodaq_R4X.h>

/* Create an r410 object */
Sodaq_R4X R410;

Will this allow me to use all the library methods? If not is there a better way?

i also still have an issue with the time it takes to gain initial network registration which currently takes about 30 seconds - can you confirm whether this amount of time is typical for the R410.

Is an upgrade to the library going to released any time soon and will this fix the issues i have indicated or would a firmware upgrade help? i think current firmware is L0.0.00.00.05.06,A.02.00.

Has anybody else used this module and managed to get it to work correctly?

Any help is much appreciated.

Cheers.

Hi,
So has anybody had any success using the Ubee r410m (or any of the other boards that make use of the R410) with the library. Currently the library doesn’t seem to work!

Any further thoughts on this is much appreciated.

Cheers.

Hi @katesfb,

Soon we will release a new version of the R4X library.
For this new version it’s recommended to update the firmware also on the ublox module.
Combined with new firmware/ new library the connection will be a bit quicker because profiles will be used.

Best regards,
Jan

Hi jan,
We have upgraded the library to the latest version 2.02 but the examples that come with the library still do not work. We are running with the Ubee connected to an autonomo.

The version number for the R410 on the Ubee seems to be L0.0.00.00.05.06,A.02.00 which may be out of date however the easy flash utility seems to be no longer available on the Ublox website. So at the moment we do not have a Ubee that works - would it be better to get a refund for the current Ubee and buy another Ubee with the updated firmware.

Below output from the device using standard AT commands and then attempting to run the HTTP_test example with a 40s delay at the beginning to allow time for a connection to the network to be made.

Any help is much appreciated.

Running a script to send AT commands to the modem and get responses:
Starting…
40s delay

AT

OK
AT+CSQ

+CSQ: 17,99

OK
AT+CREG?

+CREG: 0,1

OK
AT+CGATT?

+CGATT: 1

OK
AT+CGSN

352753096577307

OK
ATI9

L0.0.00.00.05.06,A.02.00

OK
AT+CGMR

L0.0.00.00.05.06 [Feb 03 2018 13:00:41]

OK
AT+CGMI

u-blox

OK
AT+CGMM

SARA-R410M-02B

OK
AT+CCID

+CCID: 8964050021934479019

OK
AT+CCLK?

+CCLK: “19/12/08,23:10:43”

OK
AT+CPIN?

+CPIN: READY

OK
AT+COPS?

+COPS: 0,0,“Spark NZ Spark NZ”,8

OK
AT+URAT?

+URAT: 7,8

OK
AT+CGDCONT?

+CGDCONT: 1,“IP”,“internet”,“100.70.156.10”,0,0,0,0

OK
AT+CGDCONT=1,“IP”,“internet”

OK
AT+CMGF=1

OK
AT+CMGS="+64226702483"

Hello World

+CMGS: 20

OK

Attempting to run the http_test example from the library:
40s delay
…Network connection failed
Setup done

Hi @katesfb,

It could be that for the old firmware you probably need to use profile ‘0’.
Let me know if this works for you.

Best regards,
Jan

hi Jan,
Thanks for the reply.

I have a custom setup for the operator which is currently:

#elif defined(CUSTOM)
#define CURRENT_APN      "internet"
#define CURRENT_OPERATOR AUTOMATIC_OPERATOR
#define CURRENT_URAT     SODAQ_R4X_LTEM_URAT
#define CURRENT_MNO_PROFILE MNOProfiles::SIM_ICCID

So i assume this should be changed to:

    #elif defined(CUSTOM)
    #define CURRENT_APN      "internet"
    #define CURRENT_OPERATOR AUTOMATIC_OPERATOR
    #define CURRENT_URAT     SODAQ_R4X_LTEM_URAT
    #define CURRENT_MNO_PROFILE   0

Also previously i had to put in a 40s delay in a sketch as it seemed to take that long for everything to setup before i could use it. Is this delay still required.

Any help is much appreciated.

Cheers.