我有一个SIM800L模块。我已经配置了我的800L SIM卡模块,在这里我将LM2596上的OUT+连接到SIM800L上的VCC,并将OUT- on LM2596连接到SIM800L上的GND。除此之外,我连接TX SIM800L到引脚2Arduino和RX SIM800L到引脚3Arduino,然后,在源代码上传到Arduino mega 2560板后,SIM800L模块每3秒闪烁3次,有时也每3秒闪烁7次。等等。到目前为止,我的SIM800L模块不能发送消息。问题出在哪里?谢谢,请回答
发布于 2019-02-10 13:22:32
首先,您必须仔细检查调制解调器是否正确连接以及是否有足够的电源。为了确保我总是尝试在启动时读取调制解调器的输出序列并对其进行调用。如果调制解调器正确启动,它应该会在串行输出中打印一些数据(默认设置),其中一些会打印电源问题。
您可以使用以下示例在主机PC和调制解调器之间创建双向通信。在这里,我使用的是引脚为18、19的Serial1。如果我没记错的话,应该每隔3秒闪烁一次,如果它改变了,就意味着调制解调器正在重启。在此之后,您可以通过主机发送AT命令并检查功能。
#include <SoftwareSerial.h>
#define serialSIM800 Serial1
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//wait on host serial
while (!Serial);
//Being serial communication with Arduino and SIM800
// you should double check the default baudrate of SIM800 and set it here
serialSIM800.begin(9600);
delay(1000);
Serial.println(“Setup Complete !”);
}
void loop()
{
//Read SIM800 output (if available) and print it in Arduino IDE Serial Monitor
if (serialSIM800.available())
{
Serial.write(serialSIM800.read());
}
//Read Arduino IDE Serial Monitor inputs (if available) and send them to SIM800
if (Serial.available())
{
serialSIM800.write(Serial.read());
}
}https://stackoverflow.com/questions/54613417
复制相似问题