Modem SIM7600 not connecting to blynk cloud

Hi,

I am using SIM7600X 4G modem with Arduino Mega and trying to connect to blynk.cloud at port 80 & 8080. I am using T-mobile 4G LTE SIM and it is connecting to APN & GPRS successfully. But after that, I am continuously getting “Connecting to blynk.cloud:8080” & “Connecting to blynk.cloud:80” these messages and modem is not connecting to blynk cloud.

I have tried the below lines of code and different IP addresses (45,55,96,146 & 64,225,16,22) as well but still it doesn’t work.
Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass, IPAddress(45,55,96,146),8080);
Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass);
Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass, “blynk.cloud”, 80);

Please find my code & screenshot of serial monitor below.

/*************************************************************

  Attention! Please check out TinyGSM guide:


  Change GPRS apm, user, pass, and Blynk auth token to run :)

  This is a simple demo of sending and receiving some data.

  Be sure to check out other examples!

 *************************************************************/

/* Fill-in information from Blynk Device Info here */

#define BLYNK_TEMPLATE_ID "**********"

#define BLYNK_TEMPLATE_NAME "*****"

#define BLYNK_AUTH_TOKEN "************************************"

/* Comment this out to disable prints and save space */

#define BLYNK_PRINT Serial

#define TINY_GSM_MODEM_SIM7600

// #define TINY_GSM_MODEM_SIM800

// 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 <BlynkSimpleTinyGSM.h>

// Your GPRS credentials

// Leave empty, if missing user or pass

char apn[]  = "fast.t-mobile.com"; 

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);

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes

BLYNK_WRITE(V0)

{

  // Set incoming value from pin V0 to a variable

  int value = param.asInt();

  // Update state

  Blynk.virtualWrite(V1, value);

}

// This function is called every time the device is connected to the Blynk.Cloud

BLYNK_CONNECTED()

{

  // Change Web Link Button message to "Congratulations!"

  Blynk.setProperty(V3, "offImageUrl", "https: //static- 
 image. nyc3. cdn. digitaloceanspaces. com/general/fte/congratulations.png");

  Blynk.setProperty(V3, "onImageUrl",  "https: //static- 
  image. nyc3. cdn. digitaloceanspaces. com/general/fte/congratulations_pressed.png");

  Blynk.setProperty(V3, "url", " https:// docs. blynk. io/en /getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");

}

// This function sends Arduino's uptime every second to Virtual Pin 2.

void myTimerEvent()

{

  // You can send any value at any time.

  // Please don't send more that 10 values per second.

  Blynk.virtualWrite(V2, millis() / 1000);

}

void setup()

{

  // Debug console

  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();

  // Unlock your SIM card with a PIN

  // modem.simUnlock("1234");

  // Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass, IPAddress(45,55,96,146),80);

  Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass);

  // Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass, "blynk.cloud", 80);

  // Setup a function to be called every second

  timer.setInterval(1000L, myTimerEvent);

}

void loop()

{

  Blynk.run();

  timer.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!

}
Initializing modem...
[18246] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.2.0 on Arduino Mega

 #StandWithUkraine    https://bit.ly/swua


[18258] Modem init...
[27956] Connecting to network...
[27987] Network: T-Mobile Twilio
[27988] Connecting to fast.t-mobile.com ...
[28121] Connected to GPRS
[28207] Connecting to blynk.cloud:80
[81144] Connecting to blynk.cloud:8080
[134152] Connecting to blynk.cloud:80
[186562] Connecting to blynk.cloud:8080
[238800] Connecting to blynk.cloud:80
[291152] Connecting to blynk.cloud:8080
[343319] Connecting to blynk.cloud:80
[395497] Connecting to blynk.cloud:8080
[447702] Connecting to blynk.cloud:80

Kindly help me how can I resolve this issue.

Thanks,
Ashwini

Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Also, please delete the screenshot of your serial monitor, then copy the serial monitor text and paste it into your post - once again with triple backticks at the beginning and end so that it displays correctly.

Pete.

Hi Pete,

Thanks for your quick response. I edited the post now. Please let me know if it’s clearly visible to you or not.

Ashwini

This will never work, because these are Blynk Legacy IP addresses, and the Legacy servers have been decommissioned.
Blynk IoT now uses regional subdomains instead of server specific IP addresses, as described here…

You could try using the regional subdomain that applies to your Blynk account.

My guess though is that it’s a power supply issue. How are you supplying your SIM7600 with power?

Pete.

I have connected USB power supply using 5V adapter. I checked the link and got to know that NY3 server applies to my account so I added “Blynk.begin(BLYNK_AUTH_TOKEN, modem, apn, user, pass, “ny3.blynk.cloud”, 80);” this line of code but still facing the same issue. Could you explain me exactly what changes should I make in code to make it work?

I think it would help if you explained in detail how your Mega and GSM board are connected, and how each is powered, because the information you’ve provided doesn’t really tell me anything.

Pete.