Issue:
We have some weird behavior with the communication with the BG96 modem.
Most of the times we get a strange set of charecters as response from the modem (sometimes also no response):
Setup:
- Board: RAK5010
- Dev-Setup: Visual-Studio-Code + Arduino
- I initialize like in your examples Serial & Serial1 with a baud-rate of 115200 (but also tried different baud-rates)
- I send at-commands like in the example https://github.com/RAKWireless/Arduino-on-Rak5010-/blob/master/Rak5010.ino#L40 with the timeout of https://github.com/RAKWireless/WisBlock/blob/master/examples/communications/Cellular/Cellular_Ping/Cellular_Ping.ino#L65.
- Debbuging through USB
- I also tried with and without additional power-supply (USB Charger 5V)
at command send:
void bg96_at(char *at, uint16_t timeout)
{
bg96_rsp="";
Serial.println("at command:");
Serial.println(at);
char tmp[256] = {0};
int len = strlen(at);
strncpy(tmp,at,len);
uint16_t t = timeout;
tmp[len]='\r';
Serial1.write(tmp);
delay(10);
while(t--)
{
if(Serial1.available())
{
Serial.print("+");
bg96_rsp += char(Serial1.read());
}
delay(1);
}
Serial.println("");
Serial.println(bg96_rsp);
}
Do you have any idea ?