Two arduinos to talk GSM

I have two arduino unos, two arduino gsm shields, and two bluevia activated sims. What I want to do is communicate between the two. One byte of information is really all I need. I just need to be able to send basic things back and forth like "Pin 7 HIGH" and then be able to read "Is pin 7 HIGH" reply "YES" etc. I don't care about sms or voice calls or web clients or servers. All I want is to have BASIC two way communication. Are there any examples of this or could someone make me a simple example of one arduino telling the other arduino to turn an led on?

Thanks.

Bump (4th page)

I don't care about sms

Yes, you do. That is how the two devices will exchange information.

Frustratingly enough, I can't even get that to work. I loaded the receive sms example on one, send sms on the other, and try to send a message to the other while it waits for the message. Nothing happens.

IF ANYONE HAS EXPERIENCE WITH THIS I WILL PAY FOR SUPPORT THROUGH PAYPAL! NEED TO DEVELOP SIMPLE M2M COMMUNICATION!

durkinnj:
All I want is to have BASIC two way communication.

Well you will probably want to figure out how to send SMS back and forth. That's the most "BASIC" communication two GSM devices can do.

durkinnj:
make me a simple example of one arduino telling the other arduino to turn an led on?

Make your messages simple, one byte. Send a "start of packet" character. Whenever your receiver sees the start of packet character, it knows the next one is a command. Use a switch() statement to act based on the character it receives.

durkinnj:
I loaded the receive sms example on one, send sms on the other, and try to send a message to the other while it waits for the message. Nothing happens.

Something has to happen. You probably need to spend some more time debugging what is happening on each side before you declare "nothing" happens. This is going to be a lot of Serial.print()s on both sides.

durkinnj:
SIMPLE M2M COMMUNICATION!

I almost spit my coffee out. There is nothing simple about cellular communications.

What are the sender and receiver examples you used? (I'm not familiar with the GMS/SMS library.)

Do these examples specify which type of modem they're intended for, and is that the same type of modem you're using?

Does the sender check the return status of commands to the GSM modem so you can confirm they succeed, or get an indication of when/why they failed?

Can you use the sender to send to a handset and confirm delivery to the handset?

Can you send from a handset to the receiver and confirm successful receipt?

Does the receiver check the return status of commands to the GSM modem so you can confirm they succeed, or get an indication of when/why they failed?

I am using this for the sender:

/*
 SMS sender
 
 This sketch, for the Arduino GSM shield,sends an SMS message 
 you enter in the serial monitor. Connect your Arduino with the 
 GSM shield and SIM card, open the serial monitor, and wait for 
 the "READY" message to appear in the monitor. Next, type a 
 message to send and press "return". Make sure the serial 
 monitor is set to send a newline when you press return.
 
 Circuit:
 * GSM shield 
 * SIM card that can send SMS
 
 created 25 Feb 2012
 by Tom Igoe
 
 This example is in the public domain.
 
 http://arduino.cc/en/Tutorial/GSMExamplesSendSMS
 
 */

// Include the GSM library
#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess;
GSM_SMS sms;

void setup()
{
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  
  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 remoteNum[20];  // telephone number to send sms
  readSerial(remoteNum);
  Serial.println(remoteNum);
    
  // 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(remoteNum);
  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[i] = '\0';
        Serial.flush();
        return 0;
      }
      if(inChar!='\r')
      {
        result[i] = inChar;
        i++;
      }
    }
  }
}

I am using this for the receiver:

/*
 SMS receiver
 
 This sketch, for the Arduino GSM shield, waits for a SMS message 
 and displays it through the Serial port. 
 
 Circuit:
 * GSM shield attached to and Arduino
 * SIM card that can receive SMS messages
 
 created 25 Feb 2012
 by Javier Zorzano / TD
 
 This example is in the public domain.
 
 http://arduino.cc/en/Tutorial/GSMExamplesReceiveSMS
 
*/

// include the GSM library
#include <GSM.h>

// PIN Number for the SIM
#define PINNUMBER ""

// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;

// Array to hold the number a SMS is retreived from
char senderNumber[20];  

void setup() 
{
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  } 

  Serial.println("SMS Messages Receiver");
    
  // connection state
  boolean notConnected = true;
  
  // Start GSM connection
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  
  Serial.println("GSM initialized");
  Serial.println("Waiting for messages");
}

void loop() 
{
  char c;
  
  // If there are any SMSs available()  
  if (sms.available())
  {
    Serial.println("Message received from:");
    
    // Get remote number
    sms.remoteNumber(senderNumber, 20);
    Serial.println(senderNumber);

    // An example of message disposal    
    // Any messages starting with # should be discarded
    if(sms.peek()=='#')
    {
      Serial.println("Discarded SMS");
      sms.flush();
    }
    
    // Read message bytes and print them
    while(c=sms.read())
      Serial.print(c);
      
    Serial.println("\nEND OF MESSAGE");
    
    // Delete message from modem memory
    sms.flush();
    Serial.println("MESSAGE DELETED");
  }

  delay(1000);

}

I literally changed nothing.

UPDATE: I have been trying to get support from bluevia company for weeks. I use these two simple example codes with prepaid sim cards and I am able to send and receive sms with no problem. When using the bluevia sim cards, IT WILL NOT WORK. I cannot get in contact with bluevia. If I do not fix this problem I am going to call my credit card company and open up a dispute against all the money I spent on bluevia service. I am frustrated with them not having any customer service for their services!

UPDATE: I have been trying to get support from bluevia company for weeks. I use these two simple example codes with prepaid sim cards and I am able to send and receive sms with no problem. When using the bluevia sim cards, IT WILL NOT WORK. I cannot get in contact with bluevia. If I do not fix this problem I am going to call my credit card company and open up a dispute against all the money I spent on bluevia service. I am frustrated with them not having any customer service for their services!

Does bluevia terms of service allow what you are trying to do? I know some SIM card vendors expressly prohibit use of their cards for other than use with phones and products they sell.

  1. STRAIGHT TALK UNLIMITED TALK, TEXT AND DATA PLAN INTENDED USE: Straight Talk Unlimited Talk, Text and Data Plans may ONLY be used with a Straight Talk handset or SIM Card for the following purposes: (i) Person to Person Voice Calls (ii) Text and Picture Messaging, and (iii) Internet browsing and ordinary content Downloads. The Straight Talk Unlimited Plan MAY NOT be used for unauthorized uses that adversely impact our service. Examples of unauthorized uses include, without limitation, the following: (i) continuous uninterrupted mobile to mobile or mobile to landline voice calls; (ii) automated text or picture messaging to another mobile device or e-mail address; (iii) uploading, downloading or streaming of uninterrupted continuous video; (iv) server devices or host computer applications, including, but not limited to, Web camera posts or broadcasts, automatic data feeds, automated machine-to-machine connections or peer-to-peer (P2P) file sharing; or (v) as a substitute or backup for private lines or dedicated data connections. A person engaged in unauthorized uses may have his/her service throttled and/or terminated. In some circumstances, Customers may be provided notice and an opportunity to take corrective action with respect to unauthorized uses before their service is terminated.

Unlimited voice services may not be used for monitoring services, data transmission, transmission of broadcasts, transmission of recorded material, interconnection to other networks, telemarketing activity or autodialed calls or robocalls. Straight Talk reserves the right to cancel or deactivate service, and/or reduce data throughput in order to protect the Carrier’s network from harm due to any cause including, without limitation, the excessive and/or unauthorized use of Straight Talk service. Straight Talk reserves the right to limit or reduce data throughput speeds or the amount of data transferred, and to deny or terminate Service, to anyone Straight Talk believes is using the Straight Talk Unlimited Talk, Text and Data Plan in an unauthorized manner or whose usage, in Straight Talk’s sole discretion, adversely impacts the Carrier’s network or customer service levels. Straight Talk will presume you are engaging in an unauthorized use in violation of these Terms and Conditions if in Straight Talk’s sole opinion, you are placing an abnormally high number of calls, or repeatedly placing calls of unusually long duration, or if your talk, text or Mobile Web usage is harmful or disruptive to the Carrier’s network or service levels. If we determine, at our sole discretion, that you are using an unlimited service in violation of the Straight Talk Terms and Conditions of Service, or in any other manner that we deem to be unreasonable or excessive, then we may terminate individual calls, terminate or reduce the speed of data connection throughput, Mobile Web Access or terminate your service, decline to renew your service, or offer you a different service plan with no unlimited usage component.

I don't know where you pulled that straight talk thing from but bluevia is made specifically for communication from one sim card to the next. It is made for m2m communication. They do state that you cannot make voice calls or send texts outside of bluevia sim cards. I am sending a text from one bluevia sim card to the next. I am doing exactly what their service is supposed to provide, yet is not working. I am paying for a service that does not work and I have proven that it should work by buying prepaid sim cards and trying it that way with a different service provider.

Try to send SMS from GSM shield to a regular (SMS) phone and viceversa. This test may solve 50% of your problems.

The whole operation (if this is it below) looks like some type of money making scam. YMMV

http://labs.bluevia.com/en/page/tech.howto

Yeah I don't know what's up with that. It's not like I chose this company out of the blue (get it?). The Bluevia sim card came with the official arduino gsm shield from the official arduino store. I figured that the whole operation was set up and ready to go! I'm about to dispute both arduino gsm shield charges and bluevia charges on my credit card and get my money back. This is starting to look like a total scam. I bough the gsm sheilds and the bluevia service specifically for this appplication. If bluevia doesn't work and neither companies support me, I am getting my money back because it is useless to me.