I had a device named “Monorail” with a large webpage interface and a small mobile interface.
I have been developing this project daily for the past three months.
Everything was fine until I changed my password on my mobile.
After that, my device and template disappeared from the console and my mobile.
It looks like I just opened a new account, except my organization information is still there.
I know my project is alive somewhere, but I cannot recover it.
Thank you in advance for your help with this issue.
Sincerely, Jim
jim@felich.com
Adafruit ESP32-S2 TFT using WIFI
Mobile is Pixel 7 Pro running Android 13, last updated March 5, 2023.
Using Blynk Server• Blynk Library version
Blynk Console URL is Dashboard
Below is the sketch that loads and performs as expected.
It runs on the above hardware.
#define BLYNK_TEMPLATE_ID "TMPL27O8snOK_"
#define BLYNK_TEMPLATE_NAME "Monorail Controller"
#define BLYNK_AUTH_TOKEN "bWN5vYyn4f0w5Xx61jeI8TLYvNfaAPoL"
#define BLYNK_PRINT Serial
#define MOTOR_IN1 12
#define MOTOR_IN2 13
#define PIN_I2C_POWER 21
#define CLAMP_IN 6
#define CLAMP_OUT 5
#include <Arduino_BuiltIn.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include "Adafruit_LC709203F.h"
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>
// Use dedicated hardware SPI pins
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
Adafruit_LC709203F lc; //Start battery monitor
char ssid[] = "studio";
char pass[] = "pirongia";
int direction;
int throttle;
int speed;
BlynkTimer timer;
// This function is called every time the DIRECTION Virtual Pin 0 state changes
BLYNK_WRITE(V0) {
initThrottle();
direction = param.asInt();
runMotor(direction,speed);
}
void initThrottle() {
Blynk.virtualWrite(V1, 0);
Blynk.virtualWrite(V2, 0);
}
// This function is called every time the Virtual Pin 1 state changes
BLYNK_WRITE(V1) {
throttle = param.asInt();
Blynk.virtualWrite(V2, throttle); //update speed guage
runMotor(direction,throttle);
}
// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED() {
initThrottle();
Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
Blynk.setProperty(V3, "onImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
}
void myTimerEvent() {
Serial.print("Batt_Voltage: "); Serial.print(lc.cellVoltage(), 3); Serial.print(" Charge is "); Serial.print(lc.cellPercent(), 1);
Serial.print("% Batt_Temp :"); Serial.println(lc.getCellTemperature(), 1);
Blynk.virtualWrite(V3, lc.cellVoltage());
}
// setting PWM properties
const int freq = 5000;
const int pwmChannel = 0;
const int resolution = 8;
void setup() {
Serial.begin(115200); delay(8000); Serial.println("Hello");
ledcSetup(pwmChannel, freq, resolution); //Set up PWM for motors
pinMode(TFT_I2C_POWER, OUTPUT); // turn on I2C power
digitalWrite(TFT_I2C_POWER, HIGH);
lc.begin();
Serial.print(F("LC709203F "));Serial.print("Version: 0x"); Serial.println(lc.getICversion(), HEX);
lc.setThermistorB(3950);
Serial.print("Thermistor B = "); Serial.println(lc.getThermistorB());
lc.setPackSize(LC709203F_APA_3000MAH);
lc.setAlarmVoltage(3.8);
// Set up motor pins
pinMode(MOTOR_IN1, OUTPUT);
pinMode(MOTOR_IN2, OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
// Function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop() {
Blynk.run();
timer.run();
}
void runMotor(int dir, int spd) {
if (direction == 0) {
Serial.print("Forward Direction ");
ledcDetachPin(MOTOR_IN2);
digitalWrite(MOTOR_IN2, LOW);
ledcAttachPin(MOTOR_IN1, pwmChannel);
ledcWrite(pwmChannel, spd);
} else {
Serial.print("Reverse Direction ");
ledcDetachPin(MOTOR_IN1);
digitalWrite(MOTOR_IN1, LOW);
ledcAttachPin(MOTOR_IN2, pwmChannel);
ledcWrite(pwmChannel, spd);
}
Serial.print("Speed: "); Serial.println(spd);
}