I don’t have any issue with my code it works fine, it has been working for a year or more but suddenly last week all my users logged out and now no-one can see my device.
I tried to delete and re-invite the users but still no luck.
They’re getting a message saying “YOU HAVE NO ACTIVE DEVICE”.
/**********************************************************/
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <BlynkSimpleEsp8266.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
//char auth[] =
char auth[] = "*****************"; // Auth Token for device '*********' : "*****************"
//const char* ssid = "*************"; // Replace with your network credentials
//const char* pass = "***********";
const char* ssid = "*********"; // Replace with your network credentials
const char* pass = "********";
void setup() {
Serial.begin(9600);
Serial.println("Booting");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
// Port defaults to 8266
ArduinoOTA.setPort(8266);
// Hostname defaults to esp8266-[ChipID]
ArduinoOTA.setHostname("Main-Gate");
// No authentication by default
//ArduinoOTA.setPassword((const char *)"********");
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();
Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
digitalWrite(D0, HIGH);
digitalWrite(D1, HIGH);
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
BLYNK_WRITE(V0) // Button Widget writes to Virtual Pin V0
{
if(param.asInt() == 0) { // if Button sends 0
pinMode(D1, OUTPUT);
digitalWrite(D1, LOW); // start the function
}else
if(param.asInt() == 1) { // if Button sends 1
pinMode(D1, INPUT);
digitalWrite(D1, HIGH); // start the function
}
}
BLYNK_WRITE(V1) // Button Widget writes to Virtual Pin V1
{
if(param.asInt() == 0) { // if Button sends 0
pinMode(D0, OUTPUT);
digitalWrite(D0, LOW); // start the function
}else
if(param.asInt() == 1) { // if Button sends 1
pinMode(D0, INPUT);
digitalWrite(D0, HIGH); // start the function
}
}
void loop() {
ArduinoOTA.handle();
Blynk.run();
}