Skip to content
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

setPIN is not working #13

Open
Wellhamster opened this issue Dec 12, 2017 · 1 comment
Open

setPIN is not working #13

Wellhamster opened this issue Dec 12, 2017 · 1 comment

Comments

@Wellhamster
Copy link

Perhaps just a personal issue, but I get wrong responses from setPin.
When I enter the correct pin it returns false and everything works fine. But when I enter the wrong pin it also returns false (and not true as you state in the description).
if ( (_readSerial(5000).indexOf("ER")) == -1)
{
return false;
}
else return true;

When I type the AT-Commands in by hand everything works fine. I hope that there is a solution. Thank you :-)

Here my code:

#include <Sim800L.h>
#include <SoftwareSerial.h>
#define RX 5
#define TX 4

Sim800L GSM(RX, TX);

void setup(){
pinMode(11, OUTPUT);
digitalWrite(11,HIGH); //turns on the Sim800L module

Serial.begin(9600);
GSM.begin(4800);
String pin = "4311";
delay(5000);

if (GSM.setPIN(pin)) Serial.println("Pin set");
else Serial.println("Pin NOT set");

}

void loop(){

}

@Wellhamster
Copy link
Author

That's what I tried:
change RX,TX pins does not change anything.
It looks like that the _ readSerial functions only returns the command and did not contain the response from the module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant