oltzm
November 3, 2022, 11:13pm
1
So, I am a beginner with Arduino and this kind of coding. I have been running into issues with failed SMS messages and I know it's either because of the module or the network from the error code. Below I'll include info on my modem and all the AT commands I've used to troubleshoot issues.
Thanks for any help you can provide.
AT Command Returns:
+CREG? >> 0,5
+COPS? >> 1,0,"T-Mobile",7
+CPSI? >> LTE,Online,...,EUTRAN-BAND4,...
+CNSMOD? >> 0,8
+CSPN? >> "",0
+CSQ? >> 16,99
+CNETSTART >> 0
+CNETSTART? >> 2
AT Command Configs:
+CMGF? >> 1
+CSMP? >> 17,167,0,0
+CSMS? >> 0,1,1,1
+CNMI? >>2,2,0,0,0
Format in Serial Monitor (Baud: 115200):
AT+CMGS="+1XXXYYYZZZZ"
Hello World //Test message I used
1A //Command the example code uses to end the message input
+CMS ERROR: Unknown error
Module: SIM7600A-H
Modem: Maduino Zero 4G LTE
Manufacturer: Makersfab
Hardware wiki
SIM Card: IoT Turbo
Sketch: github sketch page
It’s hardto see the sequence around sending the message, because it’s been corrupted in your post.
Did you wait for the > prompt before sending the message ?
Post your code please - as requested by the forum guidelines.
oltzm
November 4, 2022, 3:06pm
3
Thanks for responding.
Yes, I did wait for the prompt before sending the "Hello World" input and the error message takes ~2 min to appear after the "1A" input.
// Description: input AT commands via serial monitor to learn how to use 4G module
// version:v1.0
// Author:Vincent
// web: http://www.makerfabs.com
// This version is modify for SIM7600
// If define MODE_1A
// When "1A" or "1A" is entered, 0x1A is sent to the module.
// When sending SNS information, you need to send 0x1A to end the input.
#include <stdio.h>
#include <string.h>
#define DEBUG true
#define MODE_1A
#define DTR_PIN 9
#define RI_PIN 8
#define LTE_PWRKEY_PIN 5
#define LTE_RESET_PIN 6
#define LTE_FLIGHT_PIN 7
String from_usb = "";
void setup()
{
SerialUSB.begin(115200);
//while (!SerialUSB)
{
; // wait for Arduino serial Monitor port to connect
}
delay(100);
Serial1.begin(115200);
//Serial1.begin(UART_BAUD, SERIAL_8N1, MODEM_RXD, MODEM_TXD);
pinMode(LTE_RESET_PIN, OUTPUT);
digitalWrite(LTE_RESET_PIN, LOW);
pinMode(LTE_PWRKEY_PIN, OUTPUT);
digitalWrite(LTE_RESET_PIN, LOW);
delay(100);
digitalWrite(LTE_PWRKEY_PIN, HIGH);
delay(2000);
digitalWrite(LTE_PWRKEY_PIN, LOW);
pinMode(LTE_FLIGHT_PIN, OUTPUT);
digitalWrite(LTE_FLIGHT_PIN, LOW); //Normal Mode
// digitalWrite(LTE_FLIGHT_PIN, HIGH);//Flight Mode
SerialUSB.println("Maduino Zero 4G Test Start!");
sendData("AT+CGMM", 3000, DEBUG);
}
void loop()
{
while (Serial1.available() > 0)
{
SerialUSB.write(Serial1.read());
yield();
}
while (SerialUSB.available() > 0)
{
#ifdef MODE_1A
int c = -1;
c = SerialUSB.read();
if (c != '\n' && c != '\r')
{
from_usb += (char)c;
}
else
{
if (!from_usb.equals(""))
{
sendData(from_usb, 0, DEBUG);
from_usb = "";
}
}
#else
Serial1.write(SerialUSB.read());
yield();
#endif
}
}
bool moduleStateCheck()
{
int i = 0;
bool moduleState = false;
for (i = 0; i < 5; i++)
{
String msg = String("");
msg = sendData("AT", 1000, DEBUG);
if (msg.indexOf("OK") >= 0)
{
SerialUSB.println("SIM7600 Module had turned on.");
moduleState = true;
return moduleState;
}
delay(1000);
}
return moduleState;
}
String sendData(String command, const int timeout, boolean debug)
{
String response = "";
if (command.equals("1A") || command.equals("1a"))
{
SerialUSB.println();
SerialUSB.println("Get a 1A, input a 0x1A");
//Serial1.write(0x1A);
Serial1.write(26);
Serial1.println();
return "";
}
else
{
Serial1.println(command);
}
long int time = millis();
while ((time + timeout) > millis())
{
while (Serial1.available())
{
char c = Serial1.read();
response += c;
}
}
if (debug)
{
SerialUSB.print(response);
}
return response;
}
system
Closed
May 3, 2023, 3:06pm
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.