Sara R410 nbiot-test example

Hi, got my Sara R410 module working through the Serial passtrough example. receiving data from the device on my callback url.
Next I hoped to try the using the Sodaq-NBiot library by using the nbIOT_test(_udp) examples. Compiles ok, use t-mobile settings and #debug.
The device seems unable to connect to the modem. Looked through the libaray and plenty of sara 4xx references, so I assume this should work right?

Before I dive deeper into the library, anyone having the same issue of even better, a solution? Probably doing something wrong!


The library is ready for the R410M.
The examples need to be updated.

There are three differences compared to the N2XX modules:
Baudrate, R4 = 115200
Power to module: SARA_R4XX_TOGGLE needs to be set low
AT commands, The AT commands are different. (These are in the library)

Kind regards,

The baudreate for R4 is in the library but never called, so to test I added/changed:

digitalWrite(  SARA_R4XX_TOGGLE, LOW);

Same result…

Initializing and connecting... 


I have put it on the list to update the examples to work with the R410M.
Hope they will be online before the end of next week.

Kind regards,

Hi Jan,

Trying the same code, having the same issue.

in your Sodaq_nbIOT.h file your writing:

// Returns the default baud rate of the modem.
// To be used when initializing the modem stream for the first time.

uint32_t getDefaultBaudrate() { return getSaraN2Baudrate(); };
uint32_t getSaraN2Baudrate() { return 9600; };
uint32_t getSaraR4Baudrate() { return 115200; };

Note: This will only return the N2 baudrate (9600) and not the R4 baudrate (115200)

Next in your Sodaq_nbIOT.cpp file your writing:

// Initializes the modem instance. Sets the modem stream and the on-off power pins.
void Sodaq_nbIOT::init(Stream& stream, int8_t onoffPin, int8_t txEnablePin, int8_t saraR4XXTogglePin)
debugPrintLn("[init] started.");

_isSaraR4XX = (saraR4XXTogglePin != -1);
if (_isSaraR4XX) {
    debugPrintLn("Enabling sara R4XX functionality");

initBuffer(); // safe to call multiple times


sodaq_nbIotOnOff.init(onoffPin, saraR4XXTogglePin);
_onoff = &sodaq_nbIotOnOff;



So here you have included the saraR4XXTogglePin variable when calling the init function from the application

e.g. nbiot.init(MODEM_STREAM, powerPin, enablePin, togglePin);

But I’m not getting the debug messages, how can I enable it?
Are the drivers getting compiled when downloading the sketch to the device?

Hope you can look into this matter soon!

Best regards.


Uncomment in Sodaq_nbIOT.cpp: //DEBUG

In the main code add

Kind regards,

Did you find time to update the examples yet? My device is kind of useless now, I would expect at least working examples for the stuff you sell!

I have tried to adapt the previous examples to the R410, but for some reason the ReadResponse function fails to read the responses from the AT commands (and from the “Serial Passthrough”, I know that the responses are there).
So, yes, updated examples would be appreciated. Even if only the “nbIOT_test_udp” example were updated, this would already be very helpful.

Thanks for releasing the 1.5.0 version with the updated examples.
It is working correctly with my operator (just had to include “#define R4XX” )

Thanks again!

1 Like

Kind of off-topic, but when are you planning on releasing a Library for the
SODAQ Sara (rev1) Arduino board (not the shield, the complete Arduino comp. board)?


It already released.
Did you update to the latest version?


Thank you very much for the reply…

I am afraid that I would be steering this thread off-topic, so please lets redirect here -->

Hi Jan,
Do these commands work on all SARA-R4/N4 NbIot series modems?

Hi @johnmina,

You can find the AT commands on this page:

Only two sketches in the library work with the R4 module.


Best regards,

1 Like