MarcoMartines / GSM-GPRS-GPS-Shield

GSM/GPRS & GPS Shield Library for modules using SIM900/SIM908
GNU General Public License v2.0
208 stars 152 forks source link

Library doesn't work on MEGA 2560? #20

Closed ronistiawan closed 9 years ago

ronistiawan commented 9 years ago

What I need to do to make this library work on Arduino MEGA 2560? I've followed the instructions, but still not work. this is the error i got ====================================ERROR================================ GSMSHIELD\HWSerial.cpp:63:12: error: 'prog_char' does not name a type

  const prog_char *p = (const prog_char *)ifsh;

I also have tried to change "prog_char" to "char PROGMEM" and ... this is what i got in terminal..

ATT: OK RIC: DB:NO RESP DB:NO RESP

What is wrong?

ronistiawan commented 9 years ago

and now the problem is changed. It able to send and receive message, but always failed to connect to the internet. (The sim card is working perfectly on my phone).

bharathhs2290 commented 9 years ago

Dear ronistiawan are you now able to compile and work with this library on mega board?

ronistiawan commented 9 years ago

Yes. I made some changes in the library. Thanks for your response.

bharathhs2290 commented 9 years ago

Can you please let me know what are those changes, it'll be of great help for me.

ronistiawan commented 9 years ago

Open GSM.cpp and HWSerial.cpp. and do some modification showing below GSM.cpp see line 37:

ifdef MEGA

GSM::GSM(){ _cell.begin(4800); };

HWSerial.cpp see line 4:

ifdef MEGA

HWSerial::HWSerial(){ Serial1.begin(4800);
}

You also need to change gsm.begin(2400) to gsm.begin(4800) in your arduino sketch.

source: http://www.gsmlib.org/forum/viewtopic.php?t=38&f=8&sid=3c3ca15b4d0d24c034091c3c74f38cf5#p161

hope it helps you :)