首页 > 解决方案 > 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; 
      }
    }
  }

标签: arduinoiotgsm

解决方案


查看调制解调器的 AT 手册。启用与网络注册相关的所有 URC,一旦在网络上注册 - 您将收到一个 URC,其中包含您的 SIM 卡是否能够在网络上注册的信息。


推荐阅读