Go Down

Topic: SIM900 ICOMSAT 1.1 does not send sms (Read 10978 times) previous topic - next topic

frealy

yeah, i have.
how to do that? i never know about it. when i press the power button on shield status green but NET wink every 3 second

frealy

#16
Jun 11, 2015, 06:35 pm Last Edit: Jun 12, 2015, 01:32 am by frealy Reason: I add my code for easier understad my difficulties
now i'm using software arduino 1.6.4. when i compiled it, it attach to the arduino. when open serial monitor nothing happen although there is nothing error.

Code: [Select]

#include <SoftwareSerial.h>
SoftwareSerial SIM900(6, 7);
 
void setup()
{
  SIM900.begin(19200);
  SIM900power(); 
  delay(20000);  // give time to log on to network.
}
 
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(9, HIGH);
  delay(1000);
  digitalWrite(9, LOW);
  delay(5000);
}
 
void sendSMS()
{
  SIM900.print("AT+CMGF=1\r");                         // AT command to send SMS message
  delay(100);
  SIM900.println("AT + CMGS = \"+6289638777223\"");     // recipient's mobile number, in international format
  delay(100);
  SIM900.println("Hello ^^");        // message to send
  delay(100);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(100);
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
  SIM900power();                                   // turn off module
}
 
void loop()
{
  sendSMS();
  do {} while (1);
}

dannable

Code: [Select]
 delay(100);
Try increasing all of these to one second:
Code: [Select]
 delay(1000);
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

delmarene

well i do have same issue right here. i work on this code, which exactly the same with the example given by krikho. I only change the software serial pins into 2,3 (i already matched it with I/O pins on my SIM900)  dannable said that it is okay since not using 1 and 0
Code: [Select]
#include <SoftwareSerial.h>
SoftwareSerial SIM900(2, 3);

 
void setup()
{
  SIM900.begin(19200);
  SIM900power();
  delay(20000);  // give time to log on to network.
}
 
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(9, HIGH);
  delay(1000);
  digitalWrite(9, LOW);
  delay(5000);
}
 
void sendSMS()
{
  SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(1000);
  SIM900.println("AT + CMGS = \"+628569xxxxx\"");                                     // recipient's mobile number, in international format
  delay(1000);
  SIM900.println("Hello, world. This is a text message from an Arduino Uno.");        // message to send
  delay(1000);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(1000);
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
}
 
void loop()
{
  sendSMS();
  do {} while (1);
}


done with the compiling,  i uploaded the code to board. and nothing happened.
1. This code supposed to automatically turned ON the shield, isn't it? Since there is SIM900power() inside the code. But my shield still turned OFF. I still have to press the power button to turn it ON. I also used external adapter just in case the current was'nt enough from the USB. But nothing changed.

2. The shield doesn't send the message.

I really need help

dannable

The following works for me. Txd jumper on 2, Rxd on 3, slide switch to 'UART'. Note the additional declaration of the powerPin as OUTPUT.
Code: [Select]

#include <SoftwareSerial.h>

#define powerPin 9

SoftwareSerial SIM900(2, 3);


void setup()
{
  pinMode(powerPin,OUTPUT);
  digitalWrite(powerPin,LOW);

  SIM900.begin(19200);
  SIM900power();
  delay(20000);  // give time to log on to network.
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(powerPin, HIGH);
  delay(1000);
  digitalWrite(powerPin, LOW);
  delay(5000);
}

void sendSMS()
{
  SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(1000);
  SIM900.println("AT + CMGS = \"+447751123456\"");                                     // recipient's mobile number, in international format
  delay(1000);
  SIM900.println("Hello, world. This is a text message from an Arduino Uno.");        // message to send
  delay(1000);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(1000);
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
}

void loop()
{
  sendSMS();
  do {
  }
  while (1);
}
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

delmarene

@dannable: thankyou soo much, it automatically turned on with your code :)

but i still cant send the message, am i missed something? i just changed the message recipient with my number and my international code, but nothing happened.

do i have to open something or do something to make the message sent? this code supposed to give the AT command directly to the shield, isnt it?

dannable

The code as you see it sent a message to my phone without any further action. If yours doesn't I would consider your network connection? Do you need a PIN number? Enough credit?
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

delmarene

thank you dannable, but everything's allright. i tested my board using the example given by the library, (which use serial monitor) and the message sent
Code: [Select]

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup()
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");
  
  if(started){
    //Enable this two lines if you want to send an SMS.
    if (sms.SendSMS("085694300192", "It works!"))
      Serial.println("\nSMS sent OK");
  }

};

void loop()
{
  if(started){
    //Read if there are messages on SIM card and print them.
    if(gsm.readSMS(smsbuffer, 160, n, 20))
    {
      Serial.println(n);
      Serial.println(smsbuffer);
    }
    delay(1000);
  }
};


so we may conclude that the connection and my credit is okay. and it also doesnt need PIN numbers.
any idea? i reallyyyy confused :smiley-cry:

dannable

Unfortunately it's difficult to diagnose something when the replicated circuit works!

All I can think of is swapping the pin numbers over when you create an instance of SoftwareSerial:

Code: [Select]
SoftwareSerial SIM900(3, 2);
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

delmarene

I already swapped the pin numbers into (3,2) but (still) nothing happened

here is some current condition of my shield, just in case maybe there is some clue to solve my problem
1. IComSat 1.1
2. UART switch
3. TXD 2 RXD 3
4. antenna attached, credit and connection are okay
5. no PIN number needed
6. i just put this code in the end of sendSMS()
Code: [Select]

lcd.println("Finished");

assuming that if this code appeared then the method sendSMS() is working well
the result is yes, "Finished" appear in my lcd screen, but shield still does not send the message

delmarene

@dannable i also want to ask something. can i used other than pin 9 as powerPins?
since i use lcd screen in my project which already used up 6 pins (4,5,6,7,8,9)

dannable

@dannable i also want to ask something. can i used other than pin 9 as powerPins?
since i use lcd screen in my project which already used up 6 pins (4,5,6,7,8,9)
That depends on your soldering skill. You would need to break the pcb trace and connect it to a pin of your choice.

I would also point out that D8 is used to reset the ICOMSTAT shield. Have you read the ITEAD wiki page for the shield?

http://wiki.iteadstudio.com/IComSat
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

delmarene

#27
Jun 30, 2015, 02:04 pm Last Edit: Jun 30, 2015, 02:12 pm by delmarene
okay if thats the case, thank you for all your help dannable :)

but im still get weird problem with my sms, do you have any idea to fix it?

here is the code btw if you want to make sure
Code: [Select]
#include <SoftwareSerial.h>

#define powerPin 9

SoftwareSerial SIM900(2, 3);


void setup()
{
  pinMode(powerPin,OUTPUT);
  digitalWrite(powerPin,LOW);

  SIM900.begin(19200);
  SIM900power();
  delay(20000);  // give time to log on to network.
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(powerPin, HIGH);
  delay(1000);
  digitalWrite(powerPin, LOW);
  delay(5000);
}

void sendSMS()
{
  SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(1000);
  SIM900.println("AT + CMGS = \"+6285694300192\"");                                     // recipient's mobile number, in international format
  delay(1000);
  SIM900.println("Hello, world. This is a text message from an Arduino Uno.");        // message to send
  delay(1000);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(1000);
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
}

void loop()
{
  sendSMS();
  do {
  }
  while (1);
}


i also tried to swap software serial to 3,2 as you suggest but nothing happened

delmarene

dannable: i already find out. i changed the baud rate to 2400 and now it can send the message :)) but still, i dont know why hehe

Terpogi


Go Up