Connecting problem

Hi, my hardware is arduino uno and GSM shield by keyestudio. Problem with connection - I try to connect to blynk cloud, (starting with simple blynk example SIM900 from “examples”) and I see very strange ping and permanent “Connecting to blynk-cloud.com:8442
With other SIM I had the same problem. Once (year ago, maybe) I had this problem and I solved it by installation time on SIM900, but, now this approach does nor work.
What coud I do with it? Here is code and screenshot. Thanks!
P.S. On my phone I have some notifications, that blynk is “alive”,but after 1 second disconnects.

/* 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[] = "0d0e0b22ee**************";

// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[]  = "mts-internet";
char user[] = "mts";
char pass[] = "mts";

// Hardware Serial on Mega, Leonardo, Micro

// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(2, 3); // RX, TX
TinyGsm modem(SerialAT);
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);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

Screenshot_5

1 Like

Are you using an older library?? That port has been replaced with 8080

Maybe, it is library, I will check it out tomorrow, but for now as I found out, that I have to reduce speed of SIM900 shield FROM 115200 TO 9600 and now it works (at least 1-2 reconnectings for 2-3 hours, that is not critical).
Thanks for information about port and library!

Sorry, I should have mentioned that… it is a common issue with shield type communication over SoftwareSerial

Hello, Gunner, do you have any idea about such high ping? (I updated Blynk library(by library manager in arduino IDE) and now it connects to port 80 (not 8080 but to 80)) Maybe this port 80 is not the same with 8080 and problem is with library?
My project works with this ping but when there is too “many” information to be send from client it begin reconnect. This is just unconfortable (I mean, all works but with this feature)))
May I change port to 8080 manually?(if it necessary)
I added this: Blynk.begin(auth, modem, apn, user, pass, “blynk-cloud.com”, 8080 );, but ping is similar(
Screenshot_6
Thanks!

1 Like

For the cloud, port 80 is correct… yes, 8080 will work as well, but no difference.

Ping is entirely dependent on your GPRS network, region, and/or possibly even the type of modem you are using.

2 Likes

Thanks!!!