Please HELP. Im new with Arduino and GSM (also new in the forums)

So heres the Scenario, im trying to interface my “Form” made from Visual Studio C# to an Arduino Uno which is connected to a TC35 GSM Module. The GSM module should send a notification (in the from of a message to the Arduino) whenever and whatever key i press in the Forms textbox. it will then send a TEXT if it sees the “=” character in the notification which was received by the arduino containing the message itself . Here are my codes:


 ******************************************
      vsc# code on sending a message to arduino
**********************************************
        string test_Message = "Some text here around 46 Bytes";
        //example message from database
        public Serial_Arduino()
        {
            InitializeComponent();
        }

        private void Message_save(object sender, KeyPressEventArgs e)
        { // Will send Message once a KEY (any) Pressed.
          
            if (!serialPort1.IsOpen) return; //Will not send if port is closed 
            

           string Notify = test_Message; //save message from database
            serialPort1.Write(Notify);// Sends it to Arduino
        }

======================================================
Arduino Sketch

#include <SoftwareSerial.h> 


SoftwareSerial gsmSerial(2,3); // Intialize use of pins 2 and 3 for TX and RX 
byte check;
char letter[51];
int x =0;

void setup()
{
Serial.begin(9600);
gsmSerial.begin(9600); //9600 Baud Rate
delay(5000);
}
void loop() {
SendNotify();
}


void SendNotify(){
  if (Serial.available()) {
     check = Serial.read();
             if(check==61){  //checks if a "=" shows up
           
              gsmSerial.print("AT+CMGF=1\r"); //SEND SMS
              delay(100);
              gsmSerial.println("AT+CMGS=\"+63xxxxxxxxxx\""); //Phone Number
              delay(100);       
              gsmSerial.print(letter);
              delay(100);
              gsmSerial.println((char)26); 
              //Serial.print(letter);
              }
              if (x <=50){ // Just to put some kind of text for testing
              letter [x] = check; 
              x++; 
              }
  }
}

This program is just for testing purposes, i just want my VSC# Form (PC) to send a message to Arduino and then the Arduino to the TC35 for it to text me.
what I tried with the code above:

  • Well, since I don’t receive any kind of text message from the code above, I tried ECHO-ing the message to see what it looks like (Hence the //Serial.print(letter); on the code) The message echo-ed back fine (same text).

I tried typing the actual message to the Arduino sketch and it SENT a TEXT message in a couple of seconds:
Code sending message from arduino to TC35 WITHOUT the VSC# form

void SendNotify(){
gsmSerial.print("AT+CMGF=1\r"); //SEND SMS
delay(100);
gsmSerial.println("AT+CMGS=\"+xxxxxxxxxxx\""); //Phone Number
delay(100);                 
gsmSerial.print("Some text here around 46 Bytes"); //Message
delay(100);
gsmSerial.println((char)26); //End AT command with a ^Z, ASCII code 26
}

I also attached a very poorly made diagram of the Arduino to TC35 GSM module connection
SO…
Is it the GSM module? or is it the code? or am I doing something wrong Thanks to whoever tries to Help.

             if(check==61){  //checks if a "=" shows up

You don't need a silly comment if you write the code correctly:

             if(check == '"')
             { // Down here, where it belongs!
              gsmSerial.print("AT+CMGF=1\r"); //SEND SMS

Yoohoo, phone, do something. No, I don't give a shit if that worked, or not. I like to be kept in the dark.

              gsmSerial.println("AT+CMGS=\"+63xxxxxxxxxx\""); //Phone Number

I'll just assume that that work, so, now, do this. Again, I don't give a shit if it works.

              gsmSerial.print(letter);

What a stupid name for an array of letters.