Software Serial VS Hardware Serial - ESP8266+ Arduino

Hi guys, I’m using an Arduino Nano connected to the ESP-01. In the Nano I’m receiving data from NRF24L01 and sending to the Blynk app, but I’m having troubles and I need your help.

First, when uploading the code below, using SOFTWARE SERIAL, it appear the following error:

[19] Blynk v0.3.3-beta
[520] Connecting to iPhone de Renato
[5761] IP: +CIFSR:STAIP,“172.20.10.2”
+CIFSR:STAMAC,“5c:cf:7f:11:d2:f2”

OK
[5808] Connected to WiFi
[14876] Ready (ping: 38ms).
[32240] Ready (ping: 38ms).
[45142] Login timeout
[52182] Ready (ping: 37ms).
[63019] Login timeout
[69467] Ready (ping: 24ms).
[80476] Login timeout
[86436] Ready (ping: 24ms).
[97430] Login timeout
[103880] Ready (ping: 38ms).
[115251] Login timeout
[121195] Ready (ping: 43ms).
[132139] Login timeout
[138236] Ready (ping: 43ms).
[150338] Login timeout
[156205] Ready (ping: 24ms).
[168851] Login timeout
[174875] Ready (ping: 56ms).
[186053] Login timeout
[192158] Ready (ping: 61ms).
[204109] Login timeout

===========================================================================
#include <SimpleTimer.h>
//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
** #include ESP8266_SoftSer.h>**
** #include BlynkSimpleShieldEsp8266_SoftSer.h>**

#define IS_HUB
#include RF24Network.h>
#include RF24.h>
#include SPI.h>
//*********************************
int idade, test;
#define PIN_UPTIME V5

// Set ESP8266 Serial object
** #include SoftwareSerial.h>**
SoftwareSerial EspSerial(2, 3); // RX, TX

//#define EspSerial Serial // Set ESP8266 Serial object

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk”;

SimpleTimer timer;

// Use Virtual pin 5 for uptime display

//******************************************
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9, 10);

// Network uses that radio
RF24Network network(radio);

// When did we last send?
unsigned long last_sent;

// Structure of our payload
struct payload_t
{
float data;
}payload;

float mph, perdaCal, vm2, distance, force, last_payload;
int count = 1;
//**********************************************

void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
// 9600 is recommended for Software Serial
EspSerial.begin(9600);
delay(10);

Blynk.begin(auth, wifi, “iPhone de Renato”, “kkkkkkkkkkkkkkk”);
/while (Blynk.connect() == false) {
// Wait until connected
}
/

timer.setInterval(200L, sendUptime); // tempo de leitura (400ms)

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

SPI.begin();
radio.begin();
radio.setRetries(15, 15);
radio.setDataRate(RF24_2MBPS);

#ifdef IS_HUB
network.begin(90, 0); // channel, node
#endif
//******************************************
}

// This function sends Arduino’s up time every second to Virtual Pin (5).
// In the app, Widget’s reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendUptime()
{
// You can send any value at any time.
// Please don’t send more that 10 values per second.
Blynk.virtualWrite(V2, 10); ///
}
BLYNK_READ(PIN_UPTIME)
{
test= payload.data;
// This command writes Arduino’s uptime in seconds to Virtual Pin (5)
Blynk.virtualWrite(PIN_UPTIME, test);
}
/BLYNK_WRITE(V1)// idade SLIDER
{
//BLYNK_LOG(“Got a value: %s”, param.asStr());
// You can also use:
idade = param.asInt();
//double d = param.asDouble();
}
/

// This function tells Arduino what to do if there is a Widget
// which is requesting data for Virtual Pin (5)

void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
//***********************
// Pump the network regularly
network.update();

#ifdef IS_HUB

if ( millis() - last_sent > 250 ) {
last_sent = millis();
//Serial.print(".");

}
// Is there anything ready for us?
while ( network.available() )
{
// If so, grab it and print it out
RF24NetworkHeader header;

network.read(header, &payload, sizeof(payload));
test=payload.data;
  }

#endif
//*******************************
}

And then, when I turn to the HARDWARE SERIAL, disconnecting the pins 2,3 RX/TX, it shows the following, error:

[19] Blynk v0.3.3-beta
[520] Connecting to iPhone de Renato
ATE0
[1531] Failed to disable Echo
AT+CIPCLOSE
AT+CIPSTART=“TCP”,“cloud.blynk.cc”,8442
AT+CIPCLOSE
AT+CIPSTART=“TCP”,“cloud.blynk.cc”,8442
AT+CIPCLOSE
AT+CIPSTART=“TCP”,“cloud.blynk.cc”,8442
AT+CIPCLOSE
AT+CIPSTART=“TCP”,“cloud.blynk.cc”,8442

======================================================================
#include SimpleTimer.h>
//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include ESP8266_HardSer.h>
#include BlynkSimpleShieldEsp8266_HardSer.h>

//**********************************
#define IS_HUB
#include RF24Network.h>
#include RF24.h>
#include SPI.h>
//*********************************
int idade, test;
#define PIN_UPTIME V5
#define EspSerial Serial // Set ESP8266 Serial object

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk”;

SimpleTimer timer;

// Use Virtual pin 5 for uptime display

//******************************************
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9, 10);

// Network uses that radio
RF24Network network(radio);

// When did we last send?
unsigned long last_sent;

// Structure of our payload
struct payload_t
{
float data;
}payload;

float mph, perdaCal, vm2, distance, force, last_payload;
int count = 1;
//**********************************************

void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
// 9600 is recommended for Software Serial
EspSerial.begin(9600);
delay(10);

Blynk.begin(auth, wifi, “iPhone de Renato”, “renatodlacerda”);
/while (Blynk.connect() == false) {
// Wait until connected
}
/

timer.setInterval(200L, sendUptime); // tempo de leitura (400ms)

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

SPI.begin();
radio.begin();
radio.setRetries(15, 15);
radio.setDataRate(RF24_2MBPS);

#ifdef IS_HUB
network.begin(90, 0); // channel, node
#endif
//******************************************
}

// This function sends Arduino’s up time every second to Virtual Pin (5).
// In the app, Widget’s reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendUptime()
{
// You can send any value at any time.
// Please don’t send more that 10 values per second.
Blynk.virtualWrite(V2, 10); ///
}
BLYNK_READ(PIN_UPTIME)
{
test= payload.data;
// This command writes Arduino’s uptime in seconds to Virtual Pin (5)
Blynk.virtualWrite(PIN_UPTIME, test);
}
/BLYNK_WRITE(V1)// idade SLIDER
{
//BLYNK_LOG(“Got a value: %s”, param.asStr());
// You can also use:
idade = param.asInt();
//double d = param.asDouble();
}
/

// This function tells Arduino what to do if there is a Widget
// which is requesting data for Virtual Pin (5)

void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
//***********************
// Pump the network regularly
network.update();

#ifdef IS_HUB

if ( millis() - last_sent > 250 ) {
last_sent = millis();
//Serial.print(".");

}
// Is there anything ready for us?
while ( network.available() )
{
// If so, grab it and print it out
RF24NetworkHeader header;

network.read(header, &payload, sizeof(payload));
test=payload.data;
  }

#endif
//*******************************
}

Could anyone help me please, I have no idea what’s happening, because I was testing the Serial without the RF24 library and it wasn’t showing error, and I’ve already connect with Blynk, so I don’t think it’s a wiring error, but I never could to use the HARDWARE SERIAL, because it appear the error.

thank you guys.