GSM shield cannot send SMS without USB cable connected to the PC (SOLVED)

I am using a Mega 2560 and the official GSM shield. I also attached an external 9V power supply to my mega.

I can run the sample SMS code, and then based on that, I just wrote a function that send an a default SMS.

However, I noticed that it won't initialise neither will it send SMS if I unplug the USB cable / don't use Serial Monitor. Why is that so? I have browsed through the forum and have seen a couple of setup problem but I just can't make it work with my GSM shield. Below are my codes for your reference. Please assist. It is driving me crazy!

/*
 * Send SMS to somewhere
 * Author: Syahmul Aziz
 * Written on 23/5/2014
 * Reference: SendSMS by Arduino GSM
 */

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

#define PINNUMBER ""

// initialize the library instance
//GSM gsmAccess;
GSM gsmAccess(true);  //for debugging purposes
GSM_SMS sms;

void setup() {
  // initialize serial communications and wait for port to open:
  Serial.begin(115200);
  Serial.println("SMS SENDER MEGA");
  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected) {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  Serial.println("Initialized");
  //send message. I did not put it in a loop because I only want it to send once
  sendSMS();
}

void loop() {
}

void sendSMS() {
  // send the message
  char remoteNum[20] = "9899xxxx";  // telephone number to send sms
  // sms text
  char txtMsg[200] = "Sending from BLUNO sendSMS."; //sms content
  // send the message
  sms.beginSMS(remoteNum);
  sms.print(txtMsg);
  sms.endSMS(); 
  Serial.println("SMS sent");
}

On the nth time of trying, I noticed that my GSM shield "ON" LED is not lighted up at all when I use the external battery (Last time I check with multimeter, the value is 8v and 1.6A). But when I use a USB cable, the GSM shield lighted up.

So, I straight away unplug my battery and plugged in my 9V adapater and works! I kinda feel stupid for posting this post. haha. But I hope it would be useful for others.

visualxl:
So, I straight away unplug my battery and plugged in my 9V adapater and works!

You don't say what type of battery it was, but if it's one of those small PP3 batteries then they have very low current capability and may not be enough to power a GSM shield. They also have very low charge capacity so they will go flat quickly. They're good for powering smoke alarms but pretty useless for anything Arduino related.

I was using this kind of battery

https://www.google.com.sg/search?q=9v+battery&espv=2&source=lnms&tbm=isch&sa=X&ei=kVSzU__kOomjugSyyoCgBw&sqi=2&ved=0CAYQ_AUoAQ&biw=1280&bih=702

The battery was at 8V with a 1.6A. The GSM shield power goes off when it is about to send an SMS which got me to think that it was trying to draw like 2A which the battery was not able to provide.

Hi, can you tell me what you are using to start sending the SMS? Is it a button, and if so how did you program it?
I want to build a system that can send an automatic SMS message in case of an emergency.

regards
Ruud