1

I have a wemos d1 mini. I uploaded a code in wemos d1 mini and after that my wemos mini not working. I tried to upload another code in it even the led blink sketch and even a blank sketch but whenever I tried to do that it just shows connecting but never connects to Arduino ide.enter image description here First of all, whenever I tried to connect it to the computer or power it up, its built-in light stays bright and in the serial monitor, it shows garbage characters continuously. enter image description hereBut when I connect GPIO 0(d3) of wemos mini to the ground and press the reset button it starts the boot mode and when I upload any code it shows connecting but never upload any code here's the code which uploaded first in it.

#include <WiFiManager.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
 
//Pin assignments
#define switch_1 3 // D5 Pin of NodeMcu
#define switch_2 14 // D6 Pin of NodeMcu
#define switch_3 12 // D7 Pin of NodeMcu
#define switch_4 13
// D0 Pin of NodeMcu
#define button 2
#define relay_1 4 //D1 Pin of NodeMcu
#define relay_2 5 //D2 Pin of NodeMcu
#define relay_3 16 //RX Pin of NodeMcu
#define relay_4 15 //D4 Pin of NodeMcu
 
#define LED1 1 //D0 Pin of NodeMcu
 
int MODE = 0;
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Android-AP960A";
char pass[] = "talal123";
 
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "3ueT9aVLvkL60q8piJ6p5Kxx31zZ5xEC";
 
int switch_1_ON = 1;
int switch_2_ON = 1;
int switch_3_ON = 1;
int switch_4_ON = 1;
 
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay_1, pinValue); // process received value
}
 
BLYNK_WRITE(V2)
{
int pinValue = param.asInt(); // assigning incoming value from pin V2 to a variable
digitalWrite(relay_2, pinValue); // process received value
}
BLYNK_WRITE(V3)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay_3, pinValue); // process received value
}
 
BLYNK_WRITE(V4)
{
int pinValue = param.asInt(); // assigning incoming value from pin V2 to a variable
digitalWrite(relay_4, pinValue); // process received value
}
 
void internet() //When this device connects with internet
{
//**************************************
//Switch 1 configuration
//**************************************
if (digitalRead(switch_1) == HIGH)
{
if (switch_1_ON == 0 )
{
digitalWrite(relay_1, LOW);
Blynk.virtualWrite(V1, 0);
switch_1_ON = 1;
}
}
 
if (digitalRead(switch_1) == LOW )
{
if (switch_1_ON == 1)
{
digitalWrite(relay_1, HIGH);
Blynk.virtualWrite(V1, 1);
switch_1_ON = 0;
}
}
//**************************************
//Switch 2 configuration
//**************************************
if (digitalRead(switch_2) == HIGH)
{
if (switch_2_ON == 0 )
{
digitalWrite(relay_2, LOW);
Blynk.virtualWrite(V2, 0);
switch_2_ON = 1;
}
}
 
if (digitalRead(switch_2) == LOW )
{
if (switch_2_ON == 1)
{
digitalWrite(relay_2, HIGH);
Blynk.virtualWrite(V2, 1);
switch_2_ON = 0;
}
}
//**************************************
//Switch 3 configuration
//**************************************
if (digitalRead(switch_3) == HIGH)
{
if (switch_3_ON == 0 )
{
digitalWrite(relay_1, LOW);
Blynk.virtualWrite(V3, 0);
switch_3_ON = 1;
}
}
 
if (digitalRead(switch_3) == LOW )
{
if (switch_3_ON == 1)
{
digitalWrite(relay_3, HIGH);
Blynk.virtualWrite(V3, 1);
switch_3_ON = 0;
}
}
//**************************************
//Switch 4 configuration
//**************************************
if (digitalRead(switch_4) == HIGH)
{
if (switch_4_ON == 0 )
{
digitalWrite(relay_4, LOW);
Blynk.virtualWrite(V4, 0);
switch_4_ON = 1;
}
}
 
if (digitalRead(switch_4) == LOW )
{
if (switch_4_ON == 1)
{
digitalWrite(relay_4, HIGH);
Blynk.virtualWrite(V4, 1);
switch_4_ON = 0;
}
}
}
//********************************************
 
void no_internet() //When this device doesn't gets internet
{
//**************************************
//Switch 1 configuration
//**************************************
if (digitalRead(switch_1) == HIGH)
{
if (switch_1_ON == 0 )
{
digitalWrite(relay_1, LOW);
switch_1_ON = 1;
}
}
 
if (digitalRead(switch_1) == LOW )
{
if (switch_1_ON == 1)
{
digitalWrite(relay_1, HIGH);
switch_1_ON = 0;
}
}
//**************************************
//Switch 2 configuration
//**************************************
if (digitalRead(switch_2) == HIGH)
{
if (switch_2_ON == 0 )
{
digitalWrite(relay_2, LOW);
switch_2_ON = 1;
}
}
 
if (digitalRead(switch_2) == LOW )
{
if (switch_2_ON == 1)
{
digitalWrite(relay_2, HIGH);
switch_2_ON = 0;
}
}
//**************************************
//Switch 3 configuration
//**************************************
if (digitalRead(switch_3) == HIGH)
{
if (switch_3_ON == 0 )
{
digitalWrite(relay_1, LOW);
switch_3_ON = 1;
}
}
 
if (digitalRead(switch_3) == LOW )
{
if (switch_3_ON == 1)
{
digitalWrite(relay_3, HIGH);
switch_3_ON = 0;
}
}
//**************************************
//Switch 4 configuration
//**************************************
if (digitalRead(switch_4) == HIGH)
{
if (switch_4_ON == 0 )
{
digitalWrite(relay_4, LOW);
switch_4_ON = 1;
}
}
 
if (digitalRead(switch_4) == LOW )
{
if (switch_4_ON == 1)
{
digitalWrite(relay_4, HIGH);
switch_4_ON = 0;
}
}
}
 
void Blynk_status() // called every 3 seconds by SimpleTimer
{
bool isconnected = Blynk.connected();
if (isconnected == false)
{
MODE = 1;
digitalWrite(LED1, LOW);
}
if (isconnected == true)
{
MODE = 0;
digitalWrite(LED1, HIGH);
Blynk.syncAll();
}
}
 
void setup()
{
Serial.begin(115200);
Serial.println("n Starting");
pinMode(button, INPUT);
pinMode(switch_1, INPUT);
pinMode(relay_1, OUTPUT);
 
pinMode(switch_2, INPUT);
pinMode(relay_2, OUTPUT);
pinMode(switch_3, INPUT);
pinMode(relay_3, OUTPUT);
 
pinMode(switch_4, INPUT);
pinMode(relay_4, OUTPUT);
 
pinMode(LED1, OUTPUT);
 
//*****************************************
 
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
WiFi.begin(ssid, pass);
timer.setInterval(3000L, Blynk_status); // check if connected to Blynk server every 3 seconds
Blynk.config(auth);
}
 
void loop()
{
if ( digitalRead(button) == LOW ) {
WiFiManager wifiManager;
if (!wifiManager.startConfigPortal("Home Automator","1234")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
ESP.reset();
delay(3000);
}
Serial.println("connected...:)");
}
if (WiFi.status() == WL_CONNECTED)
{
Blynk.run();
}
 
timer.run(); // Initiates SimpleTimer
if (MODE == 0)
internet();
else
no_internet();
}

Please help me. I tried a lot to fix it but nothing happens. I checked the Com port in device manager and all the other necessary settings all were right here are the settings in Arduino ide.enter image description here Please help me Thanks in advance.

7
  • what is wired to the pins of the Wemos?
    – Juraj
    Dec 26, 2020 at 17:36
  • Do you have the serial monitor open while you're trying to upload?
    – Majenko
    Dec 26, 2020 at 19:17
  • 1
    yes I also tried to upload code by closing the serial monitor Dec 26, 2020 at 19:39
  • no wires are attached to wemos d1 mini Dec 26, 2020 at 19:39
  • shorts on headers soldering?
    – Juraj
    Dec 27, 2020 at 6:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.