arduino - SIM7600CE - 如何通过软件知道SIM卡何时注册到网络
问题描述
我正在尝试设置 SIM7600CE,以便在我使用 Arduino Mega 打开它时让它连接到互联网。我知道如何通过软件将 D12 引脚设置为高电平来打开它,但我不知道如何读取 NETLIGHT 引脚的信号以了解 NETLIGHT 何时开始闪烁,这意味着 SIM 卡已注册到网络成功。有什么办法可以读取该信号吗?或者有没有其他方法可以确认SIM卡通过软件成功注册到网络时?
编辑:我正在尝试使用 AT 命令获取我的 SIM7600 已连接的信息。即使我可以发送 AT 命令,我也无法解析响应。下面代码的结果证明 Serial 不断地打印字符串“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;
}
}
}
解决方案
查看调制解调器的 AT 手册。启用与网络注册相关的所有 URC,一旦在网络上注册 - 您将收到一个 URC,其中包含您的 SIM 卡是否能够在网络上注册的信息。
推荐阅读
- group-by - SPARQL MAX():我可以访问不在 GROUP BY 投影中的变量吗?
- javascript - 使用 JavaScript 获取 Chrome 控制台的内容
- node.js - 为什么Node Js mongoose文档删除不等待不执行?
- javascript - “必须包含此范围之外的字符”的正则表达式?
- javascript - 如何解决 NPM 安装错误 gyp ERR
- versioning - Quorum Vs Versioning,我什么时候应该使用什么?
- scala - 如何在 sbt 中重用现有任务但设置不同
- amazon-s3 - 如何将包含授权所有者的模拟数据添加到 Amplify(通过 GraphiQL 或直接添加到 AppSync)?
- android - 为什么 Kotlin 中函数式接口的目的是?
- r - 计算函数输出的均值和方差