structure7 / waterLeakSensor

Adding an ESP8266 to a kit water sensor and stuff.
MIT License
0 stars 0 forks source link

Re-evaluate while (Blynk.connect() == false) #4

Open structure7 opened 7 years ago

structure7 commented 7 years ago
  while (Blynk.connect() == false) {
    // Wait until connected
  }

If I take this out will the sketch just push on? Need to test. Maybe I could just put this argument elsewhere in my sketch (where Blynk is actually being ran).

structure7 commented 7 years ago

Like Costa did something like this:

while (Blynk.connect() == false) {
    if(((millis()/1000) - timeout) > 10){   // issue msg if not connected to Blynk in more than 10 seconds
      firstrow =  "Check the";  // for OLED
      secondrow = " Router  ";  // for OLED
      if(DEBUG){
        Serial.println("Check the router");
      }
      break; 
    }

(http://community.blynk.cc/t/code-isnt-working-without-connected-blynk/5624/10?u=structure7)

Might be good for any other device with an LCD screen, etc.

structure7 commented 7 years ago

Especially considering I want MQTT to punch through regardless.