BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Blynk Nodemcu ;device showing offline in blynk app

HI Team ,Gm ,strugguling iwth below issue in code or somwhere

#define BLYNK_PRINT Serial

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID   "YourTemplateID"  
#define BLYNK_TEMPLATE_ID "TMPLKEnUt9gN"
#define BLYNK_DEVICE_NAME "binder6253"
#define BLYNK_AUTH_TOKEN "wbKURuuWJEwxvUtvUdz-V6QunplJ6dRk"

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "My airtel 1";
char pass[] = "Tcs@6253";

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

// Blynk.begin(auth, ssid, pass);
  // You can also specify server:
 Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
 //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}

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

I am getting this in serial monitor but device say offline always after connecting to nodemcu to 12v supply ,do we can power it by connecting to micro usb port instead of pin power ,i tried multiple times and has blynk version 1.01 . and device blynk iot app

[349844] Connecting to blynk.cloud:80
[349958] Ready (ping: 58ms).
[364182] Connecting to blynk.cloud:80
[364318] Ready (ping: 68ms).
[378516] Connecting to blynk.cloud:80
[378618] Ready (ping: 52ms).

But still my device showing offline ,struggling

Please edit your post and add triple backticks ``` before and after your whole sketch.

Is this ready ping repetitaion show connection success, why it repeating

Despite @John93 giving you triple backticks (```) you have not used them and properly formatted your code. I have done that for you this time. Next tim the code will be removed by the moderator.

I’d suggest that you change this to 74880 and re-upload your sketch.
Then, press the reset button on your board and post the serial output that follows.

Place triple backticks at the beginning and end of this serial output, on a separate line, when you post it to the forum. This is so that it displays correctly.

Pete.

Thanks Pete , i tried by including below line in sketch
#include <Blynk.h>
it show device online but no response of buttons ,serial respone

[6297] IP: 192.168.1.19
[6297] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.8 on Arduino

[6306] Connecting to blynk.cloud:80
[6540] Ready (ping: 122ms).
[20729] Connecting to blynk.cloud:80
[20885] Ready (ping: 75ms).
[35030] Connecting to blynk.cloud:80

Does this mean success in connecting blynk and can be used further

My device still showing offline by removing and reposne for 744800 shown in earlier msg.
#include <Blynk.h>

Dont know ,what i sturggule a lot and did not find any clue ,first its token issue due to cloud and now device itself not turned on

You are using a very old version of the Blynk library,m which doesn’t support Blynk IoT.

You should install version 1.1.0 of the Blynk C++ library, and ensure that you don’t have any old versions of the library installed.

Please don’t do this.

I have no idea what this comment means.

The Serial.begin() command in your original post used a baud rate of 9600. The native baud rate of most ESP8266 boards is 74880. By changing the Serial.begin command to use 74880 and using the same baud rate in your serial monitor means they you should see the boot messages from your board, along with the debug output from your sketch in the serial monitor. This can be useful in some situations.

Pete.

Thanks a lot Pete ,I hav e two libabrary installed one is 1.1.0 and other Blynk Chinenes so how do i removed this one .

Use the uninstall option in the IDE, or delete the folder in file manager.

Pete.

Thanks Pete ,it got device online now and now the coding part not working to switch off the relay buttons ,has some code but seems not working

BLYNK_WRITE(V1)
{
  int value = param.asInt();
  Serial.println(value);
  if(value == 0)
  {
    digitalWrite(D6, LOW);
    Serial.println("LED ON");
  }
  if(value == 1)
  {
     digitalWrite(D6, HIGH);
     Serial.println("LED OFF");
  }
}

BLYNK_WRITE(V2)
{
  int value = param.asInt();
  Serial.println(value);
  if(value == 0)
  {
    digitalWrite(D7, LOW);
    Serial.println("LED ON");
  }
  if(value == 1)
  {
     digitalWrite(D7, HIGH);
     Serial.println("LED OFF");
  }
}

BLYNK_WRITE(V3)
{
  int value = param.asInt();
  Serial.println(value);
  if(value == 0)
  {
    digitalWrite(D8, LOW);
    Serial.println("LED ON");
  }
  if(value == 1)
  {
     digitalWrite(D8, HIGH);
     Serial.println("LED OFF");
  }
}


void setup()
{
  Serial.begin(74880);
  Blynk.begin(auth, ssid, pass ,"blynk.cloud" , 80);
  
  pinMode(D5,OUTPUT);
  pinMode(D6,OUTPUT);
  pinMode(D7,OUTPUT);
  pinMode(D8,OUTPUT);
}

void loop()
{
  Blynk.run();

You’ll end to give us a few more clues than that, and some info about what you are seeing in your serial monitor.

Pete.

Hi Pete
Will you please provide some sample code to swtich control relay module ,i did not figure out correct code ,Thanks .

Regards
Binder Kumar

This isn’t a code factory!

Your code snippet seems okay, but without the other info I asked for it’s difficult to advise about where the issue might be.

Pete.

Thanks for response ,the code seems working in serial monitor as it give print out value like led1 on but it didnot turn off the pin on board like D5,D6,D7 D8 but it do little dim the led on press button by app as the signal seems still high ,using 12 v supply for 12v relay and same supply to nodemcu, i attached load also but it did not turn off and always on .

additional borad Urls given as : http://arduino.esp8266.com/stable/package_esp8266com_index.json ,Is this also latest as i belive lot of old stuff in coding ,versions ,

How is your button widget configured in the dashboard?

Pete.

I defined V0,V1,V2,V3 with default value 0 and high 1, low 0 .

I asked how you configured your widgets, not datastreams.

Pete.