Hello!
Problem: struggling with UART, Arduino Uno & the BC660K-GL dev board.
Please, help me better understand what steps I could try to get basic AT communication established using an Arduino Uno, if possible.
Problem introduction in brief:
Using QCOM or QNavigator I am able to test and develop various AT command sequences: everything works fine. But I cant seem to replicate the same behavior using direct UART from a connected Arduino Uno board.
The documentation (Quectel_BC660K-GL-TE-B_User_Guide_V1.0, assuming similar enough) mentions interfacing a STM Nucleo64 and that the dev board supports a default 115200 baud for AT commands via UART Serial comms.
The conclusion was to try and use the SoftwareSerial library from Arduino IDE to send AT commands thru serial monitor and progressively build a viable prototype through this process.
Device/Test setup:
The BC660K-GL dev board is mounted and installed into the pins header of the Arduino Uno Board.
When uploading to the Arduino, I toggle the J302 switch from
MAIN UART TO MCU
to
MAIN UART TO USB
… otherwise the upload is stuck in a loop and eventually times out. Before opening the Serial monitor in the Arduino IDE, afterwards confirming that the switch had been toggled back to “MAIN UART TO MCU” mode.
The system is powered from the Arduino USB alone.
Behavior description:
This is an example of what is output to the serial monitor:
E⸮ROR
⸮⸮ERROR⸮⸮
kKPMN:⸮REA⸮Vc⸮
+CEREG: 2
M
ESVOR
Q*⸮Jդ⸮
MRROR
⸮
ERROR⸮
ERrOR
M
G^VOR
The serial monitor is set to
No line ending , 115200 baud
In the output there is structure in the reply, similar to one seen both in QCOM / QNavigator testing.
However, the characters are seemingly misread or gibberish is received/sent, which would usually lead to questioning if the baud rates are correctly assigned.
Arduino script in use:
The script with which the above output was received.
The intended behavior was to read what the dev board is sending and display it in the serial monitor.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(1, 0); // RX, TX
String sending;
String receiving;
void atcommand(const String _atcommand) { //WIP
Serial.print("== ");
Serial.print(_atcommand);
mySerial.print(_atcommand);
delay(1000);
while (mySerial.available())
Serial.write(mySerial.read());
};
void setup() {
Serial.begin(115200); // Open serial comms, wait for port to open...
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
delay(500);
//Serial.println("- - - UART AT COMMAND PROMPT DEMO - - -");
mySerial.begin(115200); // set the data rate for the SoftwareSerial port
delay(500);
//mySerial.println("AT");
//atcommand("AT\r\n");
//atcommand("AT+IPR=9600\r\n"); // to change baud rates...
//atcommand("AT\r\n");
}
void loop() {
//delay(500);
/*if (mySerial.available() > 0) { // Keep reading from BC660K and send to Arduino Serial Monitor
receiving = mySerial.readStringUntil('\n');
Serial.println(receiving);
}*/
if (Serial.available() > 0) { // Keep reading from Arduino Serial Monitor and send to BC660K
sending = Serial.readStringUntil('\n');
//mySerial.println(sending);
Serial.println(sending);
}
//delay(500);
//atcommand("AT\r\n");
}
In researching these issues, this library was useful as an example implementation…
M2M_Quectel (github)
Current understanding is some key bit of information may be lacking. Both devices work flawlessly independently.