Go Down

Topic: No response at all from Sparkfun cellular shield - SOLVED (Read 601 times) previous topic - next topic

Jun 29, 2013, 01:10 am Last Edit: Jul 11, 2013, 10:37 am by kenny_devon Reason: 1
Hi guys,

I have the Sparkfun SM5100B-D shield sitting on an Uno. It's connected to the PC using the USB. That is the only power source at present - no external power to the shield. I'm using a very lightly modified version of the suggested Hello World sketch, as follows:

Code: [Select]
#include <SoftwareSerial.h>  //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>         //Used for string manipulations

char incoming_char=0;      //Will hold the incoming character from the Serial Port.

SoftwareSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.

void setup()
{
  //Initialize serial ports for communication.
  Serial.begin(9600);
  delay(3000);
   
  //Let's get started!
  Serial.println("Starting SM5100B Communication...");
  cell.begin(115200);
  Serial.println("after cell begin");
}

void loop() {
  //If a character comes in from the cellular module...
  if(cell.available() >0)
  {
    incoming_char=cell.read();    //Get the character from the cellular serial port.
    Serial.print(incoming_char);  //Print the incoming character to the terminal.
  }
  //If a character is coming from the terminal to the Arduino...
if( Serial.available( ) > 0)
{
incoming_char = Serial.read( ); // Get the character coming from the terminal
if(incoming_char == '~'){ // If it’s a tilde…
  Serial.print("tilde");
  incoming_char = 0x0D;      // ...convert to a carriage return 
}

else if( incoming_char == '^') // If it’s an up caret…

incoming_char =  0x1A;    // ...convert to ctrl-Z 

cell.print( incoming_char ); // Send the character to the cellular module.
Serial.print( incoming_char ); // Echo it back to the terminal
}

}


I'm getting the two startup messages, and anything I type is reflected back to me, but nothing comes from the shield - no SIND messages - nothing at all.

I've looked at the forums, and it seems that Sparkfun sometimes do not set the baud rate to 9600 as advertised, but leave it at the factory setting of 115200. You cant simply switch the code to use 115200 because apparently the Softwareserial library cant handle that. Apparently to get round this you can use other serial connections to form an initial connection with the SM5100 which then allows you to reset the comms rate to 9600. However it's not explained at a level I can understand, and I'm not sure yet if this is indeed the problem.

In the first instance can you help me determine if a baud rate incompatibility is in fact the problem?

(There's a lot of other chatter about power supplies, so I hope I haven't blown something, or starved it of power, simply by trying to switch it on!!)

Thanks,

Kenny

johnwasser


I've looked at the forums, and it seems that Sparkfun sometimes do not set the baud rate to 9600 as advertised, but leave it at the factory setting of 115200. You cant simply switch the code to use 115200 because apparently the Softwareserial library cant handle that. Apparently to get round this you can use other serial connections to form an initial connection with the SM5100 which then allows you to reset the comms rate to 9600. However it's not explained at a level I can understand, and I'm not sure yet if this is indeed the problem.

The Software Serial documentation says that it can handle 115200.


(There's a lot of other chatter about power supplies, so I hope I haven't blown something, or starved it of power, simply by trying to switch it on!!)


The cellular shield gets power from the Vin pin of the Arduino.  If you power the Arduino from the USB cable there is no power on the Vin pin.  Is the red LED (near the 6-pin voltage regulator) turning on?

Get a 7V-9V (roughly 1A) power brick (a.k.a "wall wart") and plug it into the power jack.  Alternatively you can get a battery holder that takes 6 AA cells and connect that to the power jack or Vin pin.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

proto-pic

We set one of these up this morning - uploaded the following sketch, and connected with a serial monitor at 9600 BAUD, All the relevant responses were shown (ZEROs without a card & ONEs with a SIM)

Code: [Select]

/*
SparkFun Cellular Shield - Pass-Through Sample Sketch
SparkFun Electronics
Written by Ryan Owens
3/8/10

Description: This sketch is written to interface an Arduino Duemillanove to a  Cellular Shield from SparkFun Electronics.
The cellular shield can be purchased here: http://www.sparkfun.com/commerce/product_info.php?products_id=9607
In this sketch serial commands are passed from a terminal program to the SM5100B cellular module; and responses from the cellular
module are posted in the terminal. More information is found in the sketch comments.

An activated SIM card must be inserted into the SIM card holder on the board in order to use the device!

This sketch utilizes the NewSoftSerial library written by Mikal Hart of Arduiniana. The library can be downloaded at this URL:
http://arduiniana.org/libraries/NewSoftSerial/

This code is provided under the Creative Commons Attribution License. More information can be found here:
http://creativecommons.org/licenses/by/3.0/

(Use our code freely! Please just remember to give us credit where it's due. Thanks!)
*/

#include <NewSoftSerial.h>  //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>         //Used for string manipulations

char incoming_char=0;      //Will hold the incoming character from the Serial Port.

NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.

void setup()
{
  //Initialize serial ports for communication.
  Serial.begin(9600);
  cell.begin(9600);
 
  //Let's get started!
  Serial.println("Starting SM5100B Communication...");
}

void loop() {
  //If a character comes in from the cellular module...
  if(cell.available() >0)
  {
    incoming_char=cell.read();    //Get the character from the cellular serial port.
    Serial.print(incoming_char);  //Print the incoming character to the terminal.
  }
  //If a character is coming from the terminal to the Arduino...
  if(Serial.available() >0)
  {
    incoming_char=Serial.read();  //Get the character coming from the terminal
    cell.print(incoming_char);    //Send the character to the cellular module.
  }
}

/* SM5100B Quck Reference for AT Command Set
*Unless otherwise noted AT commands are ended by pressing the 'enter' key.

1.) Make sure the proper GSM band has been selected for your country. For the US the band must be set to 7.
To set the band, use this command: AT+SBAND=7

2.) After powering on the Arduino with the shield installed, verify that the module reads and recognizes the SIM card.
With a terimal window open and set to Arduino port and 9600 buad, power on the Arduino. The startup sequence should look something
like this:

Starting SM5100B Communication...
   
+SIND: 1
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"ME",1

Communication with the module starts after the first line is displayed. The second line of communication, +SIND: 10, tells us if the module
can see a SIM card. If the SIM card is detected every other field is a 1; if the SIM card is not detected every other field is a 0.

3.) Wait for a network connection before you start sending commands. After the +SIND: 10 response the module will automatically start trying
to connect to a network. Wait until you receive the following repsones:

+SIND: 11
+SIND: 3
+SIND: 4

The +SIND response from the cellular module tells the the modules status. Here's a quick run-down of the response meanings:
0 SIM card removed
1 SIM card inserted
2 Ring melody
3 AT module is partially ready
4 AT module is totally ready
5 ID of released calls
6 Released call whose ID=<idx>
7 The network service is available for an emergency call
8 The network is lost
9 Audio ON
10 Show the status of each phonebook after init phrase
11 Registered to network

After registering on the network you can begin interaction. Here are a few simple and useful commands to get started:

To make a call:
AT command - ATDxxxyyyzzzz
Phone number with the format: (xxx)yyy-zzz

If you make a phone call make sure to reference the devices datasheet to hook up a microphone and speaker to the shield.

To send a txt message:
AT command - AT+CMGF=1
This command sets the text message mode to 'text.'
AT command = AT+CMGS="xxxyyyzzzz"(carriage return)'Text to send'(CTRL+Z)
This command is slightly confusing to describe. The phone number, in the format (xxx)yyy-zzzz goes inside double quotations. Press 'enter' after closing the quotations.
Next enter the text to be send. End the AT command by sending CTRL+Z. This character can't be sent from Arduino's terminal. Use an alternate terminal program like Hyperterminal,
Tera Term, Bray Terminal or X-CTU.

The SM5100B module can do much more than this! Check out the datasheets on the product page to learn more about the module.*/



If I found the above not to work at 9600 - I would go through all the speeds to find a working speed. If it did not work, then I would be looking to call the supplier,
to request help or an exchange.

Drew Anderson
Support Engineer
Engineering Support team for Proto-PIC.co.uk

Proto-Pic

The red light on the shield was on - not a power supply problem.
The introductory Serial.println messages of the sketch were appearing, but none of the expected SIND  responses appeared. 

Got back to my supplier - Proto-pic.

Since there was nothing from the shield, n ot even garbled messages which might have indicated a mismatch of baud setting between shield and sketch - Proto-pic diagnosed a dud shield. They immediately replaced it and the replacement worked right away.

Thanks John and Drew

Kenny

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy