New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IComSat SIM900 POWER ON code #11

Closed
mpena2099 opened this Issue Nov 14, 2014 · 13 comments

Comments

Projects
None yet
@mpena2099

mpena2099 commented Nov 14, 2014

Hi!

I'm using the "IComSat v1.1 -SIM900 GSM/GPRS shield" and, as you can see on the datasheet (ftp://imall.iteadstudio.com/IM120417009_IComSat/DS_IM120417009_IComSat.pdf, page 6), "the pin 9 of Arduino interface is connecting to PWRKEY, and a high pulse with 400us wide can power on/off it."

So, to my sim900 module works I have to put this in the code, before calling "gsm.begin":

#define SIM900_POWER 9

void setup() 
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");

  // Power on SIM900 module
  pinMode(SIM900_POWER, OUTPUT);
  digitalWrite(SIM900_POWER, HIGH);
  delay(500);
  digitalWrite(SIM900_POWER, LOW);  
  delay(5000);  
  // end

  //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");
  ...
  ...
  ...

Without that lines the module responds as follows:

............................................
GSM Shield testing.
DB:NO RESP
DB:NO RESP
DB:NO RESP
Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

status=IDLE
............................................

The problem is not why my code is working with these lines. The problem is: why YOUR CODE is working without that? :?

Note: in GSM.h there are two lines that I think don't do nothing:

43 // pins definition
44 #define GSM_ON 8 // connect GSM Module turn ON to pin 77
45 #define GSM_RESET 9 // connect GSM Module RESET to pin 35

Thanks!
Mauricio

@MarcoMartines

This comment has been minimized.

Show comment
Hide comment
@MarcoMartines

MarcoMartines Nov 17, 2014

Owner

The powerup procedure is the same of the poweroff.
The powerup is already done within the begin() function. If you powerup the
module manually before the begin(), it will power off the module.

2014-11-14 17:29 GMT+01:00 Maurício Pena notifications@github.com:

Hi!

I'm using the "IComSat v1.1 -SIM900 GSM/GPRS shield" and, as you can see
on the datasheet (
ftp://imall.iteadstudio.com/IM120417009_IComSat/DS_IM120417009_IComSat.pdf,
page 6), "the pin 9 of Arduino interface is connecting to PWRKEY, and a
high pulse with 400us wide can power on/off it.
"

So, to my sim900 module works I have to put this in the code, before
calling "gsm.begin":

#define SIM900_POWER 9

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");

// Power on SIM900 module
pinMode(SIM900_POWER, OUTPUT);
digitalWrite(SIM900_POWER, HIGH);
delay(500);
digitalWrite(SIM900_POWER, LOW);
delay(5000);
// end

//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");
...
...
...

Without that lines the module responds as follows:

............................................
GSM Shield testing.
DB:NO RESP
DB:NO RESP
DB:NO RESP
Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

status=IDLE
............................................

The problem is not why my code is working with these lines. The problem
is: why YOUR CODE is working without that? :?

Note: in GSM.h there are two lines that I think don't do nothing:

43 // pins definition
44 #define GSM_ON 8 // connect GSM Module turn ON to pin 77
45 #define GSM_RESET 9 // connect GSM Module RESET to pin 35

Thanks!
Mauricio


Reply to this email directly or view it on GitHub
#11.

Owner

MarcoMartines commented Nov 17, 2014

The powerup procedure is the same of the poweroff.
The powerup is already done within the begin() function. If you powerup the
module manually before the begin(), it will power off the module.

2014-11-14 17:29 GMT+01:00 Maurício Pena notifications@github.com:

Hi!

I'm using the "IComSat v1.1 -SIM900 GSM/GPRS shield" and, as you can see
on the datasheet (
ftp://imall.iteadstudio.com/IM120417009_IComSat/DS_IM120417009_IComSat.pdf,
page 6), "the pin 9 of Arduino interface is connecting to PWRKEY, and a
high pulse with 400us wide can power on/off it.
"

So, to my sim900 module works I have to put this in the code, before
calling "gsm.begin":

#define SIM900_POWER 9

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");

// Power on SIM900 module
pinMode(SIM900_POWER, OUTPUT);
digitalWrite(SIM900_POWER, HIGH);
delay(500);
digitalWrite(SIM900_POWER, LOW);
delay(5000);
// end

//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");
...
...
...

Without that lines the module responds as follows:

............................................
GSM Shield testing.
DB:NO RESP
DB:NO RESP
DB:NO RESP
Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

status=IDLE
............................................

The problem is not why my code is working with these lines. The problem
is: why YOUR CODE is working without that? :?

Note: in GSM.h there are two lines that I think don't do nothing:

43 // pins definition
44 #define GSM_ON 8 // connect GSM Module turn ON to pin 77
45 #define GSM_RESET 9 // connect GSM Module RESET to pin 35

Thanks!
Mauricio


Reply to this email directly or view it on GitHub
#11.

@mpena2099

This comment has been minimized.

Show comment
Hide comment
@mpena2099

mpena2099 Nov 18, 2014

Ok @MarcoMartines but the code only works here with these lines (powerup procedure) before begin():

// Power on SIM900 module
  pinMode(SIM900_POWER, OUTPUT);
  digitalWrite(SIM900_POWER, HIGH);
  delay(500);
  digitalWrite(SIM900_POWER, LOW);  
  delay(5000);  
  // end

Without it...
DB:NO RESP
DB:NO RESP
DB:NO RESP

:-/

mpena2099 commented Nov 18, 2014

Ok @MarcoMartines but the code only works here with these lines (powerup procedure) before begin():

// Power on SIM900 module
  pinMode(SIM900_POWER, OUTPUT);
  digitalWrite(SIM900_POWER, HIGH);
  delay(500);
  digitalWrite(SIM900_POWER, LOW);  
  delay(5000);  
  // end

Without it...
DB:NO RESP
DB:NO RESP
DB:NO RESP

:-/

@Xuob

This comment has been minimized.

Show comment
Hide comment
@Xuob

Xuob Nov 21, 2014

@mpena2099
For icomsat 1.1 to work just change pin definitions in GSM.h as shown below

#define GSM_ON          9 
#define GSM_RESET       8 

so it will match pins connections on the board. No need to run additional code😃

Xuob commented Nov 21, 2014

@mpena2099
For icomsat 1.1 to work just change pin definitions in GSM.h as shown below

#define GSM_ON          9 
#define GSM_RESET       8 

so it will match pins connections on the board. No need to run additional code😃

@mpena2099

This comment has been minimized.

Show comment
Hide comment
@mpena2099

mpena2099 Nov 22, 2014

Thanks @Xuob and... that is embarrassing. Now I see that I was not using the latest version of the library... 😳

And... no change was necessary after using the last commit of the library. So the default:

#define GSM_ON                 8 
#define GSM_RESET           9 

Works!

Thanks a lot!

mpena2099 commented Nov 22, 2014

Thanks @Xuob and... that is embarrassing. Now I see that I was not using the latest version of the library... 😳

And... no change was necessary after using the last commit of the library. So the default:

#define GSM_ON                 8 
#define GSM_RESET           9 

Works!

Thanks a lot!

@mpena2099 mpena2099 closed this Nov 22, 2014

@Otavioensa

This comment has been minimized.

Show comment
Hide comment
@Otavioensa

Otavioensa Feb 13, 2015

Thanks so much!!
I spent one day long trying figure out what was not ok!
Thank you ! Its working now! I just had to change GSM.h to :
#define GSM_ON 9
#define GSM_RESET 8

Otavioensa commented Feb 13, 2015

Thanks so much!!
I spent one day long trying figure out what was not ok!
Thank you ! Its working now! I just had to change GSM.h to :
#define GSM_ON 9
#define GSM_RESET 8

@dineshimatrix

This comment has been minimized.

Show comment
Hide comment
@dineshimatrix

dineshimatrix Mar 28, 2015

Dear Sir,

i have no shield and i have one sim900 module with rx and tx pins only.i have connected my sim900 module tx, rx pins only to arduino mega2560. now i have connected the sim900 module to serial port 1 of mega and i have changed all the pin as mentioned in your instructions file. but always i get only
DB: NO RESP . please help me how to connect the sim900 to mega2560

dineshimatrix commented Mar 28, 2015

Dear Sir,

i have no shield and i have one sim900 module with rx and tx pins only.i have connected my sim900 module tx, rx pins only to arduino mega2560. now i have connected the sim900 module to serial port 1 of mega and i have changed all the pin as mentioned in your instructions file. but always i get only
DB: NO RESP . please help me how to connect the sim900 to mega2560

@marcobosa

This comment has been minimized.

Show comment
Hide comment
@marcobosa

marcobosa Jan 24, 2016

Hi @mpena2099 , can you share the library? I have the same problem...
Thanks.

marcobosa commented Jan 24, 2016

Hi @mpena2099 , can you share the library? I have the same problem...
Thanks.

@Hermawanz

This comment has been minimized.

Show comment
Hide comment
@Hermawanz

Hermawanz Mar 5, 2016

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

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

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
if (gsm.begin(2400)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");

if(started){
{
if (sms.SendSMS("+6282283500114", "Arduino SMS"))
{
Serial.println("\nSMS sent OK");
}
else
{
Serial.println("\nError sending SMS.");
}

}}};

void loop()
{
if(started)
{
if(gsm.readSMS(smsbuffer, 160, n, 20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(500);
}
}

//// help me its sim900A , im not work
GSM shield testing
trying to force the baud-rate to 9600

ERROR= SIM900 doesn't answer. Chek power and serial pins in GSM.cpp

Status=Idle

Hermawanz commented Mar 5, 2016

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

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

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
if (gsm.begin(2400)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");

if(started){
{
if (sms.SendSMS("+6282283500114", "Arduino SMS"))
{
Serial.println("\nSMS sent OK");
}
else
{
Serial.println("\nError sending SMS.");
}

}}};

void loop()
{
if(started)
{
if(gsm.readSMS(smsbuffer, 160, n, 20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(500);
}
}

//// help me its sim900A , im not work
GSM shield testing
trying to force the baud-rate to 9600

ERROR= SIM900 doesn't answer. Chek power and serial pins in GSM.cpp

Status=Idle

@ivanfelipecp

This comment has been minimized.

Show comment
Hide comment
@ivanfelipecp

ivanfelipecp Mar 8, 2016

I have this error:

GSM Texting...Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

status=IDLE

and all the code and conections are ok

ivanfelipecp commented Mar 8, 2016

I have this error:

GSM Texting...Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

status=IDLE

and all the code and conections are ok

@Yamapalla

This comment has been minimized.

Show comment
Hide comment
@Yamapalla

Yamapalla May 5, 2016

i have ICOMSAT 1.1
and i changed the code in GSM.h as u mentioned above.

#define GSM_ON 9
#define GSM_RESET 8

and now my irs turn off automatically and meanwhile the same error has indicating

ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

Please Help me to sort this.

Yamapalla commented May 5, 2016

i have ICOMSAT 1.1
and i changed the code in GSM.h as u mentioned above.

#define GSM_ON 9
#define GSM_RESET 8

and now my irs turn off automatically and meanwhile the same error has indicating

ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

Please Help me to sort this.

@blacktorch

This comment has been minimized.

Show comment
Hide comment
@blacktorch

blacktorch Jun 7, 2016

If you are using Arduino Mega 2560, follow these steps.
[1] How to switch between Arduino Mega and Arduino Uno?

1)
Open GSM.h and comment-decomment the appropriate lines like below
e.g. for Arduino Mega
//#define UNO
#define MEGA

2)
If you use Arduino Uno comment the line in HWSerial.h or decomment if
you are using Arduino Mega
e.g. for Arduino Mega
#define MEGA

3)
Save and compile

[2] How to switch between the old shield (that uses 4 and 5 pins for
SoftwareSerial and the new (that used 2 and 3 pins)?

1)
Open GSM.cpp and comment-decomment the appropriate lines like below
e.g. for the new one

//#define _GSM_TXPIN_ 4
//#define _GSM_RXPIN_ 5
#define _GSM_TXPIN_ 2
#define _GSM_RXPIN_ 3

2)
Save and compile

Connect the RX pin of your sim module to pin 18 of your arduino mega and the TX pin to pin 19 of the arduino mega. This is because the library uses Hardware serial for mega. Connect VIO pin of your sim module to IOREF pin of your arduino mega and the connect the GND of your sim module to GND of your arduino mega. That's all.

blacktorch commented Jun 7, 2016

If you are using Arduino Mega 2560, follow these steps.
[1] How to switch between Arduino Mega and Arduino Uno?

1)
Open GSM.h and comment-decomment the appropriate lines like below
e.g. for Arduino Mega
//#define UNO
#define MEGA

2)
If you use Arduino Uno comment the line in HWSerial.h or decomment if
you are using Arduino Mega
e.g. for Arduino Mega
#define MEGA

3)
Save and compile

[2] How to switch between the old shield (that uses 4 and 5 pins for
SoftwareSerial and the new (that used 2 and 3 pins)?

1)
Open GSM.cpp and comment-decomment the appropriate lines like below
e.g. for the new one

//#define _GSM_TXPIN_ 4
//#define _GSM_RXPIN_ 5
#define _GSM_TXPIN_ 2
#define _GSM_RXPIN_ 3

2)
Save and compile

Connect the RX pin of your sim module to pin 18 of your arduino mega and the TX pin to pin 19 of the arduino mega. This is because the library uses Hardware serial for mega. Connect VIO pin of your sim module to IOREF pin of your arduino mega and the connect the GND of your sim module to GND of your arduino mega. That's all.

@tayfuncelik

This comment has been minimized.

Show comment
Hide comment
@tayfuncelik

tayfuncelik Jun 8, 2016

Could you please give information how we can do it with micro , nano version

tayfuncelik commented Jun 8, 2016

Could you please give information how we can do it with micro , nano version

@quique123

This comment has been minimized.

Show comment
Hide comment
@quique123

quique123 Oct 8, 2016

I have an issue where the library works with the Mega using the sendsms() method. I can see all the debug commands which work and the sms is received.

So Ive tried to use the nano with the library and directly with AT commands, this is what Ive found:

Library
But when I try to use the nano, I cant upload the sketch with references to Serial1 in HWSerial, so I changed them all to Serial instead. I can see the logs again and I noticed that CPMS returns error whenever it doesnt work on the nano. When it works in the Mega, CPMS returns OK in the logs.

AT Commands
I tried sending the sms with CMGS but the sms is never received. I started looking at the library and noticed that Im not using the pulse method, forceON(). I then googled it and found this thread and others where it seems to state that pulsing is required. The problem is I dont have the shield, I have a SIM900 breakout and thus cant really access the powerkey pin.

But I have made it work before. I dont know how, but I think switching to the mega/library sketch must have done something and i managed to receive a couple of sms from the nano/at sketch. That only worked for that session and when I tried to repeat it it stopped working.

Ive' posted about the issue here:http://forum.arduino.cc/index.php?topic=428200.msg2952179#msg2952179

quique123 commented Oct 8, 2016

I have an issue where the library works with the Mega using the sendsms() method. I can see all the debug commands which work and the sms is received.

So Ive tried to use the nano with the library and directly with AT commands, this is what Ive found:

Library
But when I try to use the nano, I cant upload the sketch with references to Serial1 in HWSerial, so I changed them all to Serial instead. I can see the logs again and I noticed that CPMS returns error whenever it doesnt work on the nano. When it works in the Mega, CPMS returns OK in the logs.

AT Commands
I tried sending the sms with CMGS but the sms is never received. I started looking at the library and noticed that Im not using the pulse method, forceON(). I then googled it and found this thread and others where it seems to state that pulsing is required. The problem is I dont have the shield, I have a SIM900 breakout and thus cant really access the powerkey pin.

But I have made it work before. I dont know how, but I think switching to the mega/library sketch must have done something and i managed to receive a couple of sms from the nano/at sketch. That only worked for that session and when I tried to repeat it it stopped working.

Ive' posted about the issue here:http://forum.arduino.cc/index.php?topic=428200.msg2952179#msg2952179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment