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 can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. Isolerende mortels

This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: Warmtepompen Alken

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Zonnepanelen kopen

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Ramen en deuren plaatsen

Thank you for some other informative website. The place else may just I get that kind of information written in such a perfect method? I have a venture that I am simply now running on, and I’ve been at the glance out for such info. Ramen en deuren

Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. Zonnepanelen Qcells

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. Warmtepompen Lummen

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Aluminium ramen deuren

Pages