This instructable is for the use of the SM5100B-D shield from sparkfun: https://www.sparkfun.com/products/9607
Its no good to you for the other GSM shields, Sorry.

I spent so, so long hacking at this stupid shield trying to make sense of the +SIND's  and other rubbish - these things do work, they just test your patience. The minimal and poorly written documentation is useful if not as frustrating, hopefully this will save you some time.

Dont take this all for gospel, Im not an electronics or programming whizz, I have just persevered and learnt a few things.
Please feel free to question anything written here and Ill try to update the instruct-able if you can contribute.

Step 1: Things to Consider

I have found some good resources,
The most useful being some actual working code:
A good intro into setup

Some things to note:
1) Software serial is not the best option, in my tests it doesn't keep up with the serial output from the GSM module, and if you cant keep up then the data is dropped and your stuck. Software serial is ok for grabbing the return codes from your AT commands but when it comes to receiving your actual data, like http responses - it just doesn't keep up at all. I have seen mention that the 9600 baud rate that the SM5100B-D is set to is not fast enough, I have not found this to be true, as long as I use a hardware UART I get all the data back from the shield.

2) Power - you cant run this shield from the Arduino Power - you just cant. I tried to ignore these warnings, dont waste your time. Feed it 5 volts from a transformer or battery capable of supplying 2-3 amps. You will find that if you dont it will just keep overdrawing on your Arduino when it goes to transmit and everything will just reset.

3) Antenna, you need one.
I have actually been able to get +SIND:4 without one, but I have been getting full reception with one of those tiny little duck Antennas - I got two for a couple of dollars right here:http://www.electrodragon.com/?product=quad-band-ce... For Australians - You can pick up an antenna from Jaycar - pricey but dont have to wait on delivery: http://www.jaycar.com.au/productView.asp?ID=AR3310

4) Documentation, the official AT command set documentation comes in handy, only the author truly knows what on earth he/she was trying to describe, its bad, real bad, but it comes in handy: https://www.sparkfun.com/datasheets/CellularShield...
I guess sparkfun wrote this more specific GPRS / IP stuff, as it kind of makes sense in comparison:

<p>I did and set up sms/call functions. I see all the sind commands, but after uploading this sketch I dont have any feedback in my serial monitor. No more sind, just messages from softwareserial pins. Did you have this issue?</p>
<p>Hey Thanks for all your info on this. I have successfully made connection to my web server. I'm no t a C coder either but I would love to look at your library and perhaps have a go at it with you. send me a message if you are interested</p>
<p>G'day,</p><p>Sorry to say I dropped the ball on this.</p><p>I really needed a GSM modem in the end form my project so got a 3g dongle and connected it to a beaglebone, was allot of hassle trying to work with AT commands and strings and such when I really just needed full blown tcp routing.</p><p>I can dig up the code I had started for the library if your interested, its fairly basic but maybe its a starting point if you wish to pursue it? Library had some test scripts as well. </p><p>I've zipped them up and I PM'd you, reply if your interested in what I have so far and ill send it.</p>
<p>Hi!</p><p>I am working on a project and your info has been really helpfull! Could you plz send me a copy of your arduino library?</p><p>thanks!</p>
<p>G'day Cristobalgh, were are you from mate?</p><p>I don't have your email so I have put it up on dropbox: <a href="https://dl.dropboxusercontent.com/u/57971816/5100B.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/57971816/5100B...</a></p><p>I don't remember what state the library is but I assume its as i left it.</p><p>Im not a great coder so its probably just a good reference for you to make your own code more than a fantastic library ready to use;) </p><p>Cheers</p><p>Ben</p>
<p>Hey, </p><p>Can I please ask why did you need the USB serial adapter. Couldn't you connect to the one UART you have? I have Arduino Due with 4 UART and having trouble connecting it properly to the shield? How should it be connected as I get no response on the serial monitor.</p><p>Thank you</p>
<p>I was using a uno with only one UART, I needed that one UART for the module to talk to the arduino but also wanted to wanted to debug via the serial monitor which needs a UART as well so I needed the extra FTDI serial connection, you wont need it as you have 4 on board - I have since taken to the mega 2560 so I dont need that any longer either.</p><p>Are you getting no response at all from your aduino or the arduino is showing no response from the GSM module?</p>
First Thank you.<br>On my cellular shield, the two connections that are soldered together are the two closest to the Rx Tx writing. According to the schematic and my understanding, this only enables the shield to send serial communication via ports 2,3. My connections:<br>Arduino Due connected to computer via USB.<br>Shield gets its power from 5v external power (capable of 2.5A) supply and both the shield and the board are connected to its ground.<br>Port 2 of shield connected to Tx1 of Arduino<br>Port 3 of shield connected to Rx1 of Arduino.<br>I have also tried to used ports 0,1 of the shield labelled Rx Tx and connect them to Arduino serial 1. Anyway still nothing appears on Arduino IDE serial monitor but starting serial communication. <br>Any help will be much appreciated...
<p>And did you try the amended code I added in the comment below?</p><p>I think port two on the GSM module is TX and should go to the RX of your arduino - I know that looks strange as the markings show RX TX for 0 &amp; 1 and so you would guess that it was RX TX for 2 &amp; 3 - but no its TX RX for pins 2 &amp; 3 on the GSM shield.</p><p>Try that simple swap first, then if no good - troubleshoot with some ideas below:</p><p>Connect TX0 to RX1, and RX0 to TX1 - then start the serial montitor</p><p>You should get the &quot;Starting SM5100B Communication...&quot; bouncing backwards and forwards between your serial connections and printing over and over on your serial monitor - If so your Code is working fine.</p><p>If so, then connect pin 2 of GSM Sheild (confusingly it seems pin two is TX not pin 3 as i would have guessed) to your Serial 1 RX and restart the shield and the arduino. </p><p>Also remember when your searching for the serial connection, restart the GSM sheild after making changes as it goes through its setup and then goes quiet, so you may not see anything and think its not working, but in reality its just waiting for you to talk to it - So reset gsm shield and see if you get any serial data. </p><p>If your not getting any serial data resembling </p><p>+SIND: 11</p><p>+SIND: 3</p><p>+SIND: 4</p><p>&ETH;&egrave;&ETH;&egrave;&ETH;</p><p>+SIND: 1</p><p>+SIND: 10,&quot;SM&quot;,1,&quot;FD&quot;,1,&quot;LD&quot;,1,&quot;MC&quot;,1,&quot;RC&quot;,1,&quot;ME&quot;,1</p><p>+STIN:0</p><p>+SIND: 4</p><p>then at this point then you need to work out why your GSM shield is not communicating. Even if your baud rates are mismatched you should at least get a whole lot of rubbish characters showing up. If you get nothing get your oscilloscope then probe the TX pin of the shield , if you don't have an oscilloscope consider buying one - you need one - even a super cheapie of eBay is worth every dollar * 1000, without a scope everything is just a big old guess).</p><p>Otherwise if you have a logic analyser you can use that to check the TX line from GSM Module, or maybe even get by with a multimeter. Or if you have a FTDI cable or other TTL serial to USB cable you can connect the RX of that to the TX of the GSM Module and see if you can capture any serial data. You really need to have at least one if not all of these test equipment options to work out whats going on - otherwise your just jumping pins everywhere in random combinations hoping something will work.</p>
<p>Hey Ben,</p><p>I did what you said and it does work. The problem was with the pins. Thank you for that. However, now I have another issue. I am trying to connect both the shield (serial 3 on Due) and a puprletooth jamboree bluetooth module (Serial2 on Due). When both are connected to Due only the BT module works and the cellular shield stops responding. Both are connected to an external power source. Any idea as to why? Is the board unable to drive both together?</p><p>Thank you. </p>
No, board can talk on all 4 serial connections almost at same time, it buffers incoming data so it can process it as it has time, I believe, either way I have communicated on all 4 connections before to test this theory and it's no prob. Please attach photo and code sample and I'm sure it's something I can see going wrong
<p>Maybe I know why theres nothing coming back to you, if you are using the code from step 4, you will need to remove the software serial part and just apply one of your other hardware serial UART ports instead so something like </p><p>#include <br>#define GSMSerial Serial1 // the hardware serial will now be known as GSMSerial</p><p>#define SMSerial Serial //</p><p>char incoming_char=0; //Will hold the incoming character from the software Serial Port.<br>void setup()<br>{<br>//Initialize serial ports for communication.<br>SMSerial.begin(9600);<br>GSMSerial.begin(9600);<br>SMSerial.println(&quot;Starting SM5100B Communication...&quot;);<br>}<br>void loop()<br>{<br>if(GSMSerial.available()&gt;0) //If a character comes in from the cellular module...<br>{<br>SMSerial.write(GSMSerial.read()); //write it out to the serial monitor so we can see it<br>}<br>if(SMSerial.available() &gt;0) //If you type something into the serial monitor<br>{<br>incoming_char=SMSerial.read(); //Get the character coming from the terminal<br>GSMSerial.print(incoming_char); //Send the character to the cellular module.<br>}<br>}</p><p><br></p><p>And then your serial (Serial 0) which comes out of the USB port (and pins 0&amp;1) will be your serial monitor connection and what ever ports your second UART (serial1) is connected to will be the ones you connect over to the GSM module.</p><p>Also - dont sit the GSM module on top of your arduino, sit it beside for testing and run link wires over to it like in my photo. The GSM module is using pins 0&amp;1 for its serial link, if you stick the boards together it will be talking to your aduino over the same pins (0&amp;1) that your arduino is talking to the computer on. </p><p>Sorry if this is obvious, but just in case your not aware - the USB serial interface, shares the pins 0 &amp; 1 - so you will find anything getting sent up and down the USB cable is also using those pins 0&amp;1, and if you try to use them for other purposes (by accidentally putting a shield on top which tries to use the same pins, like this GSM shield does)then there will be a big old miscommunication. </p><p>I guess this is where your problem is - let me know if its not the case.</p><p>So in short.</p><p>Use your USB for degugging via serial montor</p><p>Dont stack the shield on the top of your Arduino!</p><p>Use pins 19 (RX) and 18 (TX) on your due to connect to the GSM module</p><p>ANd lastly, when you put it all together in the end and want to be able to stack the shield on top without the pins 0&amp;1 double up, there is a trace on the GSM module that you can solder or desolder (forget the details) and it changes the pins that the GSM module is using - Youll have to read into that cause I have forgotten how it works</p>
<p>Great job! I'm also writing my TCP library (I need only a GET connection). Now I'm thinking which is the best method to capture an error from the module when connection is lost using the virtual serial port.</p><p>This is a part of my code.</p><p>void SerialTCP::sendData(String DOM, String URL)</p><p>{</p><p>String toReplace = GETCONST;</p><p>toReplace.replace(&quot;!&quot;, URL);</p><p>toReplace.replace(&quot;&lt;&quot;, DOM);</p><p>int l = toReplace.length() * 2;</p><p>int i = 0;</p><p>this-&gt;print(&quot;AT+SDATASEND=1,&quot;);</p><p>this-&gt;print(l);</p><p>this-&gt;print(&quot;,\&quot;&quot;);</p><p>while(i &lt; toReplace.length())</p><p>{</p><p>if(toReplace.charAt(i) == '(')</p><p>{</p><p>this-&gt;print(&quot;0A&quot;);</p><p>}</p><p>else</p><p>{</p><p>this-&gt;print(toReplace.charAt(i), HEX);</p><p>}</p><p>i++;</p><p>}</p><p>this-&gt;println(&quot;\&quot;&quot;);</p><p>}</p><p>Where GETCONST = &quot;GET /! HTTP/1.1(Host:&lt;((&quot;</p>

About This Instructable




More by BenHarper:End Stop / Limit Switch Problems Safetly use CLONE APM Power Modules SM5100B GPRS and General Notes 
Add instructable to: