Open Gery485 opened 4 months ago
Hello, you need to enable the BRIDGE_DATA_FORWARDING_NETIF_ETHERNET configuration item in menuconfig to enable Ethernet netif.
Hi @tswen, I did it, but it doesn´t work yet, is there anything else (special) I should do?
Can you provide some logs?
Yes, that´s everything I get after monitoring the built/flashed project:
load:0x40080404,len:3876
entry 0x4008064c
I (33) boot: ESP-IDF v5.1.4-435-ga06c6877fa-dirty 2nd stage bootloader
I (33) boot: compile time Jul 10 2024 15:10:42
I (35) boot: Multicore bootloader
I (39) boot: chip revision: v1.1
I (43) boot.esp32: SPI Speed : 40MHz
I (47) boot.esp32: SPI Mode : DIO
I (52) boot.esp32: SPI Flash Size : 4MB
I (56) boot: Enabling RNG early entropy source...
I (62) boot: Partition Table:
I (65) boot: ## Label Usage Type ST Offset Length
I (73) boot: 0 nvs WiFi data 01 02 0000d000 00008000
I (80) boot: 1 phy_init RF data 01 01 00015000 0000b000
I (87) boot: 2 ota_0 OTA app 00 10 00020000 001d0000
I (95) boot: 3 ota_1 OTA app 00 11 001f0000 001d0000
I (102) boot: End of partition table
I (107) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=3cf8ch (249740) map
I (205) esp_image: segment 1: paddr=0005cfb4 vaddr=3ffbdb60 size=03064h ( 12388) load
I (211) esp_image: segment 2: paddr=00060020 vaddr=400d0020 size=d3e54h (867924) map
I (524) esp_image: segment 3: paddr=00133e7c vaddr=3ffc0bc4 size=02cb4h ( 11444) load
I (529) esp_image: segment 4: paddr=00136b38 vaddr=40080000 size=1dce4h (122084) load
I (596) boot: Loaded app from partition at offset 0x20000
I (596) boot: Disabling RNG early entropy source...
I (608) cpu_start: Multicore app
I (608) cpu_start: Pro cpu up.
I (608) cpu_start: Starting app cpu, entry point is 0x400814f0
0x400814f0: call_start_cpu1 at C:/esp32/5.1/esp-idf/components/esp_system/port/cpu_start.c:159
I (0) cpu_start: App cpu up.
I (626) cpu_start: Pro cpu start user code
I (626) cpu_start: cpu freq: 240000000 Hz
I (626) cpu_start: Application information:
I (631) cpu_start: Project name: wifi_router
I (636) cpu_start: App version: v1.0.0-318-g7314e05-dirty
I (643) cpu_start: Compile time: Jul 10 2024 15:10:03
I (649) cpu_start: ELF file SHA256: 5e37564b496cecde...
I (655) cpu_start: ESP-IDF: v5.1.4-435-ga06c6877fa-dirty
I (661) cpu_start: Min chip rev: v0.0
I (666) cpu_start: Max chip rev: v3.99
I (671) cpu_start: Chip rev: v1.1
I (676) heap_init: Initializing. RAM available for dynamic allocation:
I (683) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (689) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (695) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (701) heap_init: At 3FFCA3F0 len 00015C10 (87 KiB): DRAM
I (707) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (714) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (720) heap_init: At 4009DCE4 len 0000231C (8 KiB): IRAM
I (728) spi_flash: detected chip: generic
I (731) spi_flash: flash io: dio
I (735) esp_core_dump_flash: Init core dump to flash
E (741) esp_core_dump_flash: No core dump partition found!
E (747) esp_core_dump_flash: No core dump partition found!
I (753) coexist: coex firmware version: d96c1e51f
I (759) app_start: Starting scheduler on CPU0
(763) app_start: Starting scheduler on CPU1
mI (763) main_task: Started on CPU0
I (772) main_task: Calling app_main()
I (808) bridge_common: esp-iot-bridge version: 0.11.8
I (810) wifi:wifi driver task: 3ffcfce8, prio:23, stack:6656, core=0
I (824) wifi:wifi firmware version: 0d8e81df4
I (824) wifi:wifi certification version: v7.0
I (824) wifi:config NVS flash: enabled
I (824) wifi:config nano formating: disabled
I (829) wifi:Init data frame dynamic rx buffer num: 32
I (834) wifi:Init static rx mgmt buffer num: 5
I (837) wifi:Init management short buffer num: 32
I (842) wifi:Init dynamic tx buffer num: 32
I (846) wifi:Init static rx buffer size: 1600
I (850) wifi:Init static rx buffer num: 10
I (854) wifi:Init dynamic rx buffer num: 32
I (859) wifi_init: rx ba win: 6
I (861) wifi_init: tcpip mbox: 32
I (865) wifi_init: udp mbox: 6
I (869) wifi_init: tcp mbox: 6
I (873) wifi_init: tcp tx win: 5760
I (877) wifi_init: tcp rx win: 5760
I (881) wifi_init: tcp mss: 1460
I (885) wifi_init: WiFi IRAM OP enabled
I (890) wifi_init: WiFi RX IRAM OP enabled
I (895) phy_init: phy_version 4791,2c4672b,Dec 20 2023,16:06:06
I (970) wifi:mode : null
I (973) wifi:mode : softAP (24:dc:c3:c8:13:91)
I (975) wifi:Total power save buffer number: 16
I (975) wifi:Init max length of beacon: 752/752
I (977) wifi:Init max length of beacon: 752/752
Add netif ap with 7314e05(commit id)
I (984) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
I (994) bridge_common: netif list add success
I (1000) bridge_common: [WIFI_AP_DEF ]
I (1004) bridge_common: Set ip info:192.168.5.1
I (1008) bridge_wifi: SoftAP IP network segment has changed, deauth all station
I (1019) wifi:Disabled PMF config for SoftAP
I (1021) wifi:Total power save buffer number: 16
I (1025) bridge_common: DHCPS Restart, deauth all station
I (1026) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.5.1
I (1040) bridge_common: [WIFI_AP_DEF ]Name Server1: 114.114.114.114
I (1047) bridge_common: IP Address:192.168.4.1
I (1051) bridge_common: GW Address:192.168.4.1
I (1056) bridge_common: NM Address:255.255.255.0
I (1062) mac select: MAC 24:dc:c3:c8:13:90
I (1092) esp_eth.netif.netif_glue: 24:dc:c3:c8:13:93
I (5093) bridge_eth: Ethernet Started
I (5094) bridge_eth: [ETH_LAN ]
Add netif eth with 7314e05(commit id)
I (5095) bridge_common: netif list add success
I (5099) bridge_eth: ETH IP Address:192.168.4.1
W (5105) event: handler already registered, overwriting
/$JMLL�J�Y.\U���r�ѥ��r�ѥ�}��Օ�☻���"��→��→�Ҋ��ʚڴ♣j5Rڴ♣ښ�j§�B����J☻*��}�ѡ�☻*��}�ѡ}�х�ѡ�²J�☻"ɥٕɁ�х�ѕ��
�ɕ���m��j5Rڴ♣ښ�j%�B����J☻↕ɥ���}�ѡ�☻�UE��u§�
Multiple decode errors occured: Try checking the baud rate and XTAL frequency setting in menuconfig
↕↕$$HW�+L[C�P�� netif eth with 7314e05(commit id)
I (5130) bridge_common: netif list add success
Add netif sta with 7314e05(commit id)
I (5139) bridge_common: netif list add success
I (5145) wifi:mode : sta (24:dc:c3:c8:13:90) + softAP (24:dc:c3:c8:13:91)
I (5151) wifi:enable tsf
I (5154) bridge_wifi: Found ssid FRITZ!Box 6490 Cable1
I (5158) bridge_wifi: Found password 10818279235882565030
E (5165) NVS: Failed to read IP info from NVS
I (5170) wifi:Disabled PMF config for STA
I (5174) bridge_wifi: [esp_bridge_wifi_set_config] softap ssid: ESP_Bridge_c81391 password: 12345678
I (5352) wifi:Total power save buffer number: 16
I (5354) bridge_wifi: SoftAP config changed, deauth all station
I (5355) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.5.1
start web server
I (5370) wifi_prov_scheme_ble: BT memory released
I (5371) esp_bridge_wifi_prov_mgr: Starting provisioning
I (5375) esp_bridge_wifi_prov_mgr: Development mode: using hard coded salt
I (5382) esp_bridge_wifi_prov_mgr: Development mode: using hard coded verifier
I (5391) wifi:mode : sta (24:dc:c3:c8:13:90)
I (5397) BTDM_INIT: BT controller compile version [1a95809]
I (5401) BTDM_INIT: Bluetooth MAC: 24:dc:c3:c8:13:92
I (5570) protocomm_nimble: BLE Host Task Started
I (5578) wifi_prov_mgr: Provisioning started with service name : PROV_C81390
I (5580) esp_bridge_wifi_prov_mgr: Provisioning started
I (5585) esp_bridge_wifi_prov_mgr: Scan this QR code from the provisioning application for Provisioning.
I (5593) QRCODE: Encoding below text with ECC LVL 0 & QR Code Version 10
I (5600) QRCODE: {"ver":"v1","name":"PROV_C81390","username":"wifiprov","pop":"abcd1234","transport":"ble"}
I (5611) NimBLE: GAP procedure initiated: advertise;
I (5616) NimBLE: disc_mode=2
I (5620) NimBLE: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256
I (5630) NimBLE:
█▀▀▀▀▀█ ███ ▀▄▀▀▀▄▄▄█▄▀▀▄▄▀▀ █▀▀▀▀▀█
█ ███ █ █▄▀█ ▄▄▄█▀▀▀▄▀▀█▄▄ ▄█ █ ███ █
█ ▀▀▀ █ ▄ ▄▄█▀▀▀ ▄▀█▄▀ ▀█▀ █ ▀▀▀ █
▀▀▀▀▀▀▀ ▀▄▀ █ █ █▄▀ ▀▄▀▄▀ ▀▄█ ▀▀▀▀▀▀▀
▀█ ▀▀▀ ▄▀▄▄█▄ ▀█▀▄▀██▀▄ ▄▀▄ █▄▀▀▀▀
▄██ ▄▄▀▄██▀█▀▀ ▀█▄ ▄▄▄▀▄ ██▄██ ▀█▄█▄
███ ▀▄▀▀▀▄▄ ▀ █▀██▀▀▀ ▄▀▄ █▀ ▀█▄▀█▄▀
▄▀█▀█ ▀ ▀ ▄ █▀██▀▄▀▄██▀▀▄▀▄█▄█ █▄
▄█▄ ▀▀▀ █▄▀▄▀█▄ ▀█▀▀█ █▀▄▄▄▀██▀▄ ▀▀▀
▄▀███ ▀▄▀▄▄█▀█▀█▀▄ ▄ █▄▀█ ██▄█ █▄▀▄▄▄
█▄██▄▀▀▄▀▄▀ ▀█▄▄█▀ ▀▀▀ ▄ ▄ ▄▀██▀▄█▀█▀
▀█ █▄▀▀██ ▄ ▄ ▄▀██▀ ▀▄█▀ ▀ ███▄▀ █▄▄▄
▄▄▀█▄▄▀█▄▄▀▀▄▀▀▄█▀ ▀▀▀█▄█ ▄█▀▀█▀▄▀▀ ▀
▀ ▀▀▀▄█▀ █▀█▀▀ ▄ ▄ ██▀ ▀▀▀▄ █▄█▄█▀▄
▀▀▀ ▀▀▀█▀█ ▀█▄█▄▀▄▀██▀█▄▄▄ █▀▀▀█ ▀▄
█▀▀▀▀▀█ ▄▀█ ▄ ▄███▄▄ ▄ ▀ ▄▀█ ▀ ██▄▄▄
█ ███ █ ▀▄█▀▄▀▀▄██▄ ▄▀█▄█ ▄▄████▀▄█▄▄
█ ▀▀▀ █ ▄▀▀█▀█▀▀▄▄▀▄ ████ █ ▄ ▀▄██▄
▀▀▀▀▀▀▀ ▀▀▀ ▀▀ ▀▀ ▀▀▀ ▀ ▀ ▀▀ ▀▀▀
I (5871) esp_bridge_wifi_prov_mgr: If QR code is not visible, copy paste the below URL in a browser.
https://espressif.github.io/esp-jumpstart/qrcode.html?data={"ver":"v1","name":"PROV_C81390","username":"wifiprov","pop":"abcd1234","transport":"ble"}
I (5894) main_task: Returned from app_main()
I (7095) bridge_eth: Ethernet Link Up
I (7095) bridge_eth: Ethernet HW Addr 24:dc:c3:c8:13:93
I (7096) bridge_eth: Ethernet Link Up
I (7099) bridge_eth: Ethernet HW Addr 24:dc:c3:c8:13:93
I (67732) protocomm_nimble: mtu update event; conn_handle=0 cid=4 mtu=256
I (68682) security2: Using salt and verifier to generate public key...
I (115714) esp_bridge_wifi_prov_mgr: Received Wi-Fi credentials
SSID : iPhone
Password : asdfghjkl
E (116713) wifi:sta is connecting, return error
E (116714) wifi_prov_mgr: Failed to connect Wi-Fi
I (120541) wifi:new:<6,0>, old:<1,1>, ap:<255,255>, sta:<6,0>, prof:1
I (120712) wifi:state: init -> auth (b0)
I (120720) wifi:state: auth -> assoc (0)
I (120729) wifi:state: assoc -> run (10)
I (121438) wifi:connected with iPhone, aid = 1, channel 6, BW20, bssid = ca:79:3c:44:b6:92
I (121439) wifi:security: WPA2-PSK, phy: bgn, rssi: -53
I (121442) wifi:pm start, type: 1
I (121444) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (121478) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (121511) wifi:<ba-add>idx:0 (ifx:0, ca:79:3c:44:b6:92), tid:0, ssn:2, winSize:64
I (121583) bridge_common: [WIFI_AP_DEF ]Name Server1: 172.20.10.1
I (121584) bridge_common: [ETH_LAN ]Name Server1: 172.20.10.1
I (122457) esp_netif_handlers: sta ip: 172.20.10.4, mask: 255.255.255.240, gw: 172.20.10.1
I (122458) bridge_wifi: Connected with IP Address:172.20.10.4
I (122462) esp_bridge_wifi_prov_mgr: Connected with IP Address:172.20.10.4
I (122470) wifi_prov_mgr: STA Got IP
I (122474) esp_bridge_wifi_prov_mgr: Provisioning successful
I (124236) NimBLE: GAP procedure initiated: stop advertising.
I (124242) NimBLE: GAP procedure initiated: stop advertising.
I (124245) NimBLE: GAP procedure initiated: terminate connection; conn_handle=0 hci_reason=19
E (124307) protocomm_nimble: Error setting advertisement data; rc = 30
I (124313) wifi_prov_mgr: Provisioning stopped
I (124314) wifi_prov_scheme_ble: BTDM memory released
and here is the changed main.c file (only change is deleting the parts about the button):
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "nvs.h"
#include "nvs_flash.h"
#include "esp_log.h"
#include "esp_wifi.h"
#include "esp_netif.h"
#include "esp_timer.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_bridge.h"
#if defined(CONFIG_APP_BRIDGE_USE_WEB_SERVER)
#include "web_server.h"
#endif
#if defined(CONFIG_APP_BRIDGE_USE_WIFI_PROVISIONING_OVER_BLE)
#include "wifi_prov_mgr.h"
#endif
static const char *TAG = "main";
static esp_err_t esp_storage_init(void)
{
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
return ret;
}
void app_main(void)
{
esp_log_level_set("*", ESP_LOG_INFO);
esp_storage_init();
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_bridge_create_all_netif();
#if defined(CONFIG_BRIDGE_DATA_FORWARDING_NETIF_SOFTAP)
wifi_config_t wifi_cfg = {
.ap = {
.ssid = CONFIG_BRIDGE_SOFTAP_SSID,
.password = CONFIG_BRIDGE_SOFTAP_PASSWORD,
}
};
esp_bridge_wifi_set_config(WIFI_IF_AP, &wifi_cfg);
#endif
#if defined(CONFIG_BRIDGE_EXTERNAL_NETIF_STATION)
esp_wifi_connect();
#endif
#if defined(CONFIG_APP_BRIDGE_USE_WEB_SERVER)
StartWebServer();
#endif
#if defined(CONFIG_APP_BRIDGE_USE_WIFI_PROVISIONING_OVER_BLE)
esp_bridge_wifi_prov_mgr();
#endif
}
Should I also provide some special logs?
Which ETH PHY are you using? Have you tested it with the ethernet/basic example below from idf?
Jape, I tried it and it seem to be working. I use the WT32-ETH01 board, so the ethernet modul is a build in one. The already mentioned PHY pinouts should be alright.
hey, i am facing the same issue let me know if you get a solution.
Hi @tswen, is there any solution already? Should I may use another microcontroller for that specific task?
https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32/esp32-ethernet-kit/index.html I can successfully assign IP regardless of whether I use ESP32+IP101 or SPI Ethernet modules such as W5500, DM9051, etc. At first, I suspected that it was a hardware problem, but you mentioned that you can run the Ethernet example under idf, so I am more confused. Do you have other ESP32 boards with Ethernet?
Wifi_router
Problem description
Aftern I tried to configure the example in different ways (different esp-idf verions: 5.2.2, 5.1.4, 5.3.0; changing RMII clock mode, etc.). I was always able to connect the device with the router, using BLE provisioning app of the SSID and PWD. But it came nothing else. I wanted to use the Ethernet-Interface mainly, but I didn´t get any access from the "bridge". Not even the SoftAP provisioning worked, that I wanted to use to check, if the provisioning interface between the end-device and ESP-modul comes.
General description
Modul - WT32-ETH01 Target - ESP32 - WROVER KIT 3.3V
PHY
SMI MDC GPIO - (23) SMI MDIO GPIO - (18) PHY Reset GPIO - (-1) PHY Address - (1)
Changes
Use-Case
I want to build a bridge that can the following: router --WiFi--> ESP-modul --Ethernet--> End-device It´s because I have a device that only has ethernet, but want to use it without extra ethernet cable.