PDA

View Full Version : Testing a GSM module via Mecanique's Serial Communicator - "terminator" issue?



flotulopex
- 22nd June 2020, 18:15
Hi All,

I'm currently testing a SIM800L GSM module and have no probelm at all to make it work via my 18f2431 PIC.

So, what's the problem?

In fact, I want to make this module work also via the Serial Comunicator from Mecanique but this seems just not possible.

Here is an example of a SMS message I want to send:

working with PIC: SEROUT PORTB.4,2,["AT+CMGS=",34,"+4179xxxxxx",34,10,"Hello Roger",26,10,13]

not working with serial com: "AT+CMGS="+4179xxxxxxx",10,"Hello Roger",26

Going back to basics, when I send a simple AT command and set the Serial Communicator to add a CR terminator, it will work.

If I select "no terminator" and try it like this AT,13 , nothing will happen.

How is the CR generated in the Serial Communicator? Does anyone know?

Ioannis
- 23rd June 2020, 08:37
When you type AT 13 (without the comma), the terminal will send 4 sequence of the ASCII equivalent (in decimal): 65 84 49 51. This is not what you want, right?

You want the number 13 be sent, not the 49 ('1') and 51 ('3').

Hope this helps,
Ioannis

richard
- 23rd June 2020, 08:48
"AT+CMGS="+4179xxxxxxx",#10,"Hello Roger",#26


or

"AT+CMGS="+4179xxxxxxx",$A,"Hello Roger",$1A

8888

Ioannis
- 23rd June 2020, 08:56
To add on Richard's post, if you insist on using the Serial Communicator, Help says this:

Parse Control Characters

When enabled, the parse control characters option enables you to send control characters in your message, using either a decimal or hexadecimal notation. For example, if you want to send hello world followed by a carriage return and line feed character, you would use hello world#13#10 for decimal, or hello world$D$A for hex. Only numbers in the range 0 to 255 will be converted. For example, sending the message letter #9712345 will be interpreted as letter a12345.

If the sequence of characters does not form a legal number, the sequence is interpreted as normal characters. For example, hello world#here I am. If you don't want characters to be interpreted as a control sequence, but rather send it as normal characters, then all you need to do is use the tilda symbol (~). For example, letter ~#9712345 would be sent as letter #9712345.


Ioannis

flotulopex
- 23rd June 2020, 10:15
Thanks guys,

I knew it, I knew it!!! :D

I should have read the communicator's help again - did it a few years ago but forgot the "hash" story... my bad :-\

Thanks again...

flotulopex
- 23rd June 2020, 10:23
When you type AT 13 (without the comma), the terminal will send 4 sequence of the ASCII equivalent (in decimal): 65 84 49 51. This is not what you want, right?

You want the number 13 be sent, not the 49 ('1') and 51 ('3')....

Thanks Ioannis for this good lesson. I effectively didn't realize that I was sending those "four individual" characters one-by-one.

Have a nice day :)

Ioannis
- 23rd June 2020, 11:30
You are welcome!

Ioannis

flotulopex
- 23rd June 2020, 17:09
"AT+CMGS="+4179xxxxxxx",#10,"Hello Roger",#26

Actually, the working syntax in the Serial Communicator is: AT+CMGS="+4179xxxxxxx"#10"Hello Roger"#26

Thanks Richard for your help :wink:

BTW, one of the AT commands manual I could find in the WEB says:

8891

Using the SIM800L GSM module, according to the "AT data sheet" (:D) I should have used a CR after the phone number. But by chance, I discovered that only a LF would work. Is it a typo or something wrong with my module, I don't know; fact is CR = NO, LF = YES!!!!

Ioannis
- 23rd June 2020, 17:32
I never faced such a problem with SIMcom modules.

CR is the necessary for line or command termination. LF does not that...

Are absolutely sure you send out LF instead of CR?

Ioannis

flotulopex
- 23rd June 2020, 17:58
Ioannis,

This is really strange, yes. It took me hours to find out that there was something strange.

But actually, to make it work, I use:

working with PIC: SEROUT PORTB.4,2,["AT+CMGS=",34,"+4179xxxxxx",34,10,"Hello Roger",26,10,13]

working with serial com: AT+CMGS="+4179xxxxxxx"#10"Hello Roger"#26

If I replace the 10 or #10 by a 13 or #13, it will not work anymore.

Nope, no idea what's wrong but "yes", I'm sure I use LF instead of CR.

flotulopex
- 23rd June 2020, 18:03
Sure is sure so I just checked again.

See whats happens with CR instead of LF:

8892

Ioannis
- 23rd June 2020, 18:28
Do you have other terminal program to test? My suspicions fall on MCSP serial communicator.

Ioannis

flotulopex
- 23rd June 2020, 21:51
I'll give it a try with PUTTY and HYPERTERMINAL although I don't know how to send control characters with those programs too :(

But why would it be the problem of my serial program since I need to do the same when I use the PIC?

working with PIC: SEROUT PORTB.4,2,["AT+CMGS=",34,"+4179xxxxxx",34,10,"Hello Roger",26,10,13]

As you can see, here too I need to use a Line Feed instead of a Carriage Return !?

Ioannis
- 23rd June 2020, 22:19
You are right.I missed that.

Well, I don't know what is wrong. I remember once, was testing on a SIM900 module with no problems on this. Sure a CR was needed to terminate the command.

For a couple of days I'll be out of town. On my return I will find it and give it a test again.

Ioannis

flotulopex
- 23rd June 2020, 22:30
My module's firmware is Revision:1418B02SIM800L24

flotulopex
- 24th June 2020, 13:55
...and this the exact module I'm using.

8893

Ioannis
- 13th July 2020, 08:52
Finally I found the module and time to test the SIM900 board.

Unfortunatelly, while on Power up the module sends what is expected to send, it does not respond to the commands I send.

Tried any combination but failed to reply back...

Sorry but could not help.

Ioannis

flotulopex
- 13th July 2020, 16:20
Thank you Ioannis.

I'm awaiting a SIM5360EVB and I will try again if the LF or CR makes the difference.