Pages: [1]   Go Down
Author Topic: using GSM shield without Arduino GSM library (AT commands?)  (Read 4064 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I've assembled a data logging unit with an RTC module, LCD (i2c) display, SD memory card shield and Arduino GSM/GPRS shield on Arduino Uno R3.

Since the sketch was too big for Arduino, I removed some of not used GSM library (Mockup, SMS, Voice, ModemVerification,MultiClientProvider, MultiServerProvider, ScanNetwork) moving all related files in a new folder.
I checked on a separate sketch that having removed those files did no affect the GPRS connection and data transfer with GET method works perfectly.

The sketch compiles well, but goes out of memory and it doesn't run.

Is there a way to avoid using GSM library? reducing so far memory usage to what I actually need? maybe with AT commands (I don't know much how they work).

Thanks for any help.
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 135
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can do it with SoftwareSerial library. Modem uses digital pin 2 for RX and digital pin 3 for TX.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can directly give the AT command and also see the response of the AT.
First try out the AT commands using hyperterminal and then use it in your code .
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 135
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Put this code in your Arduino and enter AT commands with Serial Monitor:

#include <SoftwareSerial.h>
#include <string.h>

char incoming_char = 0;
SoftwareSerial cell(2,3);

void setup()
{
  // Initialize serial ports for communication.
  Serial.begin(9600);

  // Reset
  Serial.println("Start Reset");
  pinMode(7, OUTPUT);
  digitalWrite(7, HIGH);
  delay(12000);
  digitalWrite(7, LOW);
  delay(1000);
  Serial.println("End Reset"); 

  cell.begin(9600);

  Serial.println("Enter your AT commands (with CR & NL)...");
}

void loop()
{
  if(cell.available() > 0)
  {
    incoming_char = cell.read();
    if((incoming_char >= ' ') && (incoming_char<='z'))
      Serial.print(incoming_char);
    else
    {
      Serial.print("%");
      Serial.print((int) incoming_char);
      Serial.print("%");
      if(incoming_char == 10)
        Serial.println();
    }
  }

  if(Serial.available() > 0)
  {
    incoming_char = Serial.read();
    cell.print(incoming_char);
  }
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you  send sms in serial monitor using the at commands? Iv found these instructions but they seem to be for hyper terminal because no prompt shows up and ctrl+Z Have no effect. Buth NL & CR are selected and the proper baud rate is selected.

im using a tinysine gsm module and an arduino uno.

any suggestions?

Quote
To send an SMS, AT commands need to be entered in the following order:

- at+cmgf=1 (send SMS in text mode)

- at+cmgs=”+9955555555″ (Destination number; replace +99 with the country code of the country you want to send the SMS to, 55555555 needs to be replaced with the destination number)

When a prompt > appears enter the text you wish to send as a message, for example:
> Test sending SMS message
press CTRL+Z keys to send the message

When the SMS is sent correctly, a response will appear on the screen:
+CMGS: xx (xx=reference number)
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 34
I am Syed Zain Nasir, the founder of The Engineering Projects (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projec
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check this link out .... http://www.theengineeringprojects.com/2014/06/send-sms-with-arduino-uno-and-sim900d-using-at-commands.html ..... This code works perfectly as I have testing it myself. Its for sending sms via sm900 using AT commands but you can modify it and can send whatever command you want. Hope it will work.
Logged

Pages: [1]   Go Up
Jump to: