Sending AT commands to BG96

Issue: Having issues sending commands to BG96.

Setup: RAK5010 with Arduino IDE

Details:I have used Arduino IDE to flash the firmware for the basic tests of sensors and GPS. However, I feel that my network is not being connected. I would like to check by sending AT commands to the BG96 to check this. However, when I open a serial tool, I get the sensor status similar to what the Arduino IDE serial is showing me. Doesnt allow me to send any AT commands. Is there any way I can set this to debug mode to comms with BG96 directly? Even Putty and other serial tools have no response to basic “AT” command.

Hi, do you run the demo code? It will automatically send AT command to bg96 to get the version and gps. If you want to send at directly to bg96 via USB, it is not supported. You could do the unvarnished transmission to get this goal.

Hi Nero,

Thanks for the response. Yes, I run the demo mode. Can I know the meaning of doing an unvarnished transmission? For my setup, I’m using a nbiot sim which is currently used in my other board (using Quectel BC66). Are there any settings we need to set for the BG96 modem? This is the log from my RAK.

Check Network Status
RDY
AT+CREG?
+CREG: 0,0

OK

AT+QCFG=”band”,0,4,80,1
ERROR

AT+QCFG=”nwscanseq”,030303,1
ERROR

AT+QCFG=”nwscanmode”,3,1
ERROR

AT+QCFG=”iotopmode”,1,1
ERROR

AT+CGDCONT=1,”IP”,”STMIOT”
ERROR

AT+CTZU=1
OK

Sending SMS NowAT+CMGF=1
OK

AT+CSCS=“GSM”
OK

AT+CMGS=“09058382987”

Device Initialized!

+CMS ERROR: 500
ATI
Quectel
BG96
Revision: BG96MAR02A07M

Unvarnished transmission means you can send AT to bg96 directly by USB. The demo code not supports now. So you need add this part. But it seems like your problem is the network? So what do you want to realize? Send AT or net work problem? Below is an example for unvarnished transmission on BG77, but it is worth to refer:
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial)
delay(10);
Serial.println(“BG77 AT CMD TEST!”);
// Check if the modem is already awake
time_t timeout = millis();
bool moduleSleeps = true;
Serial1.begin(115200);
delay(1000);
Serial1.println(“ATI”);
//BG77 init
while ((millis() - timeout) < 4000)
{
if (Serial1.available())
{
String result = Serial1.readString();
Serial.println(“Modem response after start:”);
Serial.println(result);
moduleSleeps = false;
}
}
if (moduleSleeps)
{
// Module slept, wake it up
pinMode(BG77_POWER_KEY, OUTPUT);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
digitalWrite(BG77_POWER_KEY, 1);
delay(2000);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
}
Serial.println(“BG77 power up!”);
}

void loop()
{
int timeout = 100;
String resp = “”;
String snd = “”;
char cArr[128] = {0};
while (timeout–)
{
if (Serial1.available() > 0)
{
resp += char(Serial1.read());
}
if (Serial.available() > 0)
{
snd += char(Serial.read());
}
delay(1);
}
if (resp.length() > 0)
{
Serial.print(resp);
}
if (snd.length() > 0)
{
memset(cArr, 0, 128);
snd.toCharArray(cArr, snd.length() + 1);
Serial1.write(cArr);
delay(10);
}
resp = “”;
snd = “”;
}

Hi Nero,

Oh, you mean transmission using firmware coding. I am using this method as a temporary solution. I managed to get my connectivity resolved by following one of the threads which needed me to send an AT command (AT+QRFTESTMODE=1). After which my module registered to my local network with AT+CREG 0,1. Log is shown below

AT+QRFTESTMODE=0

OK

AT+CREG?

+CREG: 0,1

OK, I see. About this part, my colleague will help.@zhangtao
He knows many country network command.

Hi Nero,

No problem. My problem was resolved. Now still not able to connect to my GPS. I have already started another thread on that. We can close this.

1 Like