Sending SMS with SIM900A shield

Hello All,

I am trying to send a message from the Arduino GSM Shield.

Below are the messages I am trying to send,wherein each of the below message will be sent if a particular condition is fulfilled

  1. Fast Leak
  2. Level1 Low Pressure Warning
  3. Level2 Low Pressure Warning

I see that only Fast Leak gets sent completely as an SMS. Other 2 get truncated after "Low" and i receive only Level1 Low/Level2 Low.

I also received the no. of characters being sent as sms from the return of the sms.print function. In cases 2 and 3, i can see that the character count is 27 returned by the sms.print().

But i dont understand why the SMS is truncated in cases 2 and 3?

I know i am missing something stupid. But haven't been able to figure out thus far.

Can you guys provide your suggestions?

Dear HariPrassana,

Take a look at how you declare the variables you are using in the beginning of the sketch. For example, if you declared your Level 1 Low Pressure Warning as "char level1low[30]" then pay attention to to number of characters you have declared within the array string. You may not have allowed enough space in memory to store the entire string.

A character array can have more characters than the abstract string held in it, as below:

char label[10] = "Single";
giving an array that looks like:


| S | i | n | g | l | e | \0 | | | |

(where 3 array elements are currently unused).

Based on your post, my guess is you only allowed char xxx[10] rather than [30]

Hope this helps.

Can you guys provide your suggestions?

How?
You don't provide any code so we can give you an hint :zipper_mouth_face: