Hi there, My SIM900 GSM module isn’t connecting to the Blynk server. Getting the following o/p on the Arduino serial monitor. Appreciate any help.
[365305] Connecting to blynk-cloud.com:8442
My code below============================================================
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30
// Select your modem:
//#define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808
#define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_A6
// #define TINY_GSM_MODEM_A7
// #define TINY_GSM_MODEM_M590
// #define TINY_GSM_MODEM_ESP8266
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
const char auth[] = "12c1f92658864171b3c1aef130e1a5de";
// Your GPRS credentials
// Leave empty, if missing user or pass
const char apn[] = "everywhere";
const char user[] = "";
const char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro
//#define SerialAT Serial1
// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(7, 8); // RX, TX
TinyGsm modem(SerialAT);
void setup()
{
// Set console baud rate
Serial.begin(115200);
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();
String modemInfo = modem.getModemInfo();
Serial.print("Modem: ");
Serial.println(modemInfo);
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass);
}
void loop()
{
Blynk.run();
}
Try different pins… UNO usually works fine with 2 & 3 or 10 & 11 And of course make sure the RX of the UNO goes to the TX of the module, and vice versa.
Just changed to 2,3 and to give you an idea. This what I am seeing on the serial monitor. The same as before. Looks like the connection is failing at the server.
[12759] Modem init…
[13698] Connecting to network…
[13993] Network: EE
[13993] Connecting to everywhere …
[20528] Connected to GPRS
[20797] Connecting to blynk-cloud.com:8442
[31333] Connecting to blynk-cloud.com:8442
You do have a Cloud Server account, right? and have created a Project and received the token, etc… Have you ever had a connection to your server account with any other MCU?
Is there a possibility that your GSM module is connecting to a different server, due to however your mobile service provider works?? I guess you can try pinging blynk-cloud.com from your PC and force using that IP in your sketch.
ok, i’m on phone now, but if you google sim900 firmware version, it will eventually give you an at command, like AT+GSV.
you can upload the sketch in the built in tinygsm library example (in arduino ide menu) to use at commands, and you can introduce there. some sim900 modules have VERY old fw and can not handle all commands for gprs.
i’m not sure if this is your problem actually, but post here the fw version you have.