I have trying to connect to my MCU, after working using Blynk, with another different Wifi HotSpot following some tutorials but had not be possible. The MCU try to connect to the previous Wifi AP name and credentials and never is possible to make a reset to reconfigure as is documented in the manuals too.
After a deep analysis in the Blynk files, concretelly “settings.h”, was found that the pin for reset is zero “0” for all MCU types except USE_WROVER_BOARD.
However Wemos Lolin32 Reset button is connected to EN input so never is going to enter in reconfiguration by using the reset pin. Also, to be able the Led pin flashes as indicated in tutorials, the BOARD_LED_PIN defined should be declared as LED_BUILTIN because Arduino environment sets the correct pin when MCU type is changed to another.
To solve the LED subject, “settings.h” code was modified including a condition in case of ARDUINO_LOLIN32 is being defined as follows…
/*
* Board configuration (see examples below).
*/
#if defined(USE_WROVER_BOARD)
#define BOARD_BUTTON_PIN 15
#define BOARD_BUTTON_ACTIVE_LOW true
#define BOARD_LED_PIN_R 0
#define BOARD_LED_PIN_G 2
#define BOARD_LED_PIN_B 4
#define BOARD_LED_INVERSE false
#define BOARD_LED_BRIGHTNESS 128
#elif defined(USE_TTGO_T7)
// This board does not have a built-in button
// Connect a button to gpio0 <> GND
#define BOARD_BUTTON_PIN 0
#define BOARD_BUTTON_ACTIVE_LOW true
#define BOARD_LED_PIN 19
#define BOARD_LED_INVERSE false
#define BOARD_LED_BRIGHTNESS 64
#else
#warning "Custom board configuration is used"
#define BOARD_BUTTON_PIN 0 // Pin where user button is attached
#define BOARD_BUTTON_ACTIVE_LOW true // true if button is "active-low"
#if defined(ARDUINO_LOLIN32)
#define BOARD_LED_PIN LED_BUILTIN // Set LED pin - if you have a single-color LED attached
#else
#define BOARD_LED_PIN 12 //XNC01 // Set LED pin - if you have a single-color LED attached
#endif
//#define BOARD_LED_PIN_R 15 // Set R,G,B pins - if your LED is PWM RGB
//#define BOARD_LED_PIN_G 12
//#define BOARD_LED_PIN_B 13
//#define BOARD_LED_PIN_WS2812 4 // Set if your LED is WS2812 RGB
#define BOARD_LED_INVERSE false // true if LED is common anode, false if common cathode
#define BOARD_LED_BRIGHTNESS 64 // 0..255 brightness control
#endif
The code would be extensible to all MCU board types by changing declare
#define BOARD_LED_PIN LED_BUILTIN
at the beginning of this settings.h file and removing the rest of references because Arduino changes the LED pin according to the MCU selected.
On the other hand, to be able to carry out the necessary reset for the reconfiguration of the AP, it is necessary to put pin 0 to ground for the necessary 10 seconds. This can be done by means of a cable or by means of tweezers since the two pins; labeled “0” and “GND” are next.
Once the message that the flash has been deleted appears, proceed to make the connection with the new AP following the usual procedure.
If the change has been made in the “settings.h” file as indicated, the LED will be activated as described in the procedures.
I hope this helps other developers who have encountered this problem.
Greetings community.