ESP8266 Wasn't online yet

*sorry if my english is bad

I am beginner in this topic, especially using blynk. i want to make a project similarly like this https://roboticadiy.com/esp8266-blynk-plot-sensor-readings-in-live-charts-export-csv-file/

i got an error in blynk apps when I start it, it shows “DHT22 Data Receiver Wasnt Online Yet”

this is the code that I used, when I upload the code to the nodeMcu, there is no error when I upload it.

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "-------------------";//Enter the Auth code which was send by Blink

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

#define DHTPIN 2 // Digital pin 4

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21 // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, h); //V5 is for Humidity
Blynk.virtualWrite(V6, t); //V6 is for Temperature
}

void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, ssid, pass);

dht.begin();

// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}

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

for the auth token, I copy it from my email, and for SSID and password, I think there is no error.
i don’t know where the error is, I appreciate if there is an explanation for this, thank you.

Couple things.

-Make sure there isn’t a space before or after the token
-Generate a new token
-Search the forum. In the begin call add blynk.com port 8080. I couldn’t find the syntax right off
-According to what I’ve read on hear some ISPs block 8080

What does your serial monitor show?

Pete.

im sorry, when i must open the serial monitor in arduino ? before upload, when upload, or after upload the code ? sorry if i make a beginner question, im new in arduino and iot and this is my first project.
for the serial monitor after done uploading the code, this is what its look like


there is nothing in the serial monitor. and if you see in the code i delete the auth tokn, ssid, and password but when i uploading i write it down the code.

  1. there is no space i think in the token that i write in the code
  2. generating a new one, but the result is just the same
  3. ok, i will search. thank you for your suggestion

I would change this line to:
Serial.begin(74880); // See the connection status in Serial Monitor

and set your serial monitor to the same baud rate.
Open the serial monitor before uploading. It will grey-out for a while then show the NodeMCU’s boot information followed by the information from the Blynk library as it attempts to connect to the server.

Pete.

ok thanks for the suggestion, i will try it. i will upload the result in here
[UPDATE]
the result is look like this


its still the same, there is nothing on the serial monitor
and for the information on the console window is like this

Executable segment sizes:
IROM   : 249812          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 28220   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1304  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 2264  ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 26136 )         - zeroed variables      (global, static) in RAM/HEAP 
Sketch uses 281600 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29704 bytes (36%) of dynamic memory, leaving 52216 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM5
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 84:cc:a8:88:5f:f7
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 285760 bytes to 209190...
Wrote 285760 bytes (209190 compressed) at 0x00000000 in 18.7 seconds (effective 122.3 kbit/s)...
Hash of data verified.

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

Okay, try disconnecting everything from your NodeMCU, except for the USB cable.

Pete.

ok, before this i still connecting the wire to nodeMCU. after disconnecting it the led above the RST pin is on. then i try uploading again with disconnecting all the wire and this is the result at the serial monitor


before that, i want to ask something. my phone is samsung j1 with android version 5.1.1. is this phone compatible with blynk ? im afraid that because my phone is old so i cannot connect it with blynk and nodeMCU

What happens if you push the buttons on the NodeMCU with the USB connected and the serial monitor open?

Pete.


i push it twice, then on serial monitor pop up an information like that.
and this is the configuration that i used in arduino IDE, hope its correct

[UPDATE]
so i am reading another similar question that suggest to change the baudrate to 115200. so this is the result.


the information on the serial monitor its still the same like before. then i push the button on the nodeMCU, the result now is different. the result is like this

i dont know whats that mean. the information have weird charachter
[UPDATE-2]
with the same process, i change the baudrate to 9600 the this is the result
image
another weird charachter pop up but different from before

74880 is the correct baud rate.

I think the problem is your WiFi password, or your are trying to connect to a 5GHz only WiFi connection (the NodeMCU is 2.4GHz WiFi only).

Pete.

ok thanks for the information about baudrate.
i think the wifi password is correct, but i dont know that my wifi is 5Ghz or not, i will check it now. i will update the result soon.
[UPDATE]


image
this is the information that i got from my wifi. my wifi (Zaidan) is 2.4G

If this is your actual WiFi password then it’s incorrect, as it has to be at least 8 characters.
Both the SSID and password are case-sensitive, so have to be the correct mix of capitals and lower case characters to exactly match your router’s credentials.

Pete.

im sorry im not explain it before, the password that i copy on that is not the actual password that i use. im using 8 charachters. and its so simple. my password is “12345678” so i think there is no error in this place.
image

Try rebooting the router, and ensuring that you don’t have any any restrictions about only whitelisted MAC addresses being allowed. I’d also try powering-off any repeaters etc whilst testing, and ensure that you have a large enough DHCP pool to allow the router to assign an IP address to the NodeMCU.

Once the NodeMCU connects to the router then you’ll see a message telling you the device’s IP address and it will then attempt to connect to the Blynk server.

Pete.

ok, so when i was searching the error, there is another clue. I’m from Indonesia and i use indihome for my provider. so there is an error when using wifi indihome to connect to the blynk. the error is login timeout. you can see the illustration in this link https://www.youtube.com/watch?v=Gy3qHe3jEpc ( but I think there is no translate to English. I got a recommendation from that video that I must use this code

Blynk.begin(auth,ssid,pass,"blynk-cloud.com",8080);

and I will test it after rebooting my router. i will update soon

Yes, this is what Dave was talking about with some ISPs blocking port 80, so needing to specify port 8080 instead.

However, your NodeMCU isn’t connecting to your WiFi, so it’s not getting to the point where it times-out connecting to the Blynk server.

Pete.

ok, im sorry that i not know that dave means was like that. and i think i will update it tomorrow sorry, i have another important task. i will update it very soon tomorrow as possible. thanks for today mr. pete

1 Like

[UPDATE]
ok, so when i try using the new program with changing this line

Blynk.begin(auth,ssid,pass,"blynk-cloud.com",8080);

it still not connected. in blynk still said that wasn’t online yet. the baudrate that I use is 74880.
when I click the push button on my nodeMcu its comes out like before.


and I want to ask, my nodeMCU is new, so i must calibrate it or something like that?

[UPDATE-2]
fortunately i have a led, so im using the 10k resistor and led to try this project https://www.instructables.com/NodeMCU-Basic-Project-Blink-a-LED/#:~:text=Step%201%3A%20Blink%20the%20On-board%20LED&text=First%2Cconnect%20the%20NodeMCU%20to,%2F%2F%20turn%20the%20LED%20off. and its work. so i think my nodeMcu is working fine. now i want to test with similar project but im using blynk to turn on and off the led. will update soon