Here's the problem: the module does not respond to anything when switching to AT-command mode, only the LED flashes once every 2 seconds (it seems like it should be, so it's in AT-command reception mode), but I'm very bad at Arduino, so I found code on the Internet that allegedly allows you to control the module using AT commands: //The beginning of the sketch
#include <SoftwareSerial.h> // name password speed CMODE get address write address role //request AT+NAME? AT + PSWD? AT + UART? AT + CMODE? AT + ADDR? AT + BIND? AT + ROLE? //answer option +NAME:SLAVE +PIN:"1234" +UART:9600,0,0 +CMODE:1 AT+BIND=18,E4,400006 +ROLE:0 //for slave | AT+NAME=SLAVE AT+PSWD="1234" AT+UART=9600,0,0 AT+CMODE=1 +ADDR:18:E4:400006 AT+ROLE=0 //for master | AT+NAME=MASTER AT+PSWD="1234" AT+UART=9600,0,0 AT+CMODE=0 AT+BIND=18,E4,400006 AT+ROLE=1
//resetting the AT+ORGL settings is an extreme case if you messed up something with the settings and can't find a way to fix it
const int arduino_rx = 5; const int arduino_tx = 6; SoftwareSerial mySerial(arduino_rx, arduino_tx);
void setup() { pinMode(arduino_rx, INPUT); pinMode(arduino_tx, OUTPUT); Serial.begin(9600); mySerial.begin(38400); Serial.println("<<< Start! >>>"); mySerial.println("AT"); }
void loop() { if (mySerial.available()) { char c = mySerial.read(); Serial.print(c); } if (Serial.available()) { char c = Serial.read(); mySerial.write(c); } }
Everything turned out well for the person in the video, the module brought OK to the series, and everything is fine, but this does not happen for me, the start message is just displayed, the module does not respond to attempts to enter AT commands in any way. Does anyone know how to fix this, or at least how to get him out of this mode? Before that, the module seemed to work, but I could send a message from the arduino to the phone, but I need the opposite, that is, from the phone to the arduino, and now the module remains in this mode, and I can't use it at all.