-
Notifications
You must be signed in to change notification settings - Fork 760
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
How to assign static Ip for esp32 in Bridge mode #32
Comments
Can anybody help regarding this post??? |
|
Thank you very much for response. |
ESP-IDF can't support this feature in ethernet and wifi bridge condition. If you have further questions about this please reopen the issue in the GitHub and let's continue there. |
Hello IndiniteYuan1, |
@burkulesomesh43 We currently have a more general solution for the bridge project, please refer https://github.com/espressif/esp-iot-bridge |
I am using ESP32-EVB Rev.D olimex board and running Ethernet to wifi transparent bridge. (https://github.com/espressif/esp-iot-solution/tree/master/examples/eth2wifi)
I want to run a web server in same code to change bridge modes (soft ap and station), instead of changing it from menuconfig.
In bridge code obviously my routers DHCP does not assigns ip to esp32, it is just for connection between Ethernet and wifi .
I get mac of soft AP and station but how to assign ip address to them for webserver?
I assigned static ip to eth0 in same code and changed ethernet init function, but bridge is was not working now.
is it possible to assign static ip to esp32 when it is in bridge mode?
My Ethernet initialization function is given below
#define DEVICE_IP "192.168.10.254"
#define DEVICE_GW "192.168.10.1"
#define DEVICE_NETMASK "255.255.0.0"
static void initialise_ethernet(void)
{
esp_err_t ret = ESP_OK;
tcpip_adapter_ip_info_t ipInfo;
inet_pton(AF_INET, DEVICE_IP, &ipInfo.ip);
inet_pton(AF_INET, DEVICE_GW, &ipInfo.gw);
inet_pton(AF_INET, DEVICE_NETMASK, &ipInfo.netmask);
tcpip_adapter_init();
ret = tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_ETH);
ESP_LOGI(TAG, "dhcp client stop RESULT: %d", ret);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_ETH, &ipInfo);
eth_config_t config = DEFAULT_ETHERNET_PHY_CONFIG;
// Set the PHY address in the example configuration
config.phy_addr = CONFIG_PHY_ADDRESS;
config.gpio_config = eth_gpio_config_rmii;
// config.tcpip_input = tcpip_adapter_eth_input_sta_output;
config.tcpip_input = tcpip_adapter_eth_input;
#ifdef CONFIG_PHY_USE_POWER_PIN
//Replace the default 'power enable' function with an example-specific
// one that toggles a power GPIO.
config.phy_power_enable = phy_device_power_enable_via_gpio;
#endif
//esp_eth_init_internal(&config)
esp_eth_init(&config);
esp_eth_enable();
}
The text was updated successfully, but these errors were encountered: