Getting Sara-R410M to connect to MQTT server via vodafone

Hello NB-IoT fellows,

I would like to collect environmental sensor data and send it via NB-IoT and the vodafone network in Germany to an MQTT server. I have purchased the Arduino board ‘MKR NB 1500’:
https://store.arduino.cc/arduino-mkr-nb-1500

That is equipped with a Sara-R410M module:

So far, I have accomplished following progress:
The device successfully connects to the internet and is able to send UDP packets. However, it fails to connect via HTTP or MQTT!

I am using the standard code example from Arduino:

/*

SerialSARAPassthrough sketch

This sketch allows you to send AT commands from the USB CDC serial port
of the MKR NB 1500 board to the onboard ublox SARA-R410 celluar module.

For a list of supported AT commands see:
https://www.u-blox.com/sites/default/files/u-blox-CEL_ATCommands_(UBX-13002752).pdf

Circuit:

  • MKR NB 1500 board
  • Antenna
  • 1500 mAh or higher lipo battery connected
  • SIM card

Make sure the Serial Monitor’s line ending is set to “Both NL and CR”

create 11 December 2017
Sandeep Mistry
*/

// baud rate used for both Serial ports
unsigned long baud = 115200;

void setup() {
// enable the POW_ON pin
pinMode(SARA_PWR_ON, OUTPUT);
digitalWrite(SARA_PWR_ON, HIGH);

// reset the ublox module
pinMode(SARA_RESETN, OUTPUT);
digitalWrite(SARA_RESETN, HIGH);
delay(100);
digitalWrite(SARA_RESETN, LOW);

Serial.begin(baud);
SerialSARA.begin(baud);
}

void loop() {
if (Serial.available()) {
SerialSARA.write(Serial.read());
}

if (SerialSARA.available()) {
Serial.write(SerialSARA.read());
}
}

along with the AT commands provided in the datasheet:

// connecting to Vodafone
AT
17:02:31.643 -> OK
AT+URAT=8
17:02:50.328 -> OK
AT+CGDCONT=1,"IP","nb.inetd.gdsp"
17:04:18.603 -> OK
AT+COPS=1,2,"26202"
17:04:41.152 -> OK
//MQTT
AT+UMQTT=0,"352753090071689"
17:12:42.941 -> +UMQTT: 0,1
17:12:42.941 -> 
17:12:42.941 -> OK
AT+UMQTT=1,1883
17:13:05.804 -> +UMQTT: 1,1
17:13:05.804 -> 
17:13:05.804 -> OK
AT+UMQTT=2, "www.farmer.cloudmqtt.com",16806
17:14:00.439 -> +UMQTT: 2,1
17:14:00.439 -> 
17:14:00.439 -> OK
AT+UMQTT=4,"KEY","KEY"
17:14:58.856 -> +UMQTT: 4,1
17:14:58.856 -> 
17:14:58.856 -> OK
AT+UMQTTC=1 

As MQTT cloud service, I am using farmers cloud for testing. Currently I’m stuck with seeing no data arrive at the cloud. The sim cards are connected, according to the vodafone m2m portal.

Thank you for your help!

Hi,

Since you bought the board from Arduino, it’s maybe better to use also the Arduino forum.

This support page is for the SODAQ, Arduino compatible boards.
With our board you not only get a microcontroller and a communication ship, you will get a lot of on-board sensors too.
See https://shop.sodaq.com/ and https://support.sodaq.com/

It looks like you are looking for the R4 command reference:


Hope this helps and you get your data in the cloud!

Best regards,
Jan