Skip to content

setPIN is not working #13

Open
Open
@Wellhamster

Description

@Wellhamster

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(){

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions