BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Mobile Blynk app (NodeMCU “Wasn’t online yet”)

Hello All,

I’m new to Blynk Community. I’m using this Blynk MQ2 Smoke Detector Notification Gauge example.
I followed Instructions as per this link

But in my Android phone the device shows “wasn’t online yet”. Pls help me out. I have checked the auth token correctly.

//Viral Science www.viralsciencecreativity.com www.youtube.com/c/viralscience
//Blynk MQ-2 Smoke Detector
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

char auth[] = "xgur6Yb0E3dUySTk6D7U8bwZr-UBgSDg"; //Enter Authentication code sent by Blynk


char ssid[] = "****"; //Enter WIFI Name
char pass[] = "*****"; //Enter WIFI Password

SimpleTimer timer;

int mq2 = A0; // smoke sensor is connected with the analog pin A0
int data = 0;
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, getSendData);
}

void loop()
{
  timer.run(); // Initiates SimpleTimer
  Blynk.run();
}

void getSendData()
{
  data = analogRead(mq2);
  Blynk.virtualWrite(V2, data);

  if (data > 700 )
  {
    Blynk.notify("Smoke Detected!");
  }

}

What does the output from your serial monitor show?

Pete.

it show login timeout

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

[7641] Connecting to blynk-cloud.com:80
[10793] Login timeout
[12793] Connecting to blynk-cloud.com:80
[15805] Login timeout
[17805] Connecting to blynk-cloud.com:80
[20826] Login timeout
[22826] Connecting to blynk-cloud.com:80
[27846] Connecting to blynk-cloud.com:80
[30866] Login timeout
[32866] Connecting to blynk-cloud.com:80

The code shows your authentication code. Did you also input your network credentials?

Edit: Didn’t see your serial monitor output. It shows connected to wifi so you must have the correct credentials.

Did you try different networks? Could be ISP blocking your connection.

1 Like

where network credetial must be input ?

here
char ssid[] = “****”; //Enter WIFI Name
char pass[] = “*****”; //Enter WIFI Password

But you have an IP ,so it’s ok

Try to ping blynk server

ohhh isee, i already input the credentials in accordance with my network

what should i do after ping blynk server ?

Ping let you know if there is a problem with your isp

i already ping it and there was no problem with the isp

i add the ip blynk-cloud on my code

{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass, "188,166,206,43", 80);
  timer.setInterval(1000L, getSendData);
}

serial monitor show :

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

[6640] Connecting to 188,166,206,43:80
[11641] Connecting to 188,166,206,43:80
[16642] Connecting to 188,166,206,43:80
[21643] Connecting to 188,166,206,43:80
[26644] Connecting to 188,166,206,43:80
[31645] Connecting to 188,166,206,43:80
[36646] Connecting to 188,166,206,43:80
[41647] Connecting to 188,166,206,43:80
[46648] Connecting to 188,166,206,43:80
[51649] Connecting to 188,166,206,43:80
[56650] Connecting to 188,166,206,43:80

but on app still wasn’t online yet

Envoi d’une requête ‘Ping’ 188.166.206.43 avec 32 octets de données :
Réponse de 188.166.206.43 : octets=32 temps=282 ms TTL=40
Réponse de 188.166.206.43 : octets=32 temps=282 ms TTL=40
Réponse de 188.166.206.43 : octets=32 temps=281 ms TTL=40
Réponse de 188.166.206.43 : octets=32 temps=282 ms TTL=40

Pinging 188.166.206.43 with 32 bytes of data:
Reply from 188.166.206.43: bytes=32 time=44ms TTL=55
Reply from 188.166.206.43: bytes=32 time=41ms TTL=55
Reply from 188.166.206.43: bytes=32 time=44ms TTL=55
Reply from 188.166.206.43: bytes=32 time=35ms TTL=55

Ping statistics for 188.166.206.43:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 35ms, Maximum = 44ms, Average = 41ms

What happens if you use port 8080 instead of 80?

It might also be worth rebooting your router and any Wi-Fi repeaters on your network.

If this doesnt work then add #define BLYNK_DEBUG as the first line of your sketch and post the serial output.

Pete.

1 Like

if use port 8080 serial monitor show the same output as port 80

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

[10487] Connecting to 188,166,206,43:8080
[15487] Connecting to 188,166,206,43:8080
[20488] Connecting to 188,166,206,43:8080
[25489] Connecting to 188,166,206,43:8080
[30490] Connecting to 188,166,206,43:8080
[35491] Connecting to 188,166,206,43:8080

after i add #define BLYNK_DEBUG serial output still same output as above

Try moving the #define BLYNK_DEBUG so that it’s immediately after your #define BLYNK_PRINT Serial command.

Pete.

where should i move it ?

Pete.

serial output still same

ddani085

I had a similiar problem. Try turning off your firewall, it may be blocking your connection.

Paul

I’m guessing that either you’ve not added the #define BLYNK_DEBUG line correctly, or you have not successfully uploaded the amended code to your NodeMCU.

The first part of your code should look like this:

//Viral Science www.viralsciencecreativity.com www.youtube.com/c/viralscience
//Blynk MQ-2 Smoke Detector
#define BLYNK_DEBUG
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

A successful upload should give an output something like this:

sketch uses 279748 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29800 bytes (36%) of dynamic memory, leaving 52120 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM14
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:56:fc:99
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Flash params set to 0x0290
Compressed 283904 bytes to 206049...

Writing at 0x00000000... (7 %)
Writing at 0x00004000... (15 %)
Writing at 0x00008000... (23 %)
Writing at 0x0000c000... (30 %)
Writing at 0x00010000... (38 %)
Writing at 0x00014000... (46 %)
Writing at 0x00018000... (53 %)
Writing at 0x0001c000... (61 %)
Writing at 0x00020000... (69 %)
Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 283904 bytes (206049 compressed) at 0x00000000 in 5.0 seconds (effective 458.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Afterwards your serial output will look something like this:

[78] Connecting to UltraNet
[4434] Connected to WiFi
[4434] IP: [Internal IP Redacted]
[4434] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on ESP8266

[4511] Connecting to blynk-cloud.com:80
[4638] <[1D|00|01|00] [Auth Code Redacted]
[4709] >[00|00|01|00|C8]
[4709] Ready (ping: 70ms).
[4709] Free RAM: 49336
[4776] <[11|00|02|00]Hver[00]0.6.1[00]h-beat[00]10[00]buff-in[00]1024[00]dev[00]ESP8266[00]build[00]Mar 28 2020 10:11:02[00]
[4885] >[00|00|02|00|C8]
[5824] <[14|00|03|00|06]vw[00]2[00]2
[6824] <[14|00|04|00|06]vw[00]2[00]2
[7824] <[14|00|05|00|06]vw[00]2[00]2
[8824] <[14|00|06|00|06]vw[00]2[00]2
[9824] <[14|00|07|00|06]vw[00]2[00]2
[10824] <[14|00|08|00|06]vw[00]2[00]2
[11824] <[14|00|09|00|06]vw[00]2[00]2
[12824] <[14|00|0A|00|06]vw[00]2[00]2
[13824] <[14|00|0B|00|06]vw[00]2[00]2
[14824] <[14|00|0C|00|06]vw[00]2[00]2
[14886] <[06|00|0D|00|00]
[14946] >[00|00|0D|00|C8]

Pete.