Hi,
I would like to configure my ESP32 to have a bridged connection between the Ethernet and WiFi SoftAP in Arduino Code. I have a working Ethernet connection with my ESP32 board using an IP101 phy. Also have a Working WiFi SoftAP running on the ESP32 at same time. But the connection between the ESP32's Ethernet and WiFi AP isn't bridged.
Have anyone been able to bridge their Ethernet and Wifi SoftAP?
See posted below a couple snippets of my code (mostly included important parts with regards to ethernet and wifi softAP). If anyone have any information on how I can bridge the two interfaces please let me know.
******** File Start **********
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiAP.h>
#include <ETH.h>
#include <esp_eth.h>
#include <esp_eth_phy.h>
#include <phy.h>
#define ETH_PHY_ADDR 1
#define ETH_MDC_GPIO 23
#define ETH_MDIO_GPIO 18
#define ETH_POWER_PIN -1
#define ETH_TYPE ETH_PHY_TLK110
#define ETH_PHY_CLK_PIN 0
const char *ssid = "MyWifiSSID";
const char *password = "MyWiFIPassword";
WiFiServer server(80);
// ******** Setup (Init) function START *********
void setup() {
pinMode(ETH_PHY_CLK_PIN, INPUT);
Serial.begin(115200);
Serial.println();
Serial.println("Configuring access point...");
//Ethernet IP, Gateway, Subnet and DNS config
IPAddress eth_ip(192, 168, 1, 12);
IPAddress eth_subnet(255, 255, 255, 0);
IPAddress eth_gateway(192, 168, 1, 1);
IPAddress eth_dns(8, 8, 8, 8);
//Access Point IPs & Subnet
IPAddress APip(192,168,1,13);
IPAddress APSubnet(255,255,255,0);
//getting ETH MAC addr
uint8_t mac[6];
ETH.macAddress(mac);
IPAddress eth_mac(mac);
Serial.print("Starting Ethernet *************");
ETH.begin(ETH_PHY_ADDR, ETH_POWER_PIN, ETH_MDC_GPIO, ETH_MDIO_GPIO, ETH_TYPE);
ETH.config(eth_ip, eth_gateway, eth_subnet, eth_dns);
while (ETH.linkSpeed() == 0) {
Serial.println("Connecting to Ethernet...");
delay(1000);
}
Serial.println("Connected to Ethernet");
WiFi.softAPConfig(APip,eth_ip,APSubnet);
if (!WiFi.softAP(ssid, password)) {
log_e("Soft AP creation failed.");
while(1);
}
} // ******* Setup (Init) function END *******
// in the loop function I basically only have the SoftAP example code running.
Bridging Wifi SoftAP with Ethernet
-
- Posts: 2
- Joined: Wed May 03, 2023 11:46 am
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Google [Bot] and 60 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.