Hello Everybody,
I was trying to connect the Arduino UNO board with the GSM2Click board that has an Quectel M95 module embedded on.
Vcc=5V already set by the switch correctly.
I've made the following connection:
ARDUINO pin | GSM pin:
10 RX
11 TX
8 STA
7 PWK (always high)
The gsm2click board seems to be active because both the switch power and network are on (net led is blinking).
After do this I put the PWK=1 and wrote the following sketch:
#include <SoftwareSerial.h>
const int PWK= 7; // Analog output pin that the LED is attached to
const int STA= 8;
const int RX= 10;
const int TX= 11;
int STA_value;
//AT+IPR=9600 , poi dopo aver ricevuto ok mando anche AT&W, per il check mando AT+IPR?
SoftwareSerial mySerial(RX,TX); // RX, TX
void gsmOn() {
// Takes 30 seconds to complete
digitalWrite(PWK, HIGH); // turn the Phone on
}
void setup() {
// initialize the digital pin as an output.
pinMode(PWK, OUTPUT); // questo pin serve per accendere il dispositivo GSM
pinMode(STA, INPUT);
pinMode(RX,INPUT);
pinMode(TX,OUTPUT);
gsmOn();
Serial.begin(9600); //Init seriale sw
delay(10);
mySerial.begin(9600); //init seriale hw
delay(100);
}
void loop()
{
sendCommand("AT");
readSerial();
delay(1000);
}
void sendCommand(char* msg)
{
mySerial.println(msg);
Serial.println(msg);
delay(1000);
}
void readSerial()
{
if (mySerial.available()>0)
{
//Serial.println("reading..");
Serial.println(mySerial.read());
delay(10);
}else
{
Serial.println("serial not available");
}
}
When I check the answer from the serial monitor I always get "0" after the AT and not OK.
What I'm missing ? Could anyone help?
Thanks a lot.
Marco