pinMode(swtch, OUTPUT);
What kind of switch are you writing to?
#ifdef DEBUG_CODE_ON
Serial.println("mise en ligne");
#endif
#ifdef DEBUG_CODE_ON
Serial.print("AT+CMEE=2");
gsm.WhileSimpleRead();
#endif
I refuse to guess how you have defined this variable.
}
};
Are all these blank lines really necessary? Why is there a ; lurking there?
Is all that commented out code related to your problem, or not? If not, DELETE IT!. It's impossible to tell what is supposed to be being executed, and what isn't. Perhaps you've noticed that the code you post here is not colored the same way it is in the Arduino IDE.
I don't see where you do or do not turn the gsm shield on.
Have you written a simple sketch to verify that the PIR sensor is connected correctly, and reading the appropriate pin returns the expected values?