How to run program without connected to wifi(ESP-8266), Just use blynk to monitor sensor data

How to run program without connected to wifi, I Just use blynk app to monitor sensor data when it’ll be required.
Project Description
I use LDR sensor to turn on LED when light intensity decrease… But the problem is the LDR and LED is not functioning according to my coding until it’s get connected with internet. But my only purpose is to monitor sensor data in blynk app when it’s required. I use only ESP8266 for my project.

[Program for LDR]

Please help me . Check the program & tell me what changes i have to make in my program to run the program without connected to Internet & after internet connection just monitor the sensor data in blynk…

The Blynk flow is ESP —> server —> app and vice versa. You will need connection to either your “local” server or “cloud” server…

You didn’t post your code, so it’s difficult to give a definitive answer, and your description of the problem is a bit confusing.

Blynk.begin is a blocking function, which means that if your ESP starts-up and can’t connect to either WiFi or the Blynk server then the code will never progress beyond the Blynk.begin line of code.
If what you are looking for is for the code to run normally and control your LED when the ESP can’t connected to WiFi/Blynk then you need to use the Blynk.config and Blynk.connect commands instead of Blynk.begin.

Obviously the wont allow you to monitor things in this situation, but the core functionality of controlling the LED with the LDR will still work.

Search the forum for posts about code execution without WiFi and Blynk.config and you’ll see examples of how to modify your code.


Program link

Problem: the logic(Led off when light high,led on when light is low) i used in my program is not working until the device is connected to internet.
I use blynk just to monitor LDR sensor value…

And the code you linked uses:

  Blynk.begin(auth, ssid, pass);

which is the issue.


Can you please tell me that are the other changes i have make in coding except this line…?

You need to manually establish the WiFi connection, then define the Blynk parameter in Blynk.config then make the connection to the Blynk server using Blynk.connect (although this is t completely necessary as a connection will be established at the first execution of, but I think it’s better to do it explicitly).

As I said earlier, there are numerous topics and tutorials about this on the forum and a quick search will give you all the information you require.