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.
-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
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.
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.
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...
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
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
another weird charachter pop up but different from before
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]
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.
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.
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.
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
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
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.