I am trying to send AT commands from my Arduino Uno to the ADH8066 GSM module I purchased from Sparkfun. I am looking for help in all categories (wiring and programming). If anyone has any experience I would appreciate any help.
Currently I have the TX pin of the Arduino connected to the RX0 pin on the ADH8066 and the RX pin of the Arduino to the TX0 pin of the ADH8066. I have the digital pin 13 on the Arduino connected to the ONKEY pin of the ADH8066 in order to power the GSM Module on. With my code I am not receiving any thing from the GSM Module.
#include <string.h>
#include <ctype.h>
int PWON = 13; // the pin to switch on the module (without press on button)
int rxPin = 0; // RX PIN
int txPin = 1; // TX TX
String inputString = "";
char inChar;
int inByte = 0;
void setup()
{
Serial.begin(115200);
inputString.reserve(200);
pinMode(PWON, OUTPUT); // sets the digital pin as output
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
PowerModuleOn();
delay(3000);
InitializeGSM();
}
void loop()
{
}
void PowerModuleOn()
{
digitalWrite(PWON, LOW); //Pull PWON low
delay(300); //Delay 300 ms
digitalWrite(PWON, HIGH); // Pull PWON high, Powers up GSM Module
}
void InitializeGSM()
{
Serial.write("AT");
Serial.write(0x0D); //carriage
delay(2000);
if(Serial.available() > 0)
{
Serial.println("Data Available");
//int inByte = Serial.read();
//Serial.println(inByte);
char c = (char) Serial.read();
inputString += c;
Serial.println(inputString);
}else{
Serial.println("No data coming from GSM Module");
}
delay(10000);
//Serial.print(0x0d,HEX);
Serial.println("AT+CPIN?");
Serial.print(0x0d);
if(Serial.available() > 0)
{
char c = (char) Serial.read();
inputString += c;
Serial.println(inputString);
}
}
Any help is appreciated.