Blynk and answering an incoming call

And yet it does not work quite correctly … If the modem is connected to GPRS and I install a sketch with “Blynk.config” then everything works. And if there is no GPRS connection and I install a sketch with “Blynk.config” then the modem does not connect to GPRS. This can be seen in the “port monitor” and on the diode of the modem itself. Help me please! I thought it worked, but alas … I’m very upset …

If I am not mistaken, then APN is not entered with Blynk.config

Please open the question.
And yet it does not work quite correctly … If the modem is connected to GPRS and I install the sketch with “Blynk.config”, then everything works. And if there is no GPRS connection and I install the sketch with “Blynk.config”, then the modem does not connect to GPRS. This can be seen on the “port monitor” and on the diode of the modem itself.

You’re using variables called BLYNK_DEFAULT_DOMAIN and BLYNK_DEFAULT_PORT in the code you posted, but those variables aren’t declared anywhere in your sketch, so the code would fail to compile.
If you post the actual code you are using then we might be able to spot the error.

I’ve recently been doing some tests with a TTGO T-Call ESP32 board and I use this as my connection commands for Blynk cloud and it works perfectly:

Blynk.config (modem, auth, "blynk-cloud.com", 8080);
Blynk.connect();

BTW, there is no need to post the same reply twice.

Pete.

#define BLYNK_PRINT Serial                                                                        
#define TINY_GSM_MODEM_SIM800                                                                      
#include <TinyGsmClient.h>                                                                        
#include <BlynkSimpleSIM800.h>                                                                    
#include <SoftwareSerial.h>                                                                        
#include <OneWire.h>                                                                              
//////////////////////////////////////////
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";                                   
//////////////////////////////////////////
char apn[]  = "internet";                                                           
char user[] = "";                                                                   
char pass[] = "";                                                                   
//////////////////////////////////////////
SoftwareSerial SerialAT(10, 11); // RX, TX                                          
TinyGsm modem(SerialAT);                                                            
///////////////////////////////////////////
BLYNK_CONNECTED() 
{                                                                                   
  Blynk.syncAll();                                                                  
}
////////////////////////////////////////////
void setup()                                                                        
{                                                                                   
  Serial.begin(9600);                                                               
  delay(10);                                                                        
  SerialAT.begin(9600);                                                             
  delay(3000);                                                                      
  Serial.println("Initializing modem...");
  modem.init(); 
  Blynk.config (modem, auth, "blynk-cloud.com", 8080);
  Blynk.connect();  
////////////////////////////////////////////
}                                                                                   
void loop(){                                                                         
                                                                                   
  Blynk.run(); 
  }

And what does your serial monitor show when you run this code?

Pete.

18:11:33.749 -> Initializing modem...
18:11:35.377 -> [4613] 
18:11:35.377 ->     ___  __          __
18:11:35.377 ->    / _ )/ /_ _____  / /__
18:11:35.377 ->   / _  / / // / _ \/  '_/
18:11:35.377 ->  /____/_/\_, /_//_/_/\_\
18:11:35.377 ->         /___/ v0.6.1 on Arduino Mega
18:11:35.377 -> 
18:11:36.361 -> [5628] Connecting to blynk-cloud.com:8080
18:12:52.391 -> [81648] Connecting to blynk-cloud.com:8080

Constantly tries to connect, but no result.

And it still works fine if you use your code from past #25 ?

Pete.

If I use
Blynk.begin (auth, modem, apn, user, pass);
it works, but in the absence of GPRS the “void loop” does not work. And with
Blynk.config (modem, auth, "blynk-cloud.com", 8080);
does not connect to GPRS.

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

19:26:41.115 -> Initializing modem…
19:26:41.285 -> [3164]
19:26:41.285 -> ___ __ __
19:26:41.319 -> / _ )/ /_ _____ / /__
19:26:41.353 -> / _ / / // / _ / '/
19:26:41.353 -> /
//_, /////_
19:26:41.387 -> /
__/ v0.6.1 on Arduino Mega
19:26:41.421 ->
19:26:41.421 -> [3258] Modem init…
19:26:41.591 -> [3478] Connecting to network…
19:26:41.693 -> [3568] Network: MegaFon
19:26:41.693 -> [3569] Connecting to internet …
19:26:47.702 -> [9606] Connected to GPRS
19:26:47.770 -> [9675] Connecting to blynk-cloud.com:80
19:26:51.737 -> [13630] Ready (ping: 406ms).

This is what is missing from your previous serial output, because you don’t have any code to handle the network and GPRS initialisation, after you do modem.init and before you call Blynk.connect

Pete.

This piece of code is probably present in the Blynk library when using
Blynk.begin (auth, modem, apn, user, pass);
Tell me how and in which line you can write yourself. I would be very grateful.

Finally I figured out how to set it up)))
Now the code works for sure!

#define TINY_GSM_MODEM_SIM800                                                                      
#include <TinyGsmClient.h>                                                                        
#include <BlynkSimpleSIM800.h>                                                                    
#include <SoftwareSerial.h>                                                                        
#include <OneWire.h>                                                                              
//////////////////////////////////////////
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";                                   
//////////////////////////////////////////
char apn[]  = "internet";                                                           
char user[] = "";                                                                   
char pass[] = "";                                                                   
//////////////////////////////////////////
SoftwareSerial SerialAT(10, 11); // RX, TX                                          
TinyGsm modem(SerialAT);                                                            
///////////////////////////////////////////
BLYNK_CONNECTED() 
{                                                                                   
  Blynk.syncAll();                                                                  
}
////////////////////////////////////////////
void setup()                                                                        
{                                                                                  
  Serial.begin(9600);                                                               
  delay(10);                                                                        
  SerialAT.begin(9600);                                                             
  delay(3000);                                                                       
  Serial.println("Initializing modem...");
  modem.init();
  modem.waitForNetwork(600000L);
  modem.gprsConnect(apn);
  Blynk.config (modem, auth, "blynk-cloud.com", 8080);
  Blynk.connect();
   
    
////////////////////////////////////////////
}                                                                                   
void loop(){                                                                         
                                                                                   
  Blynk.run(); 
  }

This is the connection code that I’m using…

  String modemInfo = modem.getModemInfo();
  SerialMon.print("Modem: ");
  SerialMon.println(modemInfo);

   SerialMon.print("Waiting for network...");
  if (!modem.waitForNetwork(240000L)) {
    SerialMon.println(" fail");
    delay(5000);
    return;
  }
  SerialMon.println(" OK");

  if (modem.isNetworkConnected()) {
    SerialMon.println("Network connected");
  }

  SerialMon.print(F("Connecting to APN: "));
  SerialMon.print(apn);
  if (!modem.gprsConnect(apn, user, pass)) {
    SerialMon.println(" fail");
    delay(5000);
    return;
  }
  SerialMon.println(" OK");

  Blynk.config (modem, auth, "blynk-cloud.com", 8080);
  Blynk.connect();

Pete.

Start by reading here…

http://help.blynk.cc/en/articles/2091699-keep-your-void-loop-clean

Thanks a lot for your answers! Finally solved my problem. Revised all libraries and the solution was a simple replacement for
Blynk.config (modem, auth, "blynk-cloud.com", 8080);
to
Blynk.config (modem, auth);
Now my project works the way I need it, namely, if the module loses its GPRS connection, the “Void loop” continues to work.

Please put the topic “solved” status. And once again I express my gratitude to you!)))

How to run the code same time blunk server and void loop
Example : blunk server and DTMF function

i have same problem please reply your full code

User @timon816 last visited the forum in August 2020, so well over two and a half years ago.
Since then Blynk IoT has been introduced and Blynk legacy retired, so the blynk.cloud.com server url has been replaced by blynk.cloud and there have been many other significant changes to the Blynk libraries.

Even if @timon816 has his code from two and a half years ago, it won’t work with Blynk IoT.

I think you’d be better starting a new topic about your problem, but before you do that you should read this…

New topics that are created without sufficient information will be removed.

Pete.

ok sir