GSM shield randomly hangs for GsmWebClient example


I experience a strange behavior of GSM shield when using the official GsmWebClient Example.

These are the components I am using - Arduino Uno - Arduino GSM Shield - T-mobile SIM card PIN protected - External Power Pack for GSM Shield (i noticed that without the external power I cannot get the GSM shield up and running)

Here are the only changes I made to the sample code:

// PIN Number
#define PINNUMBER "1234" // I entered my SIM PIN here
// APN data
#define GPRS_APN "internet.telekom" // i use a t-mobile sim card in germany
#define GPRS_LOGIN "tm" // i use a t-mobile sim card in germany
#define GPRS_PASSWORD "tm" // i use a t-mobile sim card in germany

Now when I run the sample code (it should open a txt file from it randomly hangs (8 out of 10 times). When I say "hangs" it means the code stops with the output "Starting Arduino web client" in serial monitor and nothing happens.

However when I switch on debugging everything runs as expected (I am getting the result screen in 10 out of 10 times).

GSM gsmAccess  = true;

Thank you very much for any help or hints! Musterstrasse

Hi, how are you powering arduino?, I was experiencing the same problem and it got solved by changing the power to the arduino from usb to a 9V/1A, as recommended in one post of this forum

Hope it helps!

I did some calculation on power requirements, and if using GPRS Class 12 (i.e upto 4 time-slots up to server) the modules will draw upto 1.6 Ampere, and there is no way this will work with a simple USB current of 100mA (always ok) or 500mA of a negotiated USB power consumption.

This will also be network dependend as the 1.6 Amps is just used if there is a bad antenna mismatch or bad coverage in the area. An external power supply of >1.6 Amps should always work ok.

You can also put the module into other GPRS modes with the AT-command "at+qgpclass" which requires a reboot (?) of the module to make it take action. That way with GPRS as 1 slot up (and 1 down ) the maximum median power is 1.6 Amps / 8 times slots = 200mAmps (add a 100mA for other stuff) which is Ok with the USB power.

hey both,

thanks for your feedback. i already changed from USB power to an external power supply from the very beginning since i could not get GSM connection with just USB.

now what i understand from your suggestion is that the external power adapter might be to weak!?

i am currently using the following external power adapter: - voltcraft; 1500 mA; 12 V/DC

so i will give it a try and switch over to another model with >1.6 Amps. will let you know the result and keeping you posted...

hey both,

just to let you know.

even with changing the external power supply (i am running on 12V, 2250 mA, 27 Watt now) I am getting the same results.

when running the “GsmWebClient” example it hangs in 9 out of 10 attempts.
only setting the program to debug mode executes the program as expected.

for now I will keep testing in debug mode…
any ideas on how to solve that?


dear all,

in a parallel post i found a workaround (add delay) for my issue.

i considered the workaround by replacing the following sample code lines of GSBWebClient

    if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
      notConnected = false;

with the following lines:

       notConnected = false;

Helo :slight_smile:

I believe you are on the right path, but the delay solution is not documented.

The reason why the shield is doing “to much” is cus its restarting by default if one do not add the false parameter in the gsmAccess.begin statement,
to turn off the restarting mechanism. In my experience, the shield will work one or maybe two times but then it crashes trying to boot up and restart at the same time.

If you use the shield fore several connections and need to power down i suggest using the delay deal and the false parameter.