ESP8266 Wasn't online yet

[UPDATE]
so im starting new project “LED Blink on off” with this reference https://www.youtube.com/watch?v=LmImZOK7-7Y
and im using just 1 led that connect to gnd and D2 pin on nodeMcu. and for the blynk it self now i change the device to nodeMcu ( before this i use ESP8266 ) and the result its just the same. error “Wasn’t online yet”. this the program that i use

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on NodeMCU.

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

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

  For advanced settings please follow ESP examples :
   - ESP8266_Standalone_Manual_IP.ino
   - ESP8266_Standalone_SmartConfig.ino
   - ESP8266_Standalone_SSL.ino

  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.h>

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

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

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

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

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

i dont know where the error now, please help thank you

As @PeteKnight said the serial monitor shows your 8266 is not connected to your WiFi. You have to establish a WiFi connection before you can connect to Blynk. Have you followed all the steps he outlined earlier? Do you know how to log into your router and check if there is available IP addresses?

ok sorry, im just restarting my router wifi. but im not looking for DHCP Pool and ensuring for restrictions abaout whitelisted MAC adresses because i dont know how to begin with.

Do you know how to log into your router and check if there is available IP addresses ?
no i dont sorry. so i assum that i must go to the router setup ( im using indihome so i must go to 192.168.100.1 in browser and login ) and then find an IP addresses. its like this ? sorry im newbie in this topic.

[UPDATE]
ok, this is what I got on DHCP setting


image

are those need change or what ?

The screenshots you’ve posted are about setting static DHCP IP addresses. That is different from what I was talking about. Your router will have a section where it allows you to choose the range of IP addresses that are allocated to devices via DHCP.
This probably starts with 192.168.100.2 and should hopefully extend to at least 192.168.100.100, giving a pool of 99 potential IP addresses that can be allocated.

In that section (not the section in the screenshots) you may be better turning off IPV6 and relying just on IPV4 addresses.

Did you turn-off your WiFi repeater(s) for these tests?

Pete.


is this the section that you means mr.pete ?

so according that i have plenty adresses right ? and for the IPV4 and IPV6 is like this or what ?

Did you turn-off your WiFi repeater(s) for these tests?
i don’t have repeater in my home so i think its clear

[UPDATE]
so i started to look back in this discussion that stated MAC Restriction. in my router settings there is no restriction i guess, you can see it in this screenshot



so i think its clear

Yes.

I assumed from this screenshot…

that you have an external Access Point (WiFi repeater).

In the Tools menu of the Arduino IDE, select the following options:

Debug port “Serial”
Debug Level “WIFI”

Compile and upload your sketch and post the contents of the serial monitor (don’t post a screenshot, copy and paste by selecting with your mouse and copying using CTRL-C
Paste the serial output between triple backticks as if you were posting code.

Pete.

ok, so i got this in the serial monitor

scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
scandone
no Zaidan found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect

[UPDATE]
ok, so i searc what does the wifi evt:1 mean, and then i got this link to check it https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiType.h#L51
stated that wifi evt:1 means Disconnect_Reason_Unspecified.

It’s telling you that it can’t find a 2.4GHz network called “Zaidan”

From what you’ve posted, this appears to be the correct name for your 2.4GHz WiFi network, so the logical conclusion is that your NodeMCU is faulty.

This assumes that your NodeMCU is within range of your router, that the “Zaidan” SSID doesn’t contain any hidden characters/spaces and that your router is actually transmitting this SSID on 2.4GHz band.

Pete.

ok thanks for the answer, i will try to move closely to the router and test it again. but i think i can try it in the night when my family is asleep. so i will update soon for the result

Actually, as your PC screenshot shows another WiFi network called “Dlink” you could try connecting to that. If you don’t know the password then put anything in there.
I’d expect the WiFi debug to show that the SSID was detected, but that the password was wrong so the connection was rejected, which would be one step forward.

You could also try setting-up a wireless hotspot from your phone, with a totally different SSID) and try putting that SSID and password into your sketch.

Pete.

ok, i will try it soon as possible. i will update soon. thanks for the recommendation
[UPDATE]
ok, so im using the recommendation to use wireless hotspot from my phone. so i change the SSID and password like my tethering does

char ssid[] = "AndroidAP";
char pass[] = "aaabbbccc";

and the result now is like this

state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt 

connected with AndroidAP, channel 6
dhcp client start...
wifi evt: 0
ip:192.168.43.119,mask:255.255.255.0,gw:192.168.43.1
wifi evt: 3
[6879] Connected to WiFi
[6879] IP: 192.168.43.119
[6879] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on NodeMCU

[6889] Connecting to blynk-cloud.com:8080
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 255.255.255.255
[11890] Connecting to blynk-cloud.com:8080
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 255.255.255.255
pm open,type:2 0
[16891] Connecting to blynk-cloud.com:8080
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 255.255.255.255
[21892] Connecting to blynk-cloud.com:8080
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 255.255.255.255
[26893] Connecting to blynk-cloud.com:8080

so this is new for me, but i think this work right ? and i assume that the previous error is happen because my wifi setup ?

Okay, so this is progress. Your android access point is being found by the NodeMCU and its connecting to it. It’s not able to resolve the correct IP address for the Blynk cloud server for some reason, but that’s probably to do with your mobile providers DNS rather than the NodeMCU.

So, the NodeMCU seems okay, it’s the Router that is the problem.
My guess is that the SSID contains an unusual character of some type, or a leading or trailing space.
You could reset the SSID, but then you’d need to re-select the new SSID and enter the password for each device that connects to it.
The other option is if your router allows you to add a second or guest SSID that you can give a different name to.

Pete.

ok thanks for the information. Sorry, but i will try it tomorrow and will give the update very soon. Thank you so much Mr.Pete for today

[UPDATE]
now its working, what i do is change the wifi to my family phone tethering, then I change the SSID and password like the tethtering i use

char ssid[] = "vivo";
char pass[] = "aaabbbccc";

then I open the serial monitor, the output is like this

reconnect
scandone
wifi evt: 2
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt 

connected with vivo, channel 1
dhcp client start...
wifi evt: 0
ip:192.168.43.118,mask:255.255.255.0,gw:192.168.43.1
wifi evt: 3
[7380] Connected to WiFi
[7380] IP: 192.168.43.118
[7380] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on NodeMCU

[7390] Connecting to blynk-cloud.com:8080
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 188.166.206.43
[7556] Ready (ping: 48ms).
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
pm open,type:2 0
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!
Failed to read from DHT sensor!

the “Failed to read from DHT sensor!” is happen because I’m not connecting it to nodeMCU, when I connecting it, that sentences is gone. then I open blynk in my phone and its working right now. the illustration is like this


so I think the error is because my wifi router. and sorry because I’m not trying to change the SSID in my router wifi because its to difficult for me to tell other family if I want to change it. but because this is working fine with tethering from another phone I think its enough.

Thank you so much to @PeteKnight and @daveblynk for the information. sorry if I make a beginner mistake or I wrote a dumb question or answer. hope you guys have an amazing day. i appreciate all of your answer and information Mr. Pete and Mr. Dave.

2 Likes