Skip to content

If WiFi.softAP() after WiFi connected, then Blynk can't work. #3884

@bestpika

Description

@bestpika

Basic Infos

Hardware

Hardware: WeMos D1 mini
Core Version: 7b09ae5
Blynk Version: blynkkk/blynk-library@dd7fe1f

Description

If WiFi.softAP() after WiFi connected, then Blynk can't work.
But 5c01841 is okay.

Sketch

Not work

#define BLYNK_PRINT Serial

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin("STA ssid", "STA passphrase");

  int wait = 0;
  while (!WiFi.isConnected() && wait++ < 10) {
    Serial.print(".");
    delay(1000);
  }
  WiFi.softAP("AP ssid", "AP passphrase");

  Blynk.config("Blynk Token", "blynk-cloud.com");
  Blynk.connect();
}

void loop()
{
  Blynk.run();
}

Serial

[10495]
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.10 on Arduino

[10499] Connecting to blynk-cloud.com:8442
[15500] Connecting to blynk-cloud.com:8442
[20501] Connecting to blynk-cloud.com:8442

Work

#define BLYNK_PRINT Serial

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin("STA ssid", "STA passphrase");

  WiFi.softAP("AP ssid", "AP passphrase");
  int wait = 0;
  while (!WiFi.isConnected() && wait++ < 10) {
    Serial.print(".");
    delay(1000);
  }

  Blynk.config("Blynk Token", "blynk-cloud.com");
  Blynk.connect();
}

void loop()
{
  Blynk.run();
}

Serial

[8525]
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.10 on Arduino

[8527] Connecting to blynk-cloud.com:8442
[8695] Ready (ping: 77ms).

Debug Messages

wifi evt: 2
wifi evt: 0
wifi evt: 3

[9634] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.10 on Arduino

[9635] Connecting to blynk-cloud.com:8442
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 188.166.206.43
wifi evt: 7
wifi evt: 7
[14636] Connecting to blynk-cloud.com:8442
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 188.166.206.43
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
[19637] Connecting to blynk-cloud.com:8442
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 188.166.206.43
wifi evt: 7
wifi evt: 7
[24638] Connecting to blynk-cloud.com:8442
[hostByName] request IP for: blynk-cloud.com
[hostByName] Host: blynk-cloud.com IP: 188.166.206.43
wifi evt: 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions