Problem with gsm remote control sketch

Where to begin...

Only just seem the thread..

You need 2A 5V supply for all GSM~ Modules They peak at 2.5 x the nominal 500mA quoted for the tc35 and sim9000 when communicating serial with the host, they idle at around 30mA these high peak currents occur during cell registration and cell negotiation for circuits.

Ther code you have has no apparent synchronisation host (UNO) to DCE Modem.

You can't just throw character at it serial without fully synchronising with its reply.. timing of reply's is not absolute so delay as shown in examples on www works sometimes but is not reliable. I dissected the GSM LIBRARY its far to generalised to be used without a clear understanding of the protocols, my advice bite the bullet do it yourself..

As a first step

Issue AT wait for ATOK
Issue ATE0 waitfor OK thats got rid of command echo

Both these responces generally within 200mSeconds

Issue AT+COPS? wait for reply right through to OK this will give some view of cell responce.. the reply returns Operator ID

This can take <1 second up to >5 Seconds, my safety time outs driven by a 20mS timer interrupt are 15 seconds and that does sometimes expire.

When dealing with incoming sms
use..
AT+CMGL=ALL you need to set text mode 1 the code or PDE use is horrible...

to send a text is the most complex timing

AT+CMGS = "XXXXXXXXXXX" XXX = 13 digit number in international format i.e start with +Country code

Responce here is very variable the reply is then the >
The time to create the circuit for the text to this number is quoted as not > 7 seconds on the ISO standard but it depends on cell traffic. If you start message send before > the modem aborts, no error message and you are stuck...

Some versions may issue an ERROR reply but standard does not enforce that as part of protocol.

Once you send the message assuming <160 characters so its one part, terminated with Cntrl Z modem reply is specified as within 5 seconds no minimum given do not try and communicate with modem until OK received if you do modems generally go to sleep and require a H/W reset..

I have various systems running on vehicle tracking, home automation using both the TC35/35i and Sim9000 once you get the synchronisation sorted all is quite easy..

Happy Coding.. 8) 8)