Nano and ESP8266

Hi,
I’ve an Arduino Nano connected to an ESP8266-01 firmware v. 0018000902. At power up I get the following text which tells me that I’m connected to my dsl ok.

[19] Blynk v0.4.0 on Arduino Nano
[520] Connecting to mywifi
[3580] 0018000902
[8717] 192.168.0.36
[8747] Connected to WiFi 

However, I cannot get to turn on the nano’s led D13. I set the widget switch to GP13 when selected ESP8266 as hardware or to D13 when selected nano as hardware.
I’m using the standard sketch loaded onto the nano.
Where did I go wrong?

TIA

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxx";
char pass[] = "xxx";

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial  // tried it but no avail

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(8, 9); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);

  
  while (Blynk.connect() == false) {
    // Wait until connected
  }
 
}

void loop()
{
  Blynk.run();
}

You can’t set hardware as ESP, must be Nano.

Looks like you are connected to the router but not the Blynk server from your Serial Monitor extract.

Is that all SM gives you?

Yes, it’s all the info I get but I got it working by changing the serial pins from 8,9 to 10,11 don’t ask me why :slight_smile:
Thank you.

You set in the router NAT the 8442 port?

@Franco No, didn’t need to.

NAT is only for incoming ports which initiate a TCP (or UDP) session to a device on a private LAN. No need for outgoing ports to be in that table. Outgoing ports will, most of the time, be random anyway (from the client side).