Pages: [1] 2   Go Down
Author Topic: TC35 GSM module does not respond to "AT" command  (Read 3889 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I am testing my new TC35 GSM module.

When i send "AT" to the module it does not respond with "OK".

But it respond with: "ÿ"

Txd0 of the module is connected with pin 2(softwareSerial Rx) on my Arduino Uno.

Here's my code:
Code:
#include <SoftwareSerial.h> 
char gsm_char=0;      //Stores character from the gsmSerial
String content = "";

SoftwareSerial gsmSerial(2,3);  //Creates software serial port(rx,tx)
 
void setup()
{
  //Initialize
  Serial.begin(9600);
  gsmSerial.begin(9600);
  Serial.println(" TC35 ready");
 
}
void loop() {
 
    if(Serial.available() > 0)
    {
      gsm_char = Serial.read();       
        //Evaluate input.
      if(gsm_char=='t')//Checks input char = t
        {         
          Serial.println("t received");
         
          gsmSerial.print("AT\r\n"); //Send AT TO GSM module           
          delay(500); // wait a moment
         
          gsm_char = gsmSerial.read();
          Serial.println(gsm_char);     
        }
         
     }
     
 }


Thanks!

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It could be wrong baud rate.

By the way, the line:
Code:
         
gsm_char = gsmSerial.read();
Serial.println(gsm_char); 
only read a single character.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The default baud rate is 9600 ...

Still no response...
Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
void loop() {
 
    if(Serial.available() > 0)
    {
      gsm_char = Serial.read();       
        //Evaluate input.
      if(gsm_char=='t')//Checks input char = t
        {         
          Serial.println("t received");
         
          gsmSerial.print("AT\r\n"); //Send AT TO GSM module           
          delay(500); // wait a moment
         
          gsm_char = gsmSerial.read();
          Serial.println(gsm_char);     
        }   
     }
 }

You may try waiting for a longer "moment". Instead of 500 you could put 5000, yes five seconds, at least once.

I notice you use print("AT\r\n"): why not println("AT")? Maybe you are right in doing so, but since the sequence \r\n (cr-lf) is often confusing in AT commands you may also try print("AT\r") and print("AT\n").

There is a logic in the program's behavior (perhaps not the one you intended): after sending the command and waiting for 1/2 sec you read a character from the gsm without checking for gmsSerial.available() first. So if there is no answer gsmSerial.read() will return -1, translated by the serial monitor into that glyph (try Serial.println(gsm_char, DEC) to see its value as a number).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still the same problem.

It seems that gsmSerial.available is not true.
Code:
if(gsm_char=='t'){
     
        gsmSerial.print("AT\r");  //Send test command
        delay(5000);
     
         if (gsmSerial.available() > 0 ){
            gsm_char = gsmSerial.read();
            Serial.println(gsm_char,DEC);
          }
    }

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Although the the checking of available character is perform after 5 s, there could be possibility that the character comes in after 5 s although it's rather unlikely. In that case, you serial check will return zero.
Why not doing something simpler like this:
Code:
if (Serial.available() > 0)
{
  gsmSerial.write(Serial.read());
}

if (gsmSerial.available() > 0)
{
  Serial.write(gsmSerial.read());
}

Whatever you type on the PC should be relayed to the modem and vice versa.
If this fails, it could be something simple like inadequate current of the power supply or a GND is not connected between the boards.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still the same problem...  smiley-confuse
I can not go in this part of the loop:
Code:
if (gsmSerial.available() > 0)
{
  Serial.write(gsmSerial.read());
}


Ground of the TC35 module is connected to the ground of the Arduino...

The TC35 module is powered by a adjustable power supply witch is set to 5V DC & max 1A.

On the display of the power supply i can see the current swing between 20 - 80 mA...
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did read some thread over the net, some saying it the default baud rate is 19200 bps for this modem.
Not sure whether this is true, but worth trying out?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

unfortunately it does not work with 19200 bps.
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another thing to try would be shorting the CTS & RTS together.
Some modem enabled these handshake on default setting based on my experience.
Worth a try I guess.

And are you sure 1 A is enough? Usually most module out there range from 1.8 - 2.5 A (Sierra, Cinterion, SIM, uBlox).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I connected the CTS0& RTS0 to each other but i don't see a difference in the serial monitor.

Yes maybe 2A is required in some situations but now it's only using 90 mA at max ?

« Last Edit: March 10, 2013, 09:18:49 am by drled » Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had a quick look at the TC35 manual and I think you shouldn't overlook the fact that the serial interface operates at 2.65V. The Uno's serial operates at 5V. Apart from communication problems (also arising from the differences between CMOS and TTL levels), you are running the risk of damaging your GSM module. You may want to search for more information on signal conversion before returning to the software issue.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Forgot to mention this earlier.
I have a TC35 module which already has a level converter on it( MAX232E ).

This is the exact module that i bought:
http://www.ebay.com/itm/GSM-SIEMENS-TC35-SMS-Wireless-Module-UART-232-TC35I-MC35I-ge-/281035188132?pt=LH_DefaultDomain_0&hash=item416f00a7a4

Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Forgot to mention this earlier.
I have a TC35 module which already has a level converter on it( MAX232E ).

This is the exact module that i bought:
http://www.ebay.com/itm/GSM-SIEMENS-TC35-SMS-Wireless-Module-UART-232-TC35I-MC35I-ge-/281035188132?pt=LH_DefaultDomain_0&hash=item416f00a7a4

Good. Then how is it connected? You only said that Txd0 of the module is connected with pin 2 on the Arduino, no mention of where the tx of the Arduino (pin 3 in your code) is going. Also you talk of Txd0 and that gives me the impression you are bypassing the level converter and connect directly to the GSM module, but without manuals or schematics it's hard to tell.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.sainsmart.com/zen/documents/20-012-100/GSMV1.pdf
This is the schematic of the module.

Right now i have 4 wire's connected to the Tc35 module:

+5V from the power supply is soldered to JP4 VCC.
Ground from the power supply is soldered to JP4 Ground.

Pin 2 arduino(SofttSerial Rx) --> Rxd0 JP6
Pin 3 arduino (SoftsSerial Tx) --> Txd0 JP6.

There's an extra wire between the ground of the arduino to the ground of the TC35.
Logged

Pages: [1] 2   Go Up
Jump to: