General

Problems with AT commands SKU:TEL0051 and Arduino UNO

userHead rilo_87 2014-08-20 05:15:33 7402 Views9 Replies
First comment I'm Spanish so I apologize for my English.

I'm developing a project with the GPS / GPRS module SKU: TEL0051 and arduino UNO.

It is a small program that gets the GPS location and sends a http web service that generates a map showing the entire route.

The problem is I want to get the phone number of the sim I'm using, I saw in the manual AT commands AT + CNUM is used to obtain the phone number but do not know how to use it or how to get that data.

Could anyone help me? :'(

Thanks in advance.
2014-08-30 03:02:56 Hello Rilo,

A good advice when using the serial port from Arduino with the shield, is to flash a blink example first ( with the required enabled pins). So the serial is not used and you can write commands directly.

If you are checking the AT commands programmed on Arduino, you might just see the results but not the command itself, or the other way around.

The datasheet should have information on the AT command that you need in order to retrieve the phone number.
I encourage you to try again the Java tester link i shared before. Burn a blink example( with the required enabled pins as per wiki instructions ) , connect module to computer and try, if you get an error, reset the shield ( check the LED's go back to off ) and try again.

Suerte!
userHeadPic Jose
2014-08-29 23:45:23 can someone help me with this please ?? I need urgent help :'( userHeadPic rilo_87
2014-08-27 03:47:59 Any help?? userHeadPic rilo_87
2014-08-22 05:06:02 The problem of communication is already solved. I changed the power supply 1.5 amps per 2 Amp and it works perfect.

On the problem of the AT command + CNUM. The command works but only returns me the OK value, and the AT + CIMI command returns a numeric value to me but not the phone number of the sim.

AT command that works is if AT + GSN that returns me the IMEI in command at tester.

I tried to use Serial.read in arduino (not sure if done correctly) and this is what it returns:
Code: Select all
AT
AT+CREG?
21326
ÿ©
Ä
HRmDdYd
0
0
"

+TCHFTUANT:O =1

[

AT+SAPBR=3,1,"APN","internet"
AT+SAPBR=3,1,"Contype","GPRS"
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="CID",1

The code I used is this:
Code: Select all
void setup()
{
  Serial.begin(9600); 
   pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
    digitalWrite(5,HIGH);
    delay(1500);
    digitalWrite(5,LOW);
    digitalWrite(3,LOW);//enable GSM TX?RX
    digitalWrite(4,HIGH);//disable GPS TX?RX
    delay(2000);
    //delay(20000);        
    start_GSM();    
    delay(5000);     
}
char* serialGetString()
{
  int maximo = 500;
  char cadena[500];
  unsigned i=0;
  char sIn;
  --maximo;        
  while (Serial.available() && i<maximo)
    {
      sIn=Serial.read();
      cadena[i++]=sIn;
      delayMicroseconds(500);
      i++;
    }
  cadena[i++]='\0';
  return cadena;
}
void loop () 
{    
}

void start_GSM(){    
    Serial.println("AT");    
    delay(2000);
    Serial.println("AT+CREG?");
    delay(2000);     
    Serial.println('AT+GSN'); //this line returns the value 21326 me directly on the screen when I run the AT + GSN command but not the IMEI
    delay(2000);   
    Serial.println(serialGetString());
    Serial.println("AT+SAPBR=3,1,\"APN\",\"internet\"");
    delay(2000);
    Serial.println("AT+SAPBR=3,1,\"Contype\",\"GPRS\"");
    delay(2000);
    Serial.println("AT+SAPBR=1,1");
    delay(10000);
    Serial.println("AT+HTTPINIT");
    delay(2000);
    Serial.println("AT+HTTPPARA=\"CID\",1");
    delay(2000);
 }
I've also tried directly:
Code: Select all
Serial.println(Serial.read());
And it returns the number 13 on the screen. If I reset the board, it returns me 255 If I restart puts me 13 again. And so again and again.

And this is my arduino module with sku:tel0051. the power supply is 12 volts and 2 amps.

[img]http://seseo.es/imagenes/2.jpg[/img]
[img]http://seseo.es/imagenes/3.jpg[/img]
[img]http://seseo.es/imagenes/4.jpg[/img]
userHeadPic rilo_87
2014-08-21 19:30:15 [quote="rilo_87"]
But I was able to connect with Putty !! Although I have had to try several times it finally connected and I was able to test.
[/quote]
Use putty as a Serial connection or telnet? or something else?

[quote="rilo_87"]
1 In the beginning was going to get the phone number of the sim I was using to send a http request and know so phone was making that request. The problem is that I have read the manual for AT commands and the correct command is AT + CNUM but when I test, I run it only returns me the OK value. Although I have left to prove and I'm working on the second option, I wonder if anyone knows that I do not return the phone number from the sim. Out of curiosity.
[/quote]
On the link i sent you to the wiki, one of the pictures gets the phone number by using: AT+CIMI


[quote="rilo_87"]
2 As an alternative to the first option I thought of sending the IMEI of the GSM module to identify who makes the http request. Running the AT + GSN command returns the IMEI me correctly. But now I have a final question. How do I make the Arduino code to collect the IMEI in a variable to send by http?
[/quote]
Arduino serial parsing is not difficult. I encourage you to try this on a blank new Sketch. Serial.real, then store in a buffer then parse it or store it on a different way.

[quote="rilo_87"]
...Ever connected but I appear strange characters in the log and can not do anything more.
[/quote]

This is usually a sign that the module was shutdown, if you have not issued this command on your Arduino code, most likely it shutdown because not enough power.

Please send a picture of your hardware and your Code
userHeadPic Jose
2014-08-21 03:25:18 I'm using a feeder 12v and 1.5 amps. With this feeder I make calls and sending messages without problems but still can not connect with at command tester.

But I was able to connect with Putty !! Although I have had to try several times it finally connected and I was able to test.

Now I have several questions:

1 In the beginning was going to get the phone number of the sim I was using to send a http request and know so phone was making that request. The problem is that I have read the manual for AT commands and the correct command is AT + CNUM but when I test, I run it only returns me the OK value. Although I have left to prove and I'm working on the second option, I wonder if anyone knows that I do not return the phone number from the sim. Out of curiosity.

2 As an alternative to the first option I thought of sending the IMEI of the GSM module to identify who makes the http request. Running the AT + GSN command returns the IMEI me correctly. But now I have a final question. How do I make the Arduino code to collect the IMEI in a variable to send by http?


Thank you very much again for your interest.
userHeadPic rilo_87
2014-08-21 02:38:14 what power supply are you using? userHeadPic Jose
2014-08-21 01:51:54 Hello again
First of all thank you very much for your reply.

I already knew this application. I've been testing but I can not connect my arduino. I followed the instructions on the wiki but every time I try to set the connection to AT commad tester gives me Connection failure. Ever connected but I appear strange characters in the log and can not do anything more.

The truth is I've tried a thousand ways but can not get connected.

Anyway my problem is not whether the command is successful or not, nor test it. The question is how can I collect the value returned by an AT command and insert it into a variable to work with.
userHeadPic rilo_87
2014-08-20 19:54:42 Hola Rilo,

I think it might be helpful to try this application:

https://www.dfrobot.com/wiki/index.php/AT_command_tester

Hope it helps!
Saludos
userHeadPic Jose