Modem not responding?

Finally got the time to play with the NB-IOT shield.

Starting to get famillair with it. Using a UNO and the HTS221 sketch.
After some testing i got the oceanconnect.t-mobile.nl , 172.16.14.20 and 20416 on the modem serial.
On the debug serial i got the “connected succesfully”.
I thought that’s a start !

But wait …
Started to rewrite the sketch since i had no sensor attached.
Just trying to send zero’s.
But after uploading my sketch the modem was not responding anymore.
On modem serial only ATAT AT and no response from modem, resulting in a dreadfull “Failed to connect!” on the debug serial.

Tried everything to get a succes back with no luck.

Who can help me with this one?

Did you remove the shield before uploading a new sketch?

Yes i did. I know of the shared serial connection. Disconnected the shield every time i programmed the UNO.

Leonardo with native USB programming interface works for Sodaq NBIOT shield.

https://learn.sparkfun.com/tutorials/arduino-comparison-guide

Do you send a carriage return and linefeed, \r\n ,after the AT commands?

Here is a simple example to send a String:

#include <Arduino.h>
#include <Wire.h>
// #include <SoftwareSerial.h> // Uno
#include <Sodaq_nbIOT.h>

#if defined(ARDUINO_AVR_LEONARDO)
#define DEBUG_STREAM Serial 
#define MODEM_STREAM Serial1

#elif defined(ARDUINO_AVR_UNO)
SoftwareSerial softSerial(10, 11); // RX, TX
// You can connect an uartsbee or other board (e.g. 2nd Uno) to connect the softserial.
#define DEBUG_STREAM softSerial 
#define MODEM_STREAM Serial

#elif defined(ARDUINO_SODAQ_EXPLORER)
#define DEBUG_STREAM SerialUSB
#define MODEM_STREAM Serial

#elif defined(ARDUINO_SAM_ZERO)
#define DEBUG_STREAM SerialUSB
#define MODEM_STREAM Serial1

#else
#error "Please select a Sodaq ExpLoRer, Arduino Leonardo or add your board."
#endif

Sodaq_nbIOT nbiot;

void setup() 
{
	delay(500);
	DEBUG_STREAM.begin(9600);
  MODEM_STREAM.begin(nbiot.getDefaultBaudrate());
  
  //while ((!DEBUG_STREAM));// Wait for serial monitor
	
	DEBUG_STREAM.println("\r\nSODAQ NB-IoT Hello World Arduino Example\r\n");

  nbiot.init(MODEM_STREAM, 7);
  nbiot.setDiag(DEBUG_STREAM);

  delay(2000);

  if (nbiot.connect("oceanconnect.t-mobile.nl", "172.16.14.20", "20416")) {
      DEBUG_STREAM.println("Connected succesfully!");
  }
  else {
      DEBUG_STREAM.println("Failed to connect!");
      return;
  }
}


void loop() 
{
  // Create the message
  String message = "Hello world!!";

  // Print the message we want to send
  DEBUG_STREAM.println(message);

  // Send the message
  nbiot.sendMessage(message);

  // Wait some time between messages
	delay(10000); // 1000 = 1 sec
}

Finally got the time to free up my Leonardo from another project.

Tried the AT command passthrough program -> failed !
Tried the “Hello world” example from Jan (above this post) -> Geronimo !

I stick to the Leonardo for now.
Suspect that the modem for some reason does not like to connect to the UNO / software combination.

Thank you all for the replies.

After digging through the used code i found the reason:
I used hardcoded speed for the ublox serial connection:

MODEM_STREAM.begin(9600);

The code that worked contains this serial speed config:

`MODEM_STREAM.begin(nbiot.getDefaultBaudrate());`