Hi, I just purchased NB-IoT shield deluxe SARA N211 using it for final year project. I couldn’t connect the shield with CT-UNO (Cytron). The LED on the shield is blinking for 5 times and off until I reconnect it back. And I also couldn’t pass the value from the shield using Serial pass-through coding. as shown below:
#include <SoftwareSerial.h>
SoftwareSerial NBIOT(8, 9); // RX | TX
// Connect the NBIOT TX to Arduino pin 2 RX.
// Connect the NBIOT RX to Arduino pin 3 TX.
char c = ‘A’;
void setup()
{
// start th serial communication with the host computer
Serial.begin(19200);
while(!Serial);
Serial.println(“Arduino with NBIOT is ready”);
// start communication with the NBIOT in 9600
NBIOT.begin(57600);
Serial.println("NBIOT started at 9600");
delay(1000);
Serial.println("Setup Complete! NBIOT is Ready!");
}
void loop()
{
// Keep reading from NBIOT and send to Arduino Serial Monitor
if (NBIOT.available())
{ c = NBIOT.read();
Serial.write(c);}
// Keep reading from Arduino Serial Monitor and send to NBIOT
if (Serial.available())
{ c = Serial.read();
NBIOT.write(c);
}
}
Hence, can I know how can we ensure the NB-IoT shield and CT-UNO is connected so I can use AT command?
A few ideas (with regards to the passthrough sketch):
- You will need to set D7 to OUTPUT, HIGH to enable the Sara module.
- Ensure you are sending the CR/LF line endings.
- Try swapping the RX/TX pins. As per your comments, UART pins should be connected RX->TX and TX->RX. However, the labeling might be the issue.
- In the code above, you are opening the NBIOT software serial at 57600, try using the library default of 9600 (though the N211 should really work with 57600 via autobauding).
If you are using software serial, I assume that the shield is not connected directly to the top of the CT-UNO. You may want to check that you have connected all the required lines (e.g. most of the components run off of the 3.3v line).
http://support.sodaq.com/wp-content/uploads/2017/02/nb-iot_shield_rev3b_sch-1.pdf
Okay. Thanks for the info. Now I’m using the code as follows to test AT commands:
#include <Sodaq_AT_Device.h>
#include <Sodaq_nbIOT.h>
#include <Sodaq_OnOffBee.h>
#include “Arduino.h”
#if defined(AVR_ATmega328P)
#define SerialOut Serial
#define UBLOX Serial
//#elif defined(ARDUINO_SODAQ_EXPLORER)
//#define SerialOut SerialUSB
//#define UBLOX Serial
//#elif defined(ARDUINO_SAM_ZERO)
//#define SerialOut SerialUSB
//#define UBLOX Serial1
#else
#error “Please select a Sodaq ExpLoRer, Arduino Leonardo or add your board.”
#endif
// Pin to turn on/off the nb-iot module
#define powerPin 7
void setup()
{
// Turn the nb-iot module on
pinMode(powerPin, OUTPUT);
digitalWrite(powerPin, HIGH);
// Start communication
SerialOut.begin(9600);
UBLOX.begin(57600);
}
// Forward every message to the other serial
void loop()
{
while (SerialOut.available())
{
uint8_t c = SerialOut.read();
SerialOut.write©;
UBLOX.write©;
//Serial.println(“Connected”);
}
while (UBLOX.available())
{
SerialOut.write(UBLOX.read());
//Serial.println(“Connected”);
}
}
But seems that I got the error:
Initializing and connecting… AT
AT
AT+CFUN=0
AT+NCONFIG?
AT+NRB
AT
AT
AT
AT
AT
AT
AT
AT
AT+CGDCONT=1,“IP”,“my3g”
AT+NCDP=10.35.5.11
AT+NSMI=0
AT+NNMI=0
AT+CFUN=1
AT+COPS=1,2,""
Failed to connect!
AT+CGATT?
- Is it UMobile from Malaysia supports this module?
- How to rectify the problem?