Go Down

Topic: SMS send/receive problem. (Read 1 time) previous topic - next topic



I need to remotely control a boiler, using a GSM shield. In doing so,
I have experienced an odd behavior described in the following.
My system is composed by the following items:

- Arduino Mega 2560.
- Official GSM Shield (integrated antenna version), using a SIM
card registered on the main Italian mobile Operator.
- Tinkerkit! shield, connected to one relay and two LEDs.

To configure the system, I have followed the indications provided in


i.e. I have connected pin 2 to pin 10 and bended pin 2 on the GSM shield.
Moreover, I have powered the stack composed by the Mega, the GSM shield
and the Tinkerkit! with a 12V, 3A power supply.

I need to send SMSs to the system (e.g. to control the relay status) and
to receive back SMSs (e.g. to recover system status and eventually environment
I have downloaded on the system the GSM library examples (to send and receive SMS)
and I have verified them to work.

The sketch I actually run has been derived from the ReceiveSMS example, filled
with the received SMS decoding and the control of the I/O (Tinkerkit! shield
Please find attached the sketch code (for privacy reasons, I have removed the destination
real phone number)

The following anomalies are present:

1) The afore listed code correctly works (receive and correctly process the
received SMSs), till I enable the SMSs sending in the
"if (FirstLoopExecution==TRUE_VALUE)" (located at the bottom of the sketch).
Doing so, the execution of the 'sms.available()' method is slowed down and
the SMS are no more received, even if correctly sent from the external.
If I disable the SMS sending, the reception is performed correctly.

2) At the first boot after the SW download, the execution hangs on the
GSM connection, i.e. executing
... if(gsmAccess.begin(PINNUMBER,false)==GSM_READY) ...
If I power down the system and subsequently I power it on, it correctly
connects to the GSM network (and all the successive power-off/power-on
sequences correctly execute).

Please note that:

* I have disabled all the 'println', to avoid possible interferences
on the serial interface.
* I have experienced the same problem #1 both defining a separate object
for the transmission SMS (GSM_SMS TXSMS) and the same object for TX and
* To avoid garbage creation or memory saturation effect inside the
"setup()" and "loop()", I have moved all the variables/arrays definitions
at the external.

Can You help me in restricting these problems?
Any hint would be appreciated.
Thanks in advance.

Go Up