why doesn't work my else if statement? #GSM

// include the GSM library
#include <GSM.h>

// PIN Number for the SIM
#define PINNUMBER “1234”

// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;

// Array to hold the number a SMS is retreived from
char senderNumber[20];

void setup() {
// initialize serial communications and wait for port to open:
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only

Serial.println(“SMS Messages Receiver”);

// connection state
boolean notConnected = true;

// Start GSM connection
while (notConnected) {
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
notConnected = false;
} else {
Serial.println(“Not connected”);

Serial.println(“GSM initialized”);
Serial.println(“Waiting for messages”);

void loop() {
char CSMS;

// If there are any SMSs available()
if (sms.available()) {
Serial.println(“Message received from:”);

// Get remote number
sms.remoteNumber(senderNumber, 20);

// An example of message disposal
// Any messages starting with # should be discarded
if (sms.peek() == ‘#’) {
Serial.println(“Discarded SMS”);

// Read message bytes and print them
while (CSMS = sms.read()) {

////this works fine
if (CSMS == ‘1’){
Serial.print("\n\n TEST ONE");
else if (CSMS == “OPEN”){
Serial.print("\n\n OPEN");

Serial.println("\nEND OF MESSAGE");

// Delete message from modem memory
Serial.println(“MESSAGE DELETED”);



if (CSMS == '1')
if (CSMS == "OPEN"){

One is a character, the other is a string.

Please use code tags yadda yadda

I have searched on the internet but I got no clear answer. :frowning: Can you help me wipe with a sample code.

Try this