Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] Blynk not supports being in WIFI_AP_STP mode #601

Open
yadsun687 opened this issue Dec 1, 2024 · 0 comments
Open

[ESP32] Blynk not supports being in WIFI_AP_STP mode #601

yadsun687 opened this issue Dec 1, 2024 · 0 comments

Comments

@yadsun687
Copy link

Blynk library version: 1.3.2
IDE: Platform.IO/
IDE version: [6.1.16]
Board type: [esp32doit-devkit-v1]
Additional modules: WiFi.h

Scenario, steps to reproduce

Currently, I use esp32 to act like a gateway that will receives string data from another esp32 board using WiFiServer/WiFiClient. The gateway board will then convert that data and push it to Blynk platform through my home wifi network.
The layout look like this:
[sensor board] --send--> [gateway board] --send--> [Blynk platform]

The gateway board code:

void setup(){
  WiFi.mode(WIFI_AP_STA);
  WiFi.softAP(BOARD_SSID, BOARD_PASS);
  Blynk.begin(AUTH, WIFI_ID, WIFI_PASS);
}

But as you can see in <BlynkSimpleEsp32.h>. This function seems to handle only wifi in station mode.

    void connectWiFi(const char *ssid, const char *pass)
    {
        BLYNK_LOG2(BLYNK_F("Connecting to "), ssid);
        WiFi.mode(WIFI_STA);
        if (pass && strlen(pass))
        {
            WiFi.begin(ssid, pass);
        }
        else
        {
            WiFi.begin(ssid);
        }
        while (WiFi.status() != WL_CONNECTED)
        {
            BlynkDelay(500);
        }
        BLYNK_LOG1(BLYNK_F("Connected to WiFi"));

        IPAddress myip = WiFi.localIP();
        (void)myip; // Eliminate warnings about unused myip
        BLYNK_LOG_IP("IP: ", myip);
    }

Expected Result

It should support WIFI_AP_STP mode.

Actual Result

My sender board can't send data through the gateway board network because Blynk library changes wifi mode back to WIFI_STA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant