NodeMCU connects to Wifi, but doesn't recevie signals from phone app

image Hello, I’m new here and I just started using arduino. I have a NodeMCU ESP8266 with Wifi and I’m trying to use it to turn switch a led on and off. At first the wifi didn’t work, but now it somehow connects (i’ve tried closer to the router). Now the problem is that, despite the board being connected, the buton in the Blynk app doesn’t do anything. I’ve searched for some tutorials and they all seem to use the same code, found in the “Examples” section after downloading the Blynk library, I’ll post it below. The circuit is fine as the LED switches on sometimes when uploading the sketch to the board. Here’s the code:

*************************************************************
  This example runs directly on ESP8266 chip.

  Note: This requires ESP8266 support package:
    https://github.com/esp8266/Arduino

  Please be sure to select the right ESP8266 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266_SSL.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "DMC-2.4G";
char pass[] = "password";

void setup()
{
  // Debug console
  Serial.begin(9600);

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

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

I also use the iOS app if it matters in any way.Thank you

I recommend you start with the non SSL library

#include <BlynkSimpleEsp8266.h>

What does your Serial Monitor show when booting?

Last thing showing should be something like …

[6074] Ready (ping: 12ms). with different values for timestamp (ms since boot) and ping value.

What pin do you have it set for? Are you simply toggling the NodeMCU’s built in LED… if so, you should be using D4 (AKA GPIO2). And it will be ON by default and OFF when you press the button…

… And that can be reversed if you swap the 0 / 1 to 1 / 0

My guess is that you’re getting confused with the “D” numbers.
In the app, when you choose Digital Pin D4, this means GPIO4, which is the pin labelled D2 on the board.

Pete.

Depends on the board type used in the App.

When using App control of pins and setting for NodeMCU (or Wemos) in the App, the pin descriptors refer to the silk screened Dx pins.

But if setting the App to ESP8266, it uses the GPIO GPx descriptors.

1 Like

What does your Serial Monitor show when booting?

[1571] Connected to WiFi
[1571] IP: 192.168.147.103
[1571] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on NodeMCU

[1650] Connecting to blynk-cloud.com:80
[4807] Login timeout
[6807] Connecting to blynk-cloud.com:80
[9856] Login timeout

I think it doesn’t have a stable connection, but what would be the cause?

What pin do you have it set for? Are you simply toggling the NodeMCU’s built in LED… if so, you should be using D4 (AKA GPIO2). And it will be ON by default and OFF when you press the button…

I’m trying to turn on a LED on the breadboard, not the built in one. I’ll attach a photo of my circuit.

My guess is that you’re getting confused with the “D” numbers.
In the app, when you choose Digital Pin D4, this means GPIO4, which is the pin labelled D2 on the board.

I tried, but since I can’t get a stable connection I can’t be sure if this is the problem. I just found out about the Serial Monitor windows, so maybe there was a connection problem all along. If it is so, what would be the solution?

Here is the circuit:

image

Also is there a problem if the serial port is different from the upload speed? Tried setting both of them at 9600 and it doesn’t upload the code.

My board settings:

image

It is not even connecting.

Double check your AUTH, SSID, Password, etc.

Did you change from the SSL to the standard TCP library?

I managed to connect and finish the project but I’m still not sure what the problem was. The code was ok and the circuit was ok. I just made another try on the PC and it worked. The first time I tried I’ve done it on my PC and seeing thath it won’t work, I did the code on my laptop, still wth no result. Once I’ve changed again with the PC it worked with the same code, board settings etc