Go Down

Topic: SMS length issues with the SM5100B from sparkfun? (Read 2316 times) previous topic - next topic



I've got an arduino (mega) project that sends SMSs. I've just switched from using a SMS shield based on the telit GE863-QUAD modem from HW kitchen to one based on the SM5100B device from sparkfun. The whole project worked fine for many months using the GE863, but now I've switched to the SM5100B I've come across an annoying issue. I can still happily communicate with the SM5100B, I can read the IMEI, IMSI, serial number, signal strength, network name and all the normal stuff, I can receive and process SMSs and I can even send most SMS messages, however I can not send SMSs more than 140 characters long! The normal maximum size for a text is message is 160 characters, and I can still send messages this big from the GE863 modem.

This is how I send a message....
Step 1 - send 'AT+CMGF=1' to set 'text' mode and wait for an 'OK' (I do this for every message I send)
Step 2 - send  'AT+CMGS="my phone number"' and wait for a right arrow '>'.
Step 3 - send the text of the message and wait for '+CMGS'.

This works fine for short SMS's, but above 140 characters I get "+CMS ERROR: 305" after step 3. The description for this error is "Invalid text mode parameter", I've had this in the past and it normally means I've forgotten to send 'AT+CMGF=1', but not in this case! I've also had the error when I've accidentally included a non-ascii character in the message, but even if my message is all 'a's I still get the same error.

I'm using the SM5100B  at 9600 baud, but I still get the same problem at different rates.  I'm getting no other error messages, the output from the modem looks 100% normal except for the fact that the message fails!

Can anyone help? My whole project is based around using in full length messages, and if I can't this fixed I've got to take a major step backwards!



Out of sheer desperation I decided to RTFM and found this snippet....
Text: content ahead (0…9,A…F), if dcs(by AT+CSMP)is a 7bit ASCII
character, its length range is 0-160; if dcs is a 8bit ASCII character, or its
length range is 0-140; if dcs is a UCS2 character, or its length range is 0-140.

I think that this means that if I'm using 7 bit ASCII characters then a 160 character message should be possible. Since I'm getting an error above 140 characters I guess I must be working with 8bit ascii or UCS-2 characters.
Reading further it seems I can change the character set using AT+CSMP. Page 67 shows the options....
Coding description of <dcs> information with a default value of 0.
dcs description
0   Default alphabet
1   8 bit data
2   UCS2

I've tried all 3 options, none of them seem to make any difference to the error I'm getting.

Any suggestions? I can't be the only one using this module to send messages more than 140 characters?



I think this has to do with PDU & Text Mode SMS.
I haven't personally try the PDU mode, but I think, only in that mode, 160 characters can be sent.


Hi B....D.....,
I am having exactly the same problem as you are. It looks like the dcs mode in the AT+CSMP command is set correctly. But it reads the text as 8 bit.
If you get any solution to this please send it here.

I will try some options and if I find one that works I will post it here.


I was having a similar problem using the HW kitchen board and the telit GE863-GPS module.  The telit was configured for SELINT=2, #SMSMODE=0 and +CMGF=1 (Text mode).  I was able to send SMS that were 160 char long without any problems.  However, one corrupted message contained some characters with the 8th bit set - 8 bit chars.  When this happened, I received the ERROR 305  - invalid text mode parameter.  Once I masked out the 8th bit, the error went away.  You may want to double check to make sure that no 8 bit chars are in your message stream - IMHO.

Go Up