Components used:
Arduino Mega 2560
Sim900A GSM Module.
The sketch im using is :
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#define TINY_GSM_MODEM_SIM900
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "token";
// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[] = "apn";
char user[] = "";
char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1
// or Software Serial on Uno, Nano
//#include <SoftwareSerial.h>
//SoftwareSerial SerialAT(2, 3); // RX, TX
TinyGsm modem(SerialAT);
WidgetMap myMap(V1);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set GSM module baud rate
SerialAT.begin(115200);
delay(3000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
Serial.println("Initializing modem...");
modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass);
// If you want to remove all points:
//myMap.clear();
int index = 1;
float lat = 51.5074;
float lon = 0.1278;
myMap.location(index, lat, lon, "value");
}
void loop()
{
Blynk.run();
}
The problem is that I’m not able to connect to the Internet. The picture of SM is Attached Below…
Thanks in Advance.
the gsm shield has a powerful psu? it needs more power when turning on gprs communication
there is a debug sketch example in the arduino ide tinygsm library. there you can manually test at commands with the gsm module. try to turn on gprs with at commands and check if it works.
@Gunner @wanek
It worked properly
But i need one more help from you guys is that when I’m connecting Gps module on serial2 its not responding…
Thanks in Advance
Serial monitor is connected to Serial (the USB port) … the actual GSM data connection is Serial1 (Pins 18,TX-19,RX), so possible to get as far as he has without actual Server connection, if RX/TX not properly wired, etc.
true. but i mean that if the gsm serial is not properly wired, than can not communicate to the arduino the name of the network and the connection status.
so the arduino couldn’t pass that info to the serial monitor…
@Gunner
Finally i get connected to the internet and gps also gives the coordinates but the main issue is that sometimes gsm connected to net very frequently and works fine and sometimes it keeps try connecting and gives error… whats the issue?