Value Display, gauge not working

Hi,
today i have problem with value to show on value display and gauge… History Graph is ok on same V-pin.
login mail: misos@atlas.sk

Hello. More info maybe?

Hi, i do not know more why. I added Value display but no data is displayed. until this day it was all right.
ino file: https://drive.google.com/open?id=0B1-XItdqvMPbY181aTJ2aEMxZzg


> #include <FS.h>                   //this needs to be first, or it all crashes and burns...
> //#define BLYNK_DEBUG           // Comment this out to disable debug and save space
> //#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
> #include <BlynkSimpleEsp8266.h>
> #include <ESP8266WiFi.h>
> #include <DNSServer.h>
> #include <ESP8266WebServer.h>
> #include <WiFiManager.h>          //https://github.com/tzapu/WiFiManager
> #include <TimeLib.h>
> #include <WidgetRTC.h>
> #include <SimpleTimer.h>
> //#include <Adafruit_Sensor.h>
> //for LED status
> #include <Ticker.h>
> #include <ArduinoJson.h>
> Ticker ticker;
> WidgetRTC rtc;
> #include <ArduinoOTA.h>
> #include "DHT.h"
> #include <DHT_U.h>
> extern "C" {
>   #include "user_interface.h"
> }
> #define DHTPIN 4     // what digital pin we're connected to
> #define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
> DHT_Unified dht(DHTPIN, DHTTYPE);
> char blynk_token[34] = "BLYNK_TOKEN";
> char Date[16];
> char Time[16];
> const char* host1 = "maker.ifttt.com";
> const char* apiKey1 = "maker apy key";
> const char* door_state = "closed";

> bool shouldSaveConfig = false; //flag for saving data

> SimpleTimer timer;
> BLYNK_ATTACH_WIDGET(rtc, V5);
> void printDigits(int digits)
> {
>   Serial.print(":");
>   if (digits < 10) {
>     Serial.print('0');
>   }
>   Serial.print(digits);
> }

> // Digital clock display of the time

> void mqtt()
> {
>    
>   Blynk.virtualWrite(V15, millis() / 1000);
>   Serial.print(millis() / 1000);
>   sensors_event_t event;  
>   dht.temperature().getEvent(&event);
>   if (isnan(event.temperature)) {
>     Serial.println("Error reading temperature!");
>   } else {
>     Blynk.virtualWrite(V10, event.temperature);
>     Blynk.virtualWrite(V11, event.temperature);
>     Serial.println(event.temperature);
>   }
>   dht.humidity().getEvent(&event);
>   if (isnan(event.relative_humidity)) {
>     Serial.println("Error reading humidity!");
>   } else {
>     Blynk.virtualWrite(V12, event.relative_humidity);
>     Serial.print(event.relative_humidity);
>   }
> }

> void clockDisplay()
> {
>   //WiFiClient client;
>   // You can call hour(), minute(), ... at any time
>   // Please see Time library examples for details

>   String currentTime = String(hour()) + ":" + minute() + ":" + second();
>   String currentDate = String(day()) + " " + month() + " " + year();
>   Serial.print("Current time: ");
>   Serial.print(currentTime);
>  >  Serial.print(" ");
>  ` Serial.print(currentDate);`
>   Serial.print(" ");
>   //if (weekday()== 7) {    Serial.print("sobota");  }
>   //if (weekday()== 1) {    Serial.print("nedela");  }
>   //if (weekday()== 2) {    Serial.print("pondelok");  }
>   //if (weekday()== 3) {    Serial.print("utorok");  }
>   //if (weekday()== 4) {    Serial.print("streda");  }
>   //if (weekday()== 5) {    Serial.print("stvrtok");  }
>   //if (weekday()== 6) {    Serial.print("piatok");  }
>   
>   Serial.println();
>   
>   // Send time to the App
>   Blynk.virtualWrite(V1, currentTime);
>   // Send date to the App
>   Blynk.virtualWrite(V2, currentDate);
> /* Serial.print("connecting to ");
>           Serial.println(host1);
>            const int httpPort1 = 80;
>            if (!client.connect(host1, httpPort1)) {
>               
>             Serial.println("connection failed");
>              return;
>            }
>   String url1 = "/trigger/door_status/with/key/";
>           url1 += apiKey1;
>           
>           Serial.print("Requesting URL: ");
>           Serial.println(url1);
>           client.print(String("POST ") + url1 + " HTTP/1.1\r\n" +
>                        "Host: " + host1 + "\r\n" + 
>                        "Content-Type: application/x-www-form-urlencoded\r\n" + 
>                        "Content-Length: 13\r\n\r\n" +
>                        "value1=" + door_state + "\r\n");*/
> }                     

> void tick()
> {
>   //toggle state
>   int state = digitalRead(BUILTIN_LED);  // get the current state of GPIO1 pin
>   digitalWrite(BUILTIN_LED, !state);     // set pin to the opposite state
> }

> void saveConfigCallback () {  //callback notifying us of the need to save config
>   Serial.println("Should save config");
>   shouldSaveConfig = true;
>   ticker.attach(0.2, tick);  // led toggle faster
> }

> void setup(){
>   Serial.begin(115200);
>   dht.begin();
>   Serial.println();
>   ArduinoOTA.onStart([]() {
>     Serial.println("Start");
>   });
>   ArduinoOTA.onEnd([]() {
>     Serial.println("\nEnd");
>   });
>   ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
>     Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
>   });
>   ArduinoOTA.onError([](ota_error_t error) {
>     Serial.printf("Error[%u]: ", error);
>     if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
>     else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
>     else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
>     else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
>     else if (error == OTA_END_ERROR) Serial.println("End Failed");
>   });
>   ArduinoOTA.begin();
>   //set led pin as output
>   pinMode(BUILTIN_LED, OUTPUT);
>   // start ticker with 0.5 because we start in AP mode and try to connect
>   ticker.attach(0.6, tick);

>   //SPIFFS.format();    //clean FS, for testing
>   Serial.println("Mounting FS...");    //read configuration from FS json

>   if (SPIFFS.begin()) {
>     //Serial.println("Mounted file system");
>     if (SPIFFS.exists("/config.json")) {
>       //file exists, reading and loading
>      // Serial.println("Reading config file");
>       File configFile = SPIFFS.open("/config.json", "r");
>       if (configFile) {
>         //Serial.println("Opened config file");
>         size_t size = configFile.size();
>         // Allocate a buffer to store contents of the file.
>         std::unique_ptr<char[]> buf(new char[size]);

>         configFile.readBytes(buf.get(), size);
>         DynamicJsonBuffer jsonBuffer;
>         JsonObject& json = jsonBuffer.parseObject(buf.get());
>         json.printTo(Serial);
>         if (json.success()) {
>           Serial.println("\nparsed json");

>           strcpy(blynk_token, json["blynk_token"]);

>         } else {
>           Serial.println("Failed to load json config");
>         }
>       }
>     }
>   } else {
>     Serial.println("Failed to mount FS");
>   }
>   //end read

>   // The extra parameters to be configured (can be either global or just in the setup)
>   // After connecting, parameter.getValue() will get you the configured value
>   // id/name placeholder/prompt default length
>   WiFiManagerParameter custom_blynk_token("blynk", "blynk token", blynk_token, 33);   // was 32 length
>   
>   //Serial.println(blynk_token);

>   //WiFiManager
>   //Local intialization. Once its business is done, there is no need to keep it around
>   WiFiManager wifiManager;

>   wifiManager.setSaveConfigCallback(saveConfigCallback);   //set config save notify callback

>   //set static ip
>   // this is for connecting to Office router not GargoyleTest but it can be changed in AP mode at 192.168.4.1
>   //wifiManager.setSTAStaticIPConfig(IPAddress(192,168,10,111), IPAddress(192,168,10,90), IPAddress(255,255,255,0));
>   
>   wifiManager.addParameter(&custom_blynk_token);   //add all your parameters here

>   //wifiManager.resetSettings();  //reset settings - for testing

>   //set minimu quality of signal so it ignores AP's under that quality
>   //defaults to 8%
>   //wifiManager.setMinimumSignalQuality();
>   
>   //sets timeout until configuration portal gets turned off
>   //useful to make it all retry or go to sleep, in seconds
>   wifiManager.setTimeout(600);   // 10 minutes to enter data and then Wemos resets to try again.

>   //fetches ssid and pass and tries to connect, if it does not connect it starts an access point with the specified name
>   //and goes into a blocking loop awaiting configuration
>   if (!wifiManager.autoConnect("ESP_AP", "11111111")) {
>     //Serial.println("Failed to connect and hit timeout");
>     delay(3000);
>     //reset and try again, or maybe put it to deep sleep
>     ESP.reset();
>     delay(5000);
>   }
>   //Serial.println("Connected ESP");   //if you get here you have connected to the WiFi
>   ticker.detach();
>   //turn LED off
>   digitalWrite(BUILTIN_LED, HIGH);

>   strcpy(blynk_token, custom_blynk_token.getValue());    //read updated parameters

>   if (shouldSaveConfig) {      //save the custom parameters to FS
>     //Serial.println("saving config");
>     DynamicJsonBuffer jsonBuffer;
>     JsonObject& json = jsonBuffer.createObject();
>     json["blynk_token"] = blynk_token;

>     File configFile = SPIFFS.open("/config.json", "w");
>     if (!configFile) {
>       //Serial.println("Failed to open config file for writing");
>     }

>     json.printTo(Serial);
>     json.printTo(configFile);
>     configFile.close();
>     //end save
>   }

>   //Serial.println("local ip");
>   //Serial.println(WiFi.localIP());
>   
>   Blynk.config(blynk_token);
>   Blynk.connect();
>   rtc.begin();
>   timer.setInterval(10000L, clockDisplay);
>   timer.setInterval(5000L, mqtt);
> }

>   void loop()
> {
>   Blynk.run(); // Initiates Blynk
>   timer.run(); // Initiates SimpleTimer  
>   ArduinoOTA.handle();
> }

You added Value display some days ago and it was ok but it isn’t today, or the Value display was added today and it doesn’t show what you expect it to?

Some days ago i added gauge, but today i added value display with no luck, then gauge and same problem. nothing displayed. on it, but graph is updated with no problem.

OK, i thing it
happened because i renamed the project in blynk app. now i created new project with same program on wemos and it work ok. maybe the problem is just renaming the project. Could someone check.

Android or the other OS?
I change my project names regularly in Android and never had a problem.

Android and same on IOS.

@misosz could you please provide steps to reproduce issue?

I will try.

  1. I have project with name EPS8266 with 2x Gauge on V10 and V11, hist.graph on V11, RTC V5, and 2x value displ. V1 and V2 for time and date.
    2.today i renamed project to DHT22 - all ok. then i Removed gauge and i added value display - here it all begin. No data displayed. Hist.graph was ok. then i removed rtc, graph time and date value displays and added another new for hummidity.No data displayed. then i add hist.graph and graph was OK, filled with data - graph line updated every 5 seconds. Value dysplay no luck.
    3 i removed project, then created new with same sketch, added same value displays and everithing is now OK.

Sorry, i do not speak english very good.