Show Posts
Pages: [1] 2
1  Products / Arduino GSM Shield / Re: Sketch for making a Voice call with single push of a button - Not working... on: May 21, 2013, 03:21:21 am
Hi:

Remember you have to add the voice circuit for the sketch to run, if you want to be able to hold a conversation.It is described here: http://arduino.cc/en/Main/ArduinoGSMShield
Regarding the questions:
1-Use the resistor, otherwise when the switch is open the input would be a random value.
2.-The Shield has to be connected to the Arduino UNO. The Arduino runs the sketch and sends commands to the shield (such as "call", "hang", etc...)
2  Products / Arduino GSM Shield / Re: Receive SMS example on: May 08, 2013, 10:46:52 am
First of all, sorry for the delay answering. Long holiday in Madrid.

And yes, things are a bit different in a Mega because interrupts are not the same and communications between modem and arduino have to change.

First, go to the library file called GSM3SoftSerial.cpp and uncomment the lines:

// These can be used in Arduino Mega
#define __TXPIN__ 11
#define __RXPIN__ 10
#define __RXINT__ 4

Now you have to throw a couple of wires:
- From the shield pin called "GSM TX" to pin number 10
- From the shield pin called "GSM RX" to pin number 11

Now you should be able to execute the AT commands and see the answers. Please tell us how it is going.

If you move to UNO remember to take out the wires and comment again the lines.
3  Products / Arduino GSM Shield / Re: GSM receive message and make action on: May 08, 2013, 10:40:58 am
Hi:

You are receiving ascii characters. So, if you are sending a SMS with the text:
1

or with the text

0

you have to compare it like this:
if(c== '1')
      {digitalWrite(led,HIGH);
      }
      if(c== '0')
      {digitalWrite(led,LOW);
      }

Good luck, and please tell us how are you doing.
4  Products / Arduino GSM Shield / Re: Receive SMS example on: April 30, 2013, 12:09:40 pm
Did you manage to execute the AT dialogue? When you execute the sketch you shall see the modem answers. May you copy here the output received through the Serial monitor?

thanks.
5  Products / Arduino GSM Shield / Re: Voice Calls questions on: April 30, 2013, 12:05:08 pm
You have to use the Arduino to control the button.
See this page for button control, but use pin 6 instead of 2.
http://arduino.cc/en/Tutorial/Button

Remember shield pins are connected to Arduino pins (except 2,3 and 7), so you can connect to the shield +GND, 5V and pin 6.

Now you have to merge both examples: sendSMS and button. This sketch should run, please check it:

// libraries
#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 6;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup()
{
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);     
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     
  // initialize serial communications
  Serial.begin(9600);
 
  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
 
  Serial.println("GSM initialized");
}

void loop()
{

// read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {   
    // turn LED on:   
    digitalWrite(ledPin, HIGH); 
  // send the message
  sms.beginSMS("+123456789");
  sms.print("Hi!");
  sms.endSMS();
  Serial.println("\nCOMPLETE!\n");

  }
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
  }
}
6  Products / Arduino GSM Shield / Re: Voice Calls questions on: April 30, 2013, 12:00:06 pm
Hello:

You need to use the Arduino to control the button. See here:
http://arduino.cc/en/Tutorial/Button
but use pin number 2.

Remember that the shield pins are connected to the Arduino pins except pins 2, 3 and 7.

You have to merge both sketches (button example and SMS example). This should run:

// libraries
#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 6;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup()
{
// initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);     
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT); 

  // initialize serial communications
  Serial.begin(9600);
 
  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
 
  Serial.println("GSM initialized");
}

void loop()
{

  Serial.print("Enter a mobile number: ");
  char remoteNumber[20]; // telephone number to send sms
  readSerial(remoteNumber);
  Serial.println(remoteNumber);
   
  // sms text
  Serial.print("Now, enter SMS content: ");
  char txtMsg[200];
  readSerial(txtMsg);
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);
 
  // send the message
  sms.beginSMS(remoteNumber);
  sms.print(txtMsg);
  sms.endSMS();
  Serial.println("\nCOMPLETE!\n");
}

/*
Read input serial
*/
int readSerial(char result[])
{
  int i = 0;
  while(1)
  {
    while (Serial.available() > 0)
    {
      char inChar = Serial.read();
      if (inChar == '\n')
      {
        result = '\0';
        Serial.flush();
        return 0;
      }
      if(inChar!='\r')
      {
        result = inChar;
        i++;
      }
    }
  }
}



7  Products / Arduino GSM Shield / Re: Randomly receiving error while sending SMS (+CMS ERROR: 2162) on: April 26, 2013, 05:43:35 am
Hello!

We've been re-reading our old books on GSM. When talking with the base station the modem accesses first a common channel using an aloha-like protocol. It uses this channel to request a stable channel. But two requests may collide on the air at the same time. In that case both messages and the base station understands nothing. When the modems don't receive any answer from base they wait for a random and re-send the message. They repeat this process until they get an answer from base station, but there is a limit of retries. When the limit is reached the modem gives you an error message, v.g. 2162.

So, the deep meaning is that you're area is quite crowded with GSM devices (over 25% of total capacity)

You can try two things:
1st: simply capture the error at sketch level and try again.
2nd, configure your modem so it retries more times
- Open the SoftwareSerialExample
- Modify it so it runs at 9600 bps
- Execute it on your Arduino.
- Run the Serial Monitor, 9600 bps, NL&CR
- Press (for 1'') the shield Power button until the status led lights up
- Now you can type commands to the modem. Type AT (CR) twice. See that the modem answers OK.
- Type AT+CRLP?
- You'll get something like +CRLP: 61,61,128,6,0,3
- The fourth parameter is the number of retries. You can modify that parameter, for example to 10, executing:
AT+CRLP=61,61,128,10,0,3
OK
- check the new settings with AT+CRLP? again
- Execute AT&W so the configuration is saved

We can not verify easily the effectivity of this solution, as our cell is not crowded. So it'd great if you can check if the above sequence improves your effectivity. In any case this modification will only reduce your failure ratio, but will not make the failures disappear.

8  Products / Arduino GSM Shield / Re: Oauth GSMTwitterClient and ISO 639-1 iso support on tweets on: April 23, 2013, 10:44:57 am
Hi, oAuth is very big for an Arduino. I think it fits, but leaves little room for the GSM library.

But don't worry, you can use the Arduino-Twitter bridge:
http://arduino.cc/forum/index.php/topic,156209.0.html

Regarding ISO 639-1, perhaps that should be done at Arduino-level rather than in the library.
9  Using Arduino / Networking, Protocols, and Devices / Re: GSM Shield Library damaged my equipment? on: April 22, 2013, 11:40:53 am
Anyway, the library is for the Arduino GSM/GPRS Shield, not the SIM900 based. The AT commands possibly will behave different.
10  Products / Arduino GSM Shield / Re: sim cards on: April 16, 2013, 01:16:43 pm
The Bluevia SIM has Internet data communications and SMS with other Bluevia SIMs but no SMS with other networks (we are working to get it but we're not yet there, SMS offers are complex to design due to roaming etc...)

The typical IoT development is not based in SMS but communicating the devices through through an Internet server. For example you can use MQTT, a googleapp engine service or, even simpler, a Twitter messages.
11  Products / Arduino GSM Shield / Re: twitter and GSM shield on: April 10, 2013, 04:19:25 pm
You get the token at http://arduino-tweet.appspot.com/

I think the token goes instead of "TWITTER TALK"
12  Products / Arduino GSM Shield / Re: Error in code sample on: April 10, 2013, 04:11:37 pm
The examples are given in synchronous form. You only leave begin() after all the AT commands are executed and answered. In this form if begin() finds a problem returns. The loop tries to connect again.

The code you give is asynchronous as you said, so you will check the status also between AT commands. Please tell us how the library behaves asynchronously.
13  Products / Arduino GSM Shield / Re: problem with sim card on: April 10, 2013, 04:05:55 pm
Have you configured the Serial Monitor to add both NL&CR?

Thanks.
14  Products / Arduino GSM Shield / Re: GSM shield hangs when reset/uploading code during GPRS connection on: April 10, 2013, 10:10:55 am
I'm checking it but, when you execute begin() the modem should be rebooted (that's the reason for the long pause when starting).

Just, can you switch on debugging doing:

GSM gsmAccess(true);

and post here the trace as dumped in the serial interface?
15  Products / Arduino GSM Shield / Re: Errors in schematic/board of the GSM Shield on: April 09, 2013, 10:08:49 am
Thanks! We'll review the schematic and include that line in the library.
Pages: [1] 2