Skip to content

Wifi Extender Functionality in ESP32 using Arduino IDE #7188

Answered by me-no-dev
aamiralidayo asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a good example running on Arduino v3.x

#include <WiFi.h>

#define STA_SSID "YOUR-SSID"
#define STA_PASS "YOUR-PASS"

#define AP_SSID "ESP32-STA-WIFI-BRIDGE"
#define AP_PASS "password"

IPAddress ap_ip(192, 168, 4, 1);
IPAddress ap_mask(255, 255, 255, 0);
IPAddress ap_leaseStart(192, 168, 4, 2);
IPAddress ap_dns(8, 8, 4, 4);

void setup() {
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Network.onEvent(onEvent);
  
  WiFi.AP.begin();
  WiFi.AP.config(ap_ip, ap_ip, ap_mask, ap_leaseStart, ap_dns);
  WiFi.AP.create(AP_SSID, AP_PASS);
  if(!WiFi.AP.waitStatusBits(ESP_NETIF_STARTED_BIT, 1000)){
    Serial.println("Failed to start AP!");
    return;
  }
  
  WiFi.begin(STA_SSI…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Rich968
Comment options

@me-no-dev
Comment options

Answer selected by me-no-dev
@Rich968
Comment options

@Rich968
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants