Hi masters,
so I tried to edit the code as smart as I can do (I can not much ) and here is the result I uploaded into ESP (at least I did not get any compilation errors (yay))
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS D2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
char auth[] = "xxxxx";
char ssid[] = "xxx";
char pass[] = "xxx";
IPAddress ip(192, 168, 16, 166);
IPAddress gateway(192, 168, 16, 254);
IPAddress subnet(255, 255, 255, 0);
IPAddress DNS(8, 8, 8, 8);
void setup()
{
sensors.begin();
Serial.begin(115200);
Serial.print("\nRebooted at: ");
long starttime = millis();
Serial.println(starttime);
WiFi.config(ip, gateway, subnet, DNS);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
Serial.print("."); // not required, just used for effect
delay(1);}
Blynk.config(auth);
Blynk.connect();
sendTemps();
}
void sendTemps()
{
sensors.requestTemperatures();
float temp = sensors.getTempCByIndex(0);
Serial.println(temp);
Blynk.virtualWrite(V20, temp);
ESP.deepSleep(30000000);
}
void loop()
{
Blynk.run();
}
based on measurements it seems it is still around 6 seconds from time I reboot ESP by button until the first temp value is shown in the serial monitor. Basically the most time is spend (it seems like that) until I get [5001] Connecting to blynk-cloud.com:8442. Time between I see the “blynk picture” and Connecting to blynk-cloud is approximately 4 seconds
is this somehow connected with that statement blynk has some default timer until it connects to wifi, and this can be bypassed? I have seen in another Costas topic something like:
Blynk.connect(3333)