A6 GPRS模块无线复位与短信配置AT命令可行性咨询
First, let's clear up the SMS configuration question you had:
Can use SMS to config module
This means exactly what it sounds like—you can send AT commands to the A6 module via SMS to configure it. The module is designed to parse incoming SMS messages as AT commands (some models might require you to first enable this feature with an initial AT command, likeAT+SMSCFG=1—check your module's manual for specifics). For example, you could send an SMS withAT+APN="your_network_apn"to set the module's APN, or adjust baud rates, network modes, and other settings directly via text message—no internet required.
1. Wireless Reset for A6 GPRS Module
There are two reliable, GSM-only ways to reset the A6 remotely:
Method 1: Send a Reset AT Command via SMS
The A6 module supports theAT+CFUN=1,1command, which triggers a full module reset (equivalent to a hardware power cycle). Just send an SMS containing this exact command to the SIM card number inserted in the A6.
Note: If the module doesn't respond, double-check that you've enabled SMS-to-AT parsing (using the command mentioned above) so it doesn't just store the SMS as plain text.Method 2: SMS-Controlled Hardware Reset (via Arduino)
If your A6 is wired to an Arduino, you can have the Arduino listen for a specific SMS command, then momentarily pull the A6's RST pin low to trigger a hardware reset. This is useful if the module becomes unresponsive to AT commands over SMS.
2. Arduino Wireless Reset (GSM-Only, No Internet)
To reset your Arduino remotely using only the GSM network, you'll use the A6 module to listen for a custom trigger SMS, then initiate an Arduino reset. Here's a step-by-step solution:
Hardware Setup
Connect the A6 to your Arduino (note: A6 uses 3.3V logic—use a level shifter if your Arduino is 5V to avoid damaging the module):
- A6 TX → Arduino RX (with level shifter if needed)
- A6 RX → Arduino TX (with level shifter if needed)
- A6 VCC → 5V/2A external power supply (A6 draws more current than Arduino's 5V pin can provide)
- A6 GND → Arduino GND
Code Implementation
This code uses SoftwareSerial to communicate with the A6, listens for a custom reset command, and uses the Arduino's watchdog timer to trigger a reset:
#include <SoftwareSerial.h> #include <avr/wdt.h> // Define software serial for GSM module SoftwareSerial gsmSerial(10, 11); // RX pin 10, TX pin 11 const String RESET_TRIGGER = "RESET_MY_ARDUINO"; // Custom SMS command to trigger reset void setup() { Serial.begin(9600); gsmSerial.begin(9600); // Initialize A6 module for SMS handling gsmSerial.println("AT+CMGF=1"); // Set SMS to text mode delay(1000); gsmSerial.println("AT+CNMI=2,2,0,0,0"); // Forward incoming SMS directly to serial delay(1000); Serial.println("Arduino ready: Send SMS with '" + RESET_TRIGGER + "' to reset."); } void loop() { if (gsmSerial.available()) { String incomingSMS = gsmSerial.readStringUntil('\n'); Serial.println("Received SMS: " + incomingSMS); // Check if SMS contains the reset trigger if (incomingSMS.indexOf(RESET_TRIGGER) != -1) { Serial.println("Reset command detected! Initiating Arduino reset..."); triggerReset(); } } } void triggerReset() { wdt_enable(WDTO_15MS); // Enable watchdog timer to reset after 15ms while(true); // Halt execution and wait for reset }
Code Notes:
- The watchdog timer is a built-in feature on most Arduino boards (like Uno, Nano) that resets the board if it doesn't get a "feed" signal within a set time. Here, we enable it with a 15ms timeout for an immediate reset.
- If your Arduino doesn't support the watchdog, wire a small relay between a digital pin and the Arduino's RESET pin. When the reset SMS is received, set the digital pin low to pull the RESET pin low and trigger a hardware reset.
内容的提问来源于stack exchange,提问作者kamrankamranifard

