Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:58 29 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : SIM900- Why AT command appear in message?

Author Message
Eloclegin
Newbie

Joined: 01/07/2012
Location: United Kingdom
Posts: 25
Posted: 06:04am 22 Nov 2014
Copy link to clipboard 
Print this post

Hello everyone,

Does anyone know why AT commands should appear in outgoing sms messages with a SIM900 gsm module?

I have just switched from using Sim340 module with a DuinoMite which has all worked well. I have changed the GSM module to a new SIM900 and when running the same short test code to send an outgoing SMS message, I find that (unlike with SIM340) I have all the AT commands appearing at the front of the text message prior to the message text itself.

Is there some function that needs to be set in SIM900 to disable this? I have been through the AT command set and I can see nothing to do this.

FYI, the simple stub I am using is listed below (with my cellphone number crossed out) and I have used this many times elsewhere with other modules with no issue

OPEN "COM4:19200" AS #1
PRINT#1,"AT+CMGF=1":pause 250 'set to text type mode and not pdu mode default
PRINT #1,"AT+CNMI=2,2,0,0,0":pause 250 'set so data is automatically forward to buffer to be read
outmessage$="Hello world"
destinationnumber$="+xxxxxx235440"
PRINT #1,"AT+CMGS="+CHR$(34)+destinationnumber$+CHR$(34)+CHR$(13)+ OutMessage$+CHR$(26)


I get an OK back from each command including the CMGS. And no ERRORs returned.

But message received is: AT+CMGF=1AT+CNMI=2,2,0,0,0AT+CMGS="+xxxxxxxxx"Hello world
Instead of just: Hello world

Anyone seen this before? Thank you in advance for your assistance




 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 06:55am 22 Nov 2014
Copy link to clipboard 
Print this post

Sounds like they're being echoed. Is there an echo off setting?

John
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 09:21am 22 Nov 2014
Copy link to clipboard 
Print this post

try ATE0 to turn echo off...

PRINT#1,"ATE0"

That's a zero after the EEdited by viscomjim 2014-11-23
 
Eloclegin
Newbie

Joined: 01/07/2012
Location: United Kingdom
Posts: 25
Posted: 11:08am 22 Nov 2014
Copy link to clipboard 
Print this post

Thanks for the suggestion but unfortunately, I have already tried that. It does not fix it.
I just get the added ATE0 command appearing too!

I just double checked again.

Any other thoughts?
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 11:57am 22 Nov 2014
Copy link to clipboard 
Print this post

Nigel,

Have you tried using a USB-to-serial convertor direct to the SIM900 and then use something like TeraTerm to send the commands to the SIM900 (i.e. cut out the Duinomite).

Does the same 'echoing' appear with TeraTerm??

WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Eloclegin
Newbie

Joined: 01/07/2012
Location: United Kingdom
Posts: 25
Posted: 04:47am 24 Nov 2014
Copy link to clipboard 
Print this post

Just tried it with terminal directly into SIM900 module. Still no change. All AT commands written still appear in the message text as the first part of the message.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9063
Posted: 01:14pm 24 Nov 2014
Copy link to clipboard 
Print this post

Hi there.

Have you read this thread?

It deals with the ElecFreaks module, but it uses the same SIM900 cell module.

Here is a copy of a log-file of my testing earlier:

[Quote=SIM900]
+CMGL: 17,"REC READ","+640000000659","","14/10/16,14:54:59+52"
Received loud and clear

AT
OK
AT+CNMI=?
+CNMI: (0-3),(0-3),(0,2),(0-1),(0-1)

OK
AT+CNMI?
+CNMI: 2,1,0,0,0

OK
AT+CNMI=2,2,0,0,0 'Set module to auto-route incoming text to serial port
OK

+CMT: "+640000006434","","14/10/16,17:09:35+52"
Hello module.


Note that you SHOULD be seeing the +CMT, the number and the date on the first line of the received message - this is just how it is done. You SHOULD NOT be seeing any of the configuration AT commands though - perhaps post a copy of YOUR results verbatim, so that we can see exactly what your module is outputting if it is different from above.

Extracting only the text message is not that difficult, if that is all you want.

EDIT: Just re-read your OP, and see that the problem is not with the module receiving text, but the other cellphone is showing all the AT commands. That is odd. By default, that does not happen - see the other thread I linked to. Issue a couple of commands, and the text messages are away to the other phone just as they should be.

Has anyone played with that module BEFORE you got your hands on it, or is it brand new?

Could be worthwhile doing a factory reset on it to make sure you are back at square one, then issue your commands. AT&F0<cr>

Also, try issuing this command with TeraTerm: AT+CSDH=?

That should return a ZERO. If this command returns a 1, then "Show SMS text mode parameters" has been set at some point. Set this to zero with AT+CSDH=0


Edited by Grogster 2014-11-25
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024