I am new to Blynk, I am testing my first app, I’ve built my app with a name “Climate Control” and using Wemos D1 ESP8266 standalone board that is connected to my phone’s hotspot. As you can see, I’ve configured both the ssid & password there in the code, as well as the auth key.
Previously, I’ve tried the ESP8266 with DHT22 sensor and it displays both temperature and humidity readings on serial monitor. Means, my Wemos ESP8266 board is working.
So now, why my app says Climate Control is offline because my phone’s hotspot is also connecting to the PC I’m using now and I can browse the internet.
The issue isn’t with your app, and is instead with your hardware. It would appear you named your device and your app the same, hence it’s telling you your device is offline.
… we can’t see your code, although it would be helpful for you to post it here (Remember to put it between triple back-ticks ``` around your code)
That may be your issue. Some mobile hotspots will block the Blynk traffic to the server.
But, it could be any number of other things and without seeing your code and serial monitor output, plus knowing your hardware, phone O/S, Blynk library version etc. etc. etc. it’s impossible to say.
//Maps the pins on the Wemos D1 for D0-D10 to Arduino pin layout
#define D0 3
#define D1 1
#define D2 16
#define D3 5
#define D4 4
#define D5 14
#define D6 12
#define D7 13
#define D8 0
#define D9 2
#define D10 15
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "KN4-H4ujgAYlrnEB2lxWl7Mk0bQUNv6l";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "iPhone X";
char pass[] = "me083009";
#define DHTPIN 5 // What digital pin we're connected to
// 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);
BlynkTimer 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);
Blynk.virtualWrite(V6, t);
Serial.print(t); // Print temperature to the Serial Port
Serial.print("°C "); // Write unit of Celsius
Serial.print(h); // Print humidity to the Serial Port
Serial.print("RH "); // Write unit of RH, relative humidity (0-100%)
Serial.println(); // Write newline
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}```
You don’t need to reply to both of us <3, one post would suffice. It seems your issue is with connecting to the Blynk cloud, I would recommend you try and use another network if you haven’t already and then see what difference that makes.
by the way, based on the two sensor readings displayed on my app, can I set a condition like when both readings reach 50, then Blynk app will turn on an LED at my Wemos device?
Slightly longer answer - Yes, but you’ll need to learn some C++ coding skills. People on this forum will help you with technical Blynk issues, but what you’ve described has nothing at all to do with Blynk.
Time invested in learning C++ will pay dividends, as I can guarantee that once you’ve written the code to turn on this LED under these circumstances, you’ll also come up with other enhancements that you’ll want to add.
You’ll be looking at code that says something like…