That’s a bad idea, as the Arduino and ESP are communicating via the Serial1 port, and you should do nothing to interrupt or interfere with that process.
If the module ‘dies’ then you device will go off-line in the Blynk app/web console.
Pete.
That’s a bad idea, as the Arduino and ESP are communicating via the Serial1 port, and you should do nothing to interrupt or interfere with that process.
If the module ‘dies’ then you device will go off-line in the Blynk app/web console.
Pete.
Yes I know, this is only for debug.
Herve.
My philosophy is to avoid adding a debugging process which can create its own bugs and prevent the sketch from functioning correctly 
Pete.
Hello Pete.
I’ve got a new problem: I cant’ run the template in the mobile app (device is not connected) but I can edit it in the developper mode and link the datastreams created in the web dashboard.
Do you have an idea ?
Personnal: this version of Blynk is very difficult to apprehend compared the version v1.0…
What does your serial monitor show?
Pete.
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v1.0.1 on Arduino Mega
[9551] Connecting to WiFi_HLA
[12602] AT version:1.7.4.0(May 11 2020 19:13:04)
SDK version:3.0.4(9532ceb)
compile time:May 27 2020 10:12:22
Bin version(Wroom 02):1.7.4
OK
[18548] +CIFSR:STAIP,"192.168.1.6"
+CIFSR:STAMAC,"00:00:00:00:57:69"
[18548] Connected to WiFi
[28712] Ready (ping: 13ms).
And what does the code that created this serial output look like?
Pete.
/*************************************************************
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
This is a simple demo of sending and receiving some data.
Be sure to check out other examples!
*************************************************************/
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "PoolMeter"
#define BLYNK_DEVICE_NAME "PoolMeter"
const char* BLYNK_AUTH_TOKEN = "GiVTuRZI__TVvgQPBUjvtLqn1sxY9bQe";
const char* BLYNK_DOMAIN = "blynk.cloud"; // Domaine Blynk
uint16_t BLYNK_PORT = 80; // Blynk Port
const char* ESP_SSID = "WiFi_HLA"; // SSID WiFi
const char* ESP_PASS = "xxxxxxxxxxxxxxxx"; // WiFi Password
#include <ESP8266_HLA.h> // My ESP8266 library based on ESP8266_lib.h
#include <BlynkSimpleShieldEsp8266.h>
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 BLYNK_WIFI(&EspSerial);
ESP8266_HLA wifi(&Serial1, &Serial, "-1");
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()
{
Blynk.virtualWrite(V0, 15); // Envoi T° Air au GSM
Blynk.virtualWrite(V1, 30); // Envoi T° Eau au GSM
Blynk.virtualWrite(V2, 7.2); // Envoi valeur pH au GSM
Blynk.virtualWrite(V3, 650); // Envoi valeur pH au GSM
Blynk.virtualWrite(V4, "PAS D'ERREUR"); // Envoi valeur Redox au GSM
}
// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
Blynk.virtualWrite(V0, 15); // Envoi T° Air au GSM
Blynk.virtualWrite(V1, 30); // Envoi T° Eau au GSM
Blynk.virtualWrite(V2, 7.2); // Envoi valeur pH au GSM
Blynk.virtualWrite(V3, 650); // Envoi valeur pH au GSM
Blynk.virtualWrite(V4, 0); // Envoi valeur Redox au GSM
}
void setup()
{
// Debug console
Serial.begin(115200);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
wifi.softReset(); // Sw Reset of ESP module
delay(1000);
wifi.wifiModeStation(); // Station Mode
wifi.closeAP(); // Close connection if already connected
wifi.connectToAP(ESP_SSID, ESP_PASS); // WiFi connection
wifi.espName(); // Define ESP Host name
Blynk.begin(BLYNK_AUTH_TOKEN, BLYNK_WIFI, ESP_SSID, ESP_PASS, BLYNK_DOMAIN, BLYNK_PORT);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run();
}
Can’t really help any further if you don’t want to take my advice…
Pete.
OK. But I don’t understand why there will be a difference using another library now I’m connected to Blynk cloud. I will try the original library but remember that without my code wifi.xxxx, I can’t have a correct IP Address…
Tried with the orginal library and it’s now KO! The connection failed (no ping and device offline on the web app).
[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v1.0.1 on Arduino Mega
[506] Connecting to WiFi_HLA
[3557] AT version:1.7.4.0(May 11 2020 19:13:04)
SDK version:3.0.4(9532ceb)
compile time:May 27 2020 10:12:22
Bin version(Wroom 02):1.7.4
OK
[8653] +CIFSR:STAIP,“87.105.70.105”
+CIFSR:STAMAC,“50:02:91:79:2d:aa”
[8654] Connected to WiFi
The code is
/*************************************************************
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
This is a simple demo of sending and receiving some data.
Be sure to check out other examples!
*************************************************************/
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "PoolMeter"
#define BLYNK_DEVICE_NAME "PoolMeter"
const char* BLYNK_AUTH_TOKEN = "GiVTuRZI__TVvgQPBUjvtLqn1sxY9bQe";
const char* BLYNK_DOMAIN = "blynk.cloud"; // Domaine Blynk
uint16_t BLYNK_PORT = 80; // Blynk Port
const char* ESP_SSID = "WiFi_HLA"; // SSID WiFi
const char* ESP_PASS = "12comdab04amysarah2006"; // WiFi Password
#include <ESP8266_Lib.h> //
#include <BlynkSimpleShieldEsp8266.h>
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 BLYNK_WIFI(&EspSerial);
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()
{
Blynk.virtualWrite(V0, 15); // Envoi T° Air au GSM
Blynk.virtualWrite(V1, 30); // Envoi T° Eau au GSM
Blynk.virtualWrite(V2, 7.2); // Envoi valeur pH au GSM
Blynk.virtualWrite(V3, 650); // Envoi valeur pH au GSM
Blynk.virtualWrite(V4, "PAS D'ERREUR"); // Envoi valeur Redox au GSM
}
// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
Blynk.virtualWrite(V0, 15); // Envoi T° Air au GSM
Blynk.virtualWrite(V1, 30); // Envoi T° Eau au GSM
Blynk.virtualWrite(V2, 7.2); // Envoi valeur pH au GSM
Blynk.virtualWrite(V3, 650); // Envoi valeur pH au GSM
Blynk.virtualWrite(V4, 0); // Envoi valeur Redox au GSM
}
void setup()
{
// Debug console
Serial.begin(115200);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
Blynk.begin(BLYNK_AUTH_TOKEN, BLYNK_WIFI, ESP_SSID, ESP_PASS, BLYNK_DOMAIN, BLYNK_PORT);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run();
}
I’m guessing that your ESP device has been been reconfigured from its default settings, maybe by setting a TCP server via AT+CIPSERVER or a static IP via AT+CIPSTA.
It also appears to have a very odd MAC address, and I guess that this has also been configured via a AT+CIFSR command.
Whether these parameters have been set manually, or via some software utility that you’ve used, is impossible to say - based on the limited information you’ve provided.
You’ve not really said what type of ESP device you are using, and whether you’ve previously updated the firmware, but it seems likely that re-flashing the standard AT firmware is the simplest solution. Otherwise you may be able to query each of the AT parameters and reset them to the factory defaults.
Pete.
Hi Pete.
The ESP device I use is ESP8266/ESP-07. I updated the firmware with the following files:

Below the information sent by the device for each query:
AT+CIPSTA_CUR?
+CIPSTA_CUR:ip:“0.0.0.0”
+CIPSTA_CUR:gateway:“0.0.0.0”
+CIPSTA_CUR:netmask:“0.0.0.0”
OK
AT+CIPSTA_DEF?
+CIPSTA_DEF:ip:“252.231.255.255”
+CIPSTA_DEF:gateway:“252.231.255.1”
+CIPSTA_DEF:netmask:“255.255.255.0”
OK
AT+CIPAP_CUR?
+CIPAP_CUR:ip:“192.168.4.1”
+CIPAP_CUR:gateway:“192.168.4.1”
+CIPAP_CUR:netmask:“255.255.255.0”
OK
AT+CIPAP_DEF?
+CIPAP_DEF:ip:“0.0.0.0”
+CIPAP_DEF:gateway:“0.0.0.0”
+CIPAP_DEF:netmask:“0.0.0.0”
OK
Do you see something wrong that I could modify?
Herve.
I’m not familiar with that hardware.
Are you saying that you’ve done that just now, or a while ago?
None of your queries show the issues that I was talking about - strange MAC address and the possibility of a TCP server configuration being saved to the device.
I’d suggest that you do a clean firmware install, then run the Blynk simple demo sketches from the sketch builder, with the latest library files from the Blynk GitHub site.
Don’t use any modified library files, issue any AT commands, or include any of the wifi.xxxxx commands that I previously suggested you should remove.
Pete.
Is there a reason why you are tied to this prehistoric hardware, rather than using an ESP32 or similar?
Pete.
The update was done in summer 2021.
OK, I’ll try what you suggested.
Herve.
No particular reason…
In that case, I’d suggest that you switch to either a NodeMCU or ESP32, depending on how many GPIOs and Analog inputs you need.
You get the advantages of being able to use Edgent for dynamic WiFi provisioning and OTA code shipments, plus more memory and a faster processor; and of course built-in WiFi capabilities.
Pete.
OK. But I already built my project with this module, this is the last part of my project and I don’t want to design another one. I just want to finish it so I will keep this ESP module. I hpoe I’ll find a solution…
Herve.
Okay, gook luck.
Pete.