WEMOS D1 R2 no show temporal wifi

Hello everyone, I have this project and at first the temporary Wi-Fi appeared, but then when I soldered all the cables and went to install it in the final place, the network did not appear, I uploaded the program again and nothing, I have I tried the program on another board the same and it works, I have removed everything, I have returned to my house and by surprise in my house the temporary Wi-Fi appears when I connect the board where it did not work and the one that worked has stopped appearing, I do not understand it, and previously I have removed the devices from the application.


#define BLYNK_TEMPLATE_ID           "XXXX"
#define BLYNK_TEMPLATE_NAME         "XXX" 
#define BLYNK_FIRMWARE_VERSION      "0.1.0"
#define BLYNK_FIRMWARE_TYPE         "WEMOS D1 R2"
#define BLYNK_DEVICE_NAME           "test"
#define BLYNK_PRINT Serial
#define APP_DEBUG
#include "BlynkEdgent.h" 
#define USE_WEMOS_D1_MINI

int ledPins[] = {1, 2, 3, 4, 5}; // Define un array con los pines de los LEDs
int inputPin = 12; // Define el pin de entrada
int inputValue = 0; // Variable para almacenar el estado de la entrada
int ledPin = V1; // ID del pin del LED virtual en Blynk
int ledSequencePin = V2; // ID del pin del segundo botĂłn virtual en Blynk

BLYNK_WRITE(V0)
{
  int pin=param.asInt();
  if (pin == 1) { // Si el widget de botón está encendido
    for(int i=0; i<5; i++){ // Recorre todos los pines de los LEDs
      digitalWrite(ledPins[i], HIGH); // Enciende el LED actual
      delay(1000); // Espera 1 segundo
      digitalWrite(ledPins[i], LOW); // Apaga el LED actual
    }
  }
}

BLYNK_WRITE(V2)
{
  int pin = param.asInt();
  if (pin == 1) { // Si el widget de botón está encendido
    for (int i = 0; i < 4; i++) { // Recorre todos los pines de los LEDs en el orden led1, led2, led3, led4 y led1
      digitalWrite(ledPins[i], HIGH); // Enciende el LED actual
      delay(1000); // Espera 1 segundo
      digitalWrite(ledPins[i], LOW); // Apaga el LED actual
    }
    digitalWrite(ledPins[0], HIGH); // Enciende el primer LED nuevamente para completar la secuencia
    delay(1000); // Espera 1 segundo
    digitalWrite(ledPins[0], LOW); // Apaga el primer LED nuevamente para completar la secuencia
  }
}

void updateLED() {
  Blynk.virtualWrite(ledPin, inputValue); // Actualiza el estado del LED virtual en Blynk
}

void setup()
{
  Serial.begin(115200);
  delay(100);
  for(int i=0; i<5; i++){ // Configura los pines de los LEDs como salidas
    pinMode(ledPins[i], OUTPUT);
  }
  pinMode(inputPin, INPUT_PULLUP); // Configura el pin de entrada como entrada con pull-up
  BlynkEdgent.begin();
  Blynk.virtualWrite(ledPin, inputValue); // Inicializa el estado del LED virtual en Blynk
}

void loop() {
  BlynkEdgent.run();
  int newInputValue = digitalRead(inputPin); // Lee el estado de la entrada
  if (newInputValue != inputValue) { // Si el estado de la entrada cambiĂł
    inputValue = newInputValue; // Actualiza la variable
    updateLED(); // Actualiza el LED virtual en Blynk
  }
}

@ale1cxn Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

1 Like

Thank you, I found the solution, the Wi-Fi credentials of the previous connection were recorded, I found a code that eliminates them, then I reloaded the code and it finally appeared.

You shouldn’t need to do that. Edgent has the facility to clear the credentials using a long (10 second) press of the button defined in Settings.h

But you’ve chosen the D1 Mini board type, and if you look at the Settings.h tab you’ll see that this used GPIO0 and GPIO2 by default.

Your sketch says that you’re using GPIO1 to 5 for your LEDs, but the if loop in void setup is initialising GPIO0 to 4

You need to be careful which GPIOs you use with the ESP8266 based boards, as some can prevent the board from booting if pulled HIGH or LOW

I’d suggest that you start by reading this…

then read this…

Pete.

Thank you very much, very interesting, I didn’t know and I was going crazy to find out what was happening.