Android app bug

facing issue with blynk android app … when I try to refresh the page the device suddenly disappears but is visible on web dashboard …facing this issue from latest update … blynk please solve this bug #bugs #projecthelp


#define BLYNK_TEMPLATE_ID "temepelateid"
#define BLYNK_DEVICE_NAME "devicename "
#define BLYNK_AUTH_TOKEN "authtoken"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); 
#include <Arduino.h>
#include <PZEM004Tv30.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//LiquidCrystal_I2C lcd(0x27,16,2); 

#if defined(ESP32)
/*************************
 *  ESP32 initialization
 * ---------------------
 * 
 * The ESP32 HW Serial interface can be routed to any GPIO pin 
 * Here we initialize the PZEM on Serial2 with RX/TX pins 16 and 17
 */
#if !defined(PZEM_RX_PIN) && !defined(PZEM_TX_PIN)
#define PZEM_RX_PIN 16
#define PZEM_TX_PIN 17
#endif

#define PZEM_SERIAL Serial2
#define CONSOLE_SERIAL Serial
PZEM004Tv30 pzem(PZEM_SERIAL, PZEM_RX_PIN, PZEM_TX_PIN);

#elif defined(ESP8266)
/*************************
 *  ESP8266 initialization
 * ---------------------
 * 
 * esp8266 can connect with PZEM only via Serial0
 * For console output we use Serial1, which is gpio2 by default
 */
#define PZEM_SERIAL Serial
#define CONSOLE_SERIAL Serial1
PZEM004Tv30 pzem(PZEM_SERIAL);
#else
/*************************
 *  Arduino initialization
 * ---------------------
 * 
 * Not all Arduino boards come with multiple HW Serial ports.
 * Serial2 is for example available on the Arduino MEGA 2560 but not Arduino Uno!
 * The ESP32 HW Serial interface can be routed to any GPIO pin 
 * Here we initialize the PZEM on Serial2 with default pins
 */
#define PZEM_SERIAL Serial2
#define CONSOLE_SERIAL Serial
PZEM004Tv30 pzem(PZEM_SERIAL);
#endif
float voltage ;
    float current ;
    float power; 
    float energy ;
    float frequency ;
    float factor ;
  float   apparentPower  ; 
 float reactivePower;
  
 
void sendSensor()
{
  //Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
 voltage = pzem.voltage();    
 current = pzem.current();
  power = pzem.power()*pzem.pf();
  factor = pzem.pf();
  apparentPower = pzem.power();
  reactivePower = pzem.power();
  energy = pzem.energy();
    Blynk.virtualWrite(V0, voltage);
    Blynk.virtualWrite(V1, current);
    Blynk.virtualWrite(V2,power);
     Blynk.virtualWrite(V3, factor);
    Blynk.virtualWrite(V4, apparentPower);
    Blynk.virtualWrite(V5,reactivePower);
    Blynk.virtualWrite(V6,energy);
    lcd.setCursor(0, 0);
  lcd.print("V= ");
  lcd.setCursor(2, 0);
  lcd.print(voltage);
  lcd.setCursor(9, 0);
  lcd.print("A= ");
  lcd.setCursor(11, 0);
  lcd.print(current);
  lcd.setCursor(9, 1);
  lcd.print("W= ");
  lcd.setCursor(11, 1);
  lcd.print(power);
  lcd.setCursor(0, 1);
  lcd.print("PF=");
  lcd.setCursor(3, 1);
  lcd.print(factor);

    
    delay(500);
}

char auth[] = "authtoken";

char ssid[] = "myssid";  // type your wifi name
char pass[] = "mypass";  // type your wifi password

BlynkTimer timer;

void setup() {
  lcd.init();
  lcd.backlight();
Serial.begin(115200);
 Blynk.begin(auth, ssid, pass);
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  timer.setInterval(100L, sendSensor);
 
}

void loop() {
  
  Blynk.run();
  timer.run();
}

Hello, @shubham188. What app version you use?

Version 1.11.2
updated on 17-july 2023

Hello @shubham188. Not reproduced for us. Please need more information.

  1. Maybe some steps to reproduce this issue.
  2. Maybe some additional information which will be useful for reproducing (phone model, plan in Blynk, count devices and etc.
  3. Also, if possible, please attach video record with this issue.

Regards

the device suddenly disappears when I refresh the page

Hi @shubham188,

It looks like you flashed the device using a BLYNK_AUTH_TOKEN created under one template and an BLYNK_TEMPLATE_ID from another template. You need to flash the device using the correct BLYNK_AUTH_TOKEN and BLYNK_TEMPLATE_ID.

Dmitriy from Blynk

@DimitryPB I have flashed correct credentials if that would be the issue it would cause problems in webdashboard aswell but it works fine in web. I tried it out with multiple accounts but again same thing happens

Nope. Web and mobile work in a different way.

@shubham188 please go to the web dashboard - device info tab - take a screenshot of the screen and send it here.

@DimitryPB @Dmitriy thakyou community to help me out … there was error inside my code(related to template id) I solved and voila it is now working perfectly fine

1 Like