OTA: Cant connect to Wemos D1 Mini via phone

Hello!

We are using a Wemos D1 Mini v3

Our previous code without OTA (over the air) updates works great. Now we want te be able to update via OTA.

I used the Blynk.Edgent example. I implemented our code in the Edgent. It looks to work okay but when i try to get my phone connected to the Wemos it wont so. I get an error on my phone: Cant connect to this network. Then i tried to use just the Edgent example code and got the same problem/error.

Is there a way to solve this or is there a way to bypass the mandatory connection to the phone before it connects with the WiFI?

I’d suggest that you provide more detail.

  • Which pins have you connected a physical button to?
  • Are these same pins defined in the Settings.h file, for the board type that you’ve un-commented in the main .ino file?
  • When you press this physical button, do you see confirmation in the serial monitor?
  • If you press it for 10 seconds, does it clear the stored WiFi credentials?
  • What output do you see in the serial monitor when you are trying to re-provision the board?
  • How many characters are there in your BLYNK_DEVICE_NAME ?
  • When you refer to OTA, do you mean Blynk.Air, or Arduino OTA?

Pete.

Hi Pete,

The pins i am using are:
D1: Relais shield
D4: PWM singal for fans
D6: DHT22
D7: DHT22
D8: DHT22

I am not using a physical button

I did not define these pins in the Settings.h but in the main file. Also i did uncommend our board in the main file.

I do mean the Blynk.Air option.

The problem i am facing is when you start the Wemos with the edgent it will make its own “network” You need to connect to that network via the app. But when i try to connect, my phone gives me an error saying: Cant connect to this network.

When i pre-define the Wifi credentials in the main file (as i am doing with my non OTA code) it still wants me to connect to its own network before it will connect to Wifi.

Here is the youtube video i watched: https://youtu.be/IKbbvEzZ7wg

You need to un-comment #define USE_WEMOS_D1_MINI in the main .ino file…

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
//#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI <<<<<<<<<<<<<<<<<<<<<<<<<<<<

That will enable this part of the Settings.h configuration file, rather than the custom board configuration…

/*
 * Board configuration (see examples below).
 */

#if defined(USE_NODE_MCU_BOARD) || defined(USE_WEMOS_D1_MINI)

  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN               2
  #define BOARD_LED_INVERSE           true
  #define BOARD_LED_BRIGHTNESS        255

#elif defined(USE_SPARKFUN_BLYNK_BOARD)

  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN_WS2812        4
  #define BOARD_LED_BRIGHTNESS        64

You need to connect a momentary pushbutton to GPIO0 (PIn D3) and GND. The onboard LED is already connected to GPIO2…

You then need to answer these questions (preferably one at a time, in the order that they were asked)…

Pete.

Hi Pete,

I did uncommend #define USE_WEMOS_D1_MINI in the main file.

I will try to connect the button.

But is there a way to bypass the need of first connecting to the “network” of the wemos and than filling in the wifi credentials via the phone app? (shown in the youtube link at 10.16)

With my “normal” code you define the Wifi credentials and it will connect to that network.

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = ".....";
char pass[] = "......";

Edgent is designed to be used with dynamic provisioning.

Pete.