我试图设置SIM7600CE,让它连接到互联网,每当我打开它与阿迪诺梅加。我知道如何通过设置引脚D12来打开它,但是我不知道如何读取网卡的信号才能知道网卡何时开始闪烁,这意味着SIM卡已成功注册到网络中。我能读懂那个信号吗?或者,当SIM卡通过软件成功注册到网络时,是否还有其他方法可以确认?
编辑:我正在尝试通过使用AT命令获取我的SIM7600连接的信息。即使我可以发送AT命令,也不能解析响应。下面代码的结果是,串行不断地打印字符串"at+csq“。有人能帮忙吗?
#define mySerial Serial1
#define PWRKEY 12
void setup()
{
digitalWrite(PWRKEY, HIGH); //Press the boot button
Serial.begin(115200);
delay(500);
mySerial.begin(115200);
delay(5000);
while (1)
{
Serial.println("AT+CSQ"); //AT command for Signal quality test
updateSerial();
delay(1500);
}
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());
}
while (mySerial.available())
{
Serial.write(mySerial.read());
if (Serial.find("+CSQ: ")) //Find the AT+CSQ response
{
char c = mySerial.read();
if (c != '9') //check the first digit after "+CSQ: ", +CSQ: 99,99 means not detectable,
{
Serial.println("connected");
break;
}
}
}发布于 2020-10-20 06:41:48
我用同样的逻辑解决了这个问题。但是,我尝试只在SIM7600系列中进行读写,并在监视器上进行一些打印以指导/调试。此外,我还使用了连接标志作为条件,在连接调制解调器时中断while循环。
#define mySerial Serial1
#define PWRKEY 12
bool connectionFlag = 0; //will be set when connected
void setup()
{
digitalWrite(PWRKEY, HIGH); //Press the boot button
Serial.begin(115200);
delay(500);
mySerial.begin(115200);
delay(5000); //Give it a little time to initialize
while (1)
{
mySerial.println("AT+CSQ"); //AT command for Signal quality test
connectionCheck();
if (connectionFlag ==1) break;
delay(1500);
}
Serial.println("done");
mySerial.println("AT+CSQ"); //Get the CSQ response to confirm.
updateSerial();
}
void loop()
{
updateSerial();
}
void connectionCheck()
{
delay(500);
while (mySerial.available())
{
// Serial.write(mySerial.read());
if (mySerial.find("+CSQ: ")) //Find the AT+CSQ response
{
Serial.print("initializing\t");
char c = mySerial.read();
if (c != '9') //check the first digit after "+CSQ: ", +CSQ: 99,99 means not detectable,
{
Serial.println("connected");
connectionFlag = 1;
break;
}
}
}
}
void updateSerial()
{
delay(500);
if (mySerial.available())
{
Serial.write(mySerial.read());
}
if (Serial.available())
{
mySerial.write(Serial.read());
}
}https://stackoverflow.com/questions/63825656
复制相似问题