General

TEL0051 does not work with a simple code

userHead pierrot10 2014-09-08 12:31:59 3042 Views3 Replies
Good evening.

I just received the TEL0051 shield and I I am using it with Arduino Uno and a 7.4V/2000mA battery (Li).

In order to test it, I simply upload that simple code to test an AT command and what happen in Serial.

S1 is in 'prog' position
S2 is on 'Arduino' position
S3 is in middle position
I left all jumper J10-11-12 as it is
Code: Select all
#include <SoftwareSerial.h>

int baud_rate = 9600;
int pin_gsm = 3;
int pin_gps = 4;
int pin_power = 5;
//int pin_dtr = 6;
//boolean debug = true;
//boolean raedy_to_go = false;

void setup()
{
  Serial.begin(baud_rate);
  
  pinMode(pin_gsm,OUTPUT);
  pinMode(pin_gps,OUTPUT);
  pinMode(pin_power,OUTPUT);
  
  digitalWrite(pin_power, HIGH);
  delay(3000);
  digitalWrite(pin_power, LOW);
  
  Serial.println(F("\nTurned on"));
  
  gsm_enable();
  

  
  Serial.println("AT");
}

void loop()
{

   if (Serial.available())
    {
      Serial.print("Character received: >>");
      Serial.write(Serial.read());
      Serial.println("<<");
    }
}

void gps_enable(void)
{
	digitalWrite(pin_gps,LOW);//Enable GPS mode
	digitalWrite(pin_gsm,HIGH);//Disable GSM mode
        
        Serial.println(F("GPS is enabled"));
        Serial.println(F("GSM is desable"));
}

void gsm_enable(void)
{
	digitalWrite(pin_gsm,LOW);//Enable GSM mode
  	digitalWrite(pin_gps,HIGH);//Disable GPS mode
  
  Serial.println(F("GSM is enabled"));
        Serial.println(F("GPS is desable"));
}

After sending the "AT" command, I should read, at least, an OK in my terminal.
Why nothing happen?
[img]http://www.hello-web.net/temp/1.JPG[/img]
[img]http://www.hello-web.net/temp/2.JPG[/img]
2014-09-11 10:30:41 Ok Grey,
Thank alot
userHeadPic pierrot10
2014-09-09 19:19:09 Yeah, module needs a little time to register SIM Card INF on the network.
And during sending AT command, it also needs a little delay.
userHeadPic Grey.CC
2014-09-08 21:27:51 I change a bit my code by adding delay, and it return interesting value
Code: Select all
#include <SoftwareSerial.h>
// # Steps:
// #        1. Turn the S1 switch to the Prog(right side)
// #        2. Turn the S2 switch to the Arduino side(left side)
// #        3. Set the UART select switch to middle one.
// #        4. Upload the sketch to the Arduino board
// #        5. Turn the S1 switch to the comm(left side)
// #        6. RST the board
 
// #        If you get 'inf' values, go outdoors and wait until it is connected.
// #        wiki link- https://www.dfrobot.com/wiki/index.php/GPS/GPRS/GSM_Module_V3.0_(SKU:TEL0051)


//#define HWREAD;

int baud_rate = 9600;
int pin_gsm = 3;
int pin_gps = 4;
int pin_power = 5;
//int pin_dtr = 6;
boolean debug = true;
//boolean raedy_to_go = false;

void setup()
{
  Serial.begin(baud_rate);
  delay(5000);                         // Wait for 5sec after begin
  
  if(debug)
  {
    Serial.println(F("\n****************"));
    Serial.println(F("STARTING SYSTEM"));
    Serial.println(F("****************"));
    Serial.println(F("Setting pinMode"));
  }
  pinMode(pin_gsm,OUTPUT);            // Set the pins
  pinMode(pin_gps,OUTPUT);
  pinMode(pin_power,OUTPUT);
  
  if(debug)
  {
    Serial.println(F("Powering the module"));
  }
  digitalWrite(pin_power, HIGH);      // Power the module
  delay(1500);
  digitalWrite(pin_power, LOW);
  
  gsm_enable();
 
  Serial.println("AT");
  
  if(debug)
  {
    Serial.println(F("READY TO GO"));
  }
  
}

void loop()
{
  #ifdef HWREAD
    serialhwread();
  #endif
  
   if (Serial.available())
    {
      Serial.print("Character received: ");
      Serial.write(Serial.read());
      Serial.println("");
    }
    
}


void gps_enable(void)
{
  if(debug)
  {
    Serial.println(F("Enabling GPS"));
  }
  digitalWrite(pin_gps,LOW);//Enable GPS mode
  digitalWrite(pin_gsm,HIGH);//Disable GSM mode
  delay(2000);
}

void gsm_enable(void)
{
  if(debug)
  {
    Serial.println(F("Enabling GSM"));
  }
  digitalWrite(pin_gsm,LOW);//Enable GSM mode
  digitalWrite(pin_gps,HIGH);//Disable GPS mode
  delay(2000);
}




userHeadPic pierrot10