Macchina and GSM connection

How to get Macchina connected to the internet via a GSM shield.

There are several GSM shields out there, all with very similar features. We decided to use this one, since it was easy to get ahold of.

Available here:

http://www.seeedstudio.com/depot/gprs-shield-v20-p-1379.html?cPath=19_20

and again, amazingly enough, at RadioShack (?!) although this is an older version:

http://www.radioshack.com/product/index.jsp?productId=16518376

First thing to do is set up the hardware.

Insert a SIM card. [More on this later]

Next, decide on how to connect the shield to the Macchina.

The Seeedstudio shield doesn't reach the spare hardware serial lines on the Macchina, so you'll need to run two jumper wires from the shield to TX1 and RX1 on the Macchina. Having spare hardware UARTs is nice, as the other option is software serial, which takes up valuable flash, RAM, and CPU cycles.

Now it is time to set up the libraries:

We're working from library built for a different GSM shield, but it works very well with this shield after some slight modification. It can be found here:

https://code.google.com/p/gsm-shield-arduino/

Just get the latest from Downloads. The Readme file is pretty good, and the examples are also good places to start.

Macchina has the same pinout as the Mega 2560, so you'll want to make sure the "#define 2560" lines are uncommented in HWserial.h and GSM.h, and comment out the "#define UNO" line in GSM.h.

One more thing: There's a rather crucial error in the httpPOST() method in inetGSM.cpp. Lines 101-103 should be:

gsm.SimpleWrite("\r\n\r\n");
gsm.SimpleWrite(parameters);
gsm.SimpleWrite("\r\n\r\n");

I don't know if they dealt with some really permissive servers or what during their development, but most servers need a double carriage return + newline after the HTTP header, and not just newlines. I'll submit a patch to them with the fix, or add an issue to the project.

Once these step are done, we can start coding. To be continued...

Comments

I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information. Zwembadbouwer Limburg

Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! Zwembad tuin

Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. Horeca koeling

Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. Koeling

It is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks. LPW zwembaden

You have performed a great job on this article. It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much. Vloerisolatie

Hey, I am so thrilled I found your blog, I am here now and could just like to say thank for a tremendous post and all round interesting website. Please do keep up the great work. I cannot be without visiting your blog again and again. Frigobouw

I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Chape

Awesome dispatch! I am indeed getting apt to over this info, is truly neighborly my buddy. Likewise fantastic blog here among many of the costly info you acquire. Reserve up the beneficial process you are doing here. Warmtepomp

Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot. I was seeking this particular information for a very long time. Thank you and good luck. Aqua Pura

Thank you for some other informative blog. Where else could I get that type of information written in such an ideal means? I have a mission that I’m just now working on, and I have been at the look out for such information. Zwembad aanleggen tuin

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. Zwembad plaatsen tuin

Pages