Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: itisnt on February 22, 2019, 01:50:05 AM

Title: ESP32-POE wired ethernet not working
Post by: itisnt on February 22, 2019, 01:50:05 AM
Hi Guys,

It seems that i'm too stupid to connect my ESP32-POE to a wired ethernet network. I took the example from the Olimex Githup:

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12

#include <ETH.h>

static bool eth_connected = false;

void WiFiEvent(WiFiEvent_t event)
{
  switch (event) {
    case SYSTEM_EVENT_ETH_START:
      Serial.println("ETH Started");
      //set eth hostname here
      ETH.setHostname("esp32-ethernet");
      break;
    case SYSTEM_EVENT_ETH_CONNECTED:
      Serial.println("ETH Connected");
      break;
    case SYSTEM_EVENT_ETH_GOT_IP:
      Serial.print("ETH MAC: ");
      Serial.print(ETH.macAddress());
      Serial.print(", IPv4: ");
      Serial.print(ETH.localIP());
      if (ETH.fullDuplex()) {
        Serial.print(", FULL_DUPLEX");
      }
      Serial.print(", ");
      Serial.print(ETH.linkSpeed());
      Serial.println("Mbps");
      eth_connected = true;
      break;
    case SYSTEM_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case SYSTEM_EVENT_ETH_STOP:
      Serial.println("ETH Stopped");
      eth_connected = false;
      break;
    default:
      break;
  }
}

void testClient(const char * host, uint16_t port)
{
  Serial.print("\nconnecting to ");
  Serial.println(host);

  WiFiClient client;
  if (!client.connect(host, port)) {
    Serial.println("connection failed");
    return;
  }
  client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host);
  while (client.connected() && !client.available());
  while (client.available()) {
    Serial.write(client.read());
  }

  Serial.println("closing connection\n");
  client.stop();
}

void setup()
{
  Serial.begin(115200);
  WiFi.onEvent(WiFiEvent);
  ETH.begin();
}


void loop()
{
  Serial.print("Looping.. ");
  Serial.print("IPv4: ");
  Serial.println(ETH.localIP());
  if (eth_connected) {
    testClient("google.com", 80);
  }
  delay(10000);
}


Power over USB cable, no POE (does also not working with POE and no USB-cable)
Output:
rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:9280
load:0x40080400,len:5848
entry 0x40080698
Looping.. IPv4: 0.0.0.0
ETH Started
ETH Connected
Looping.. IPv4: 0.0.0.0
Looping.. IPv4: 0.0.0.0


I see the DHCP request from the ESP32 board on my DCHP server (pfsense firewall), the DCHP server answers with a DCHP-OFFER, so everything should be fine. But nothing happens on the board after the "ETH connected". The Board is not pingable, not local IP nothing.

What do i miss ?

Dev-environment: Arduino 1.8.7 on Win10 with Espressif esp32 1.0.1 installed. Board: OLIMEX ESP32-POE

IP-Switch (100MB) and IP-cables are verified and working with other devices (Labtop).

Any help would be appriciated

Daniel
Title: Re: ESP32-POE wired ethernet not working
Post by: LubOlimex on February 22, 2019, 10:18:20 AM
Do the Ethernet LEDs at the connector show some activity (light up, blink, etc)?

The example software is working fine. Tested today with the same Arduino ESP32 package (1.0.1).

The board passes software test of the Ethernet after manufacturing.

I'd assume something in your network is the culprit so focus your effort in that regard. Whether it is switch setting or similar it is hard to tell.
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on February 22, 2019, 02:35:34 PM
yes, Link is steady green and Act flickering from time to time.

Hm, no idea what could be wrong, i use the same cable as where my labtop hangs. And the labtop and another device are getting their DHCP adresses properly over that link. I have free IP range for new devices which works since years and i have defined a dedicated IP for the ESP32, but nothing works.

Is there a way to debug this Arduino ETH lib ? So that i could get more information what is going wrong.

But thanks anyway.
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on February 22, 2019, 02:52:54 PM
That's what i see on my DHCP server (pfsense Firewall)


Feb 22 13:45:41 dhcpd DHCPDISCOVER from 24:0a:c4:9c:d0:1f via igb1
Feb 22 13:45:42 dhcpd DHCPOFFER on 192.168.1.108 to 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:43 dhcpd DHCPDISCOVER from 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:43 dhcpd DHCPOFFER on 192.168.1.108 to 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:45 dhcpd DHCPDISCOVER from 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:45 dhcpd DHCPOFFER on 192.168.1.108 to 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:49 dhcpd DHCPDISCOVER from 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Feb 22 13:45:49 dhcpd DHCPOFFER on 192.168.1.108 to 24:0a:c4:9c:d0:1f (esp32-ethernet) via igb1
Title: Re: ESP32-POE wired ethernet not working
Post by: stif on March 06, 2019, 08:17:29 PM
I do have the same problem. I am also using a pfSense Firewall and it does offer a IP address but the ESP32-PoE is not picking it up..

Mar 2 17:49:32 dhcpd DHCPOFFER on 10.0.1.54 to 3c:71:bf:0c:8f:bf (esp32-ethernet) via igb1.100
Mar 2 17:49:47 dhcpd DHCPDISCOVER from 3c:71:bf:0c:8f:bf (esp32-ethernet) via igb1.100


I noticed that the very first time i uploaded the ethernet example i do got an IP address, but afterwards i was not able to obtain an IP anymore (tried to reupload, reboot, etc).

Searching the internet for a solution i came across this maybe related problem with ARP-caching (the router is answering an ARP request on behalf of the ESP32 and the ESP thinks the IP address is used by another device and discard the IP from the DHCP offer): https://github.com/espressif/esp-idf/issues/2182#issuecomment-425841470

I do not have another Router nor the ESP32-PoE around at the moment, so i am not able to test if this is the case..
Title: Re: ESP32-POE wired ethernet not working
Post by: LubOlimex on March 07, 2019, 10:09:16 AM
So you are both using pfSense? Might be a good idea to ask in their forums, seems like some sort of misconfiguration on the pfSense.
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on March 11, 2019, 02:22:13 AM
I don't think this is realy a pfsense problem- In my company and my private house there are dozens of devices running with DHCP day by day (mobile phones, raspberrys, hifi devices, moxa boxes, and many more), and all are running fine.
I'm quite sure this is more a espressif problem with their IP stack.

@stif: Thanks a lot for digging into that, i didn't had the time.

I'll get a wesp32 end of March and if this works out of the box olimex is history :-) but if not, i'll follow your link.
Title: Re: ESP32-POE wired ethernet not working
Post by: stif on March 12, 2019, 11:24:57 AM
I also do not think it is a pfSense problem - i have installed it in 20+ locations since years and until now every device was able to receive a dhcp address.. and like itisnt and i wrote before: the FreeBSD based pfSense is sending a DHCP offer, but the ESP32-PoE does not pick it up.

@Lub: like i told you by mail, i tried to use static IP as a workaround but this does not work either, i cannot connect to the network with static IP config.


  ETH.begin();
  ETH.config(IPAddress(10, 0, 1, 203),IPAddress(10, 0, 1, 254),IPAddress(255, 255, 255, 0),IPAddress(8, 8, 8, 8),IPAddress(8, 8, 8, 8));


So i am forced to use Wifi at the moment, and i cannot use Ethernet at all with the ESP32-PoE (which was the reason for buying it in the first place despite PoE of course).

As my first ESP32-PoE board is already in production (with Wifi), i have ordered another board for testing. when it arrives i can make a wireshark sniff and do some other tests to help isolate the problem..
Title: Re: ESP32-POE wired ethernet not working
Post by: LubOlimex on March 12, 2019, 12:47:42 PM
QuoteAs my first ESP32-PoE board is already in production (with Wifi), i have ordered another board for testing. when it arrives i can make a wireshark sniff and do some other tests to help isolate the problem..

That would be a good idea. However, you can also try with another software tool like ESP-IDF. Also I have had some problems with the ESP32 package for Arduino, and at some point I had to delete the package manually and install the latest one else some examples didn't work, maybe also try that. Delete existing package, install latest release candidate (1.0.2-rc1 as of today) and test again.
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on March 12, 2019, 08:20:49 PM
So, pfsense is out of scope. I'v setup a Netgear FS105 switch. Plugged in a NanoPC-T4 with Linux and the UDHCPD (binutils based DHCP server) and the ESP32-POE.

As a test i plugged in my Labtop and immediatly got a IP-Adress, so the system was proven to work.

On the ESP32-POE is the ESP-IDF compiled example from you OLIMEX: https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ESP-IDF/ESP32_PoE_Ethernet All debug options where enabled.

ESP-IDF was installed freshly from the offical website yesterday.

Output from the udhcpd DHCP daemon
root@NanoPC-T4:~# udhcpd -f /etc/udhcpd.conf
udhcpd (v1.22.1) started
Sending OFFER of 192.168.0.70
Sending OFFER of 192.168.0.70
Sending OFFER of 192.168.0.70
Sending OFFER of 192.168.0.70
Sending OFFER of 192.168.0.70

So the IP-Adr was offered over and over again

Output from tcpdump on the interface where the DHCP daemon is running:

root@NanoPC-T4:~# tcpdump -i enxa0cec8c18289
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enxa0cec8c18289, link-type EN10MB (Ethernet), capture size 262144 bytes
18:00:29.167778 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:29.180615 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311
18:00:29.515114 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:29.520612 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311
18:00:30.514876 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:30.520607 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311
18:00:32.514633 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:32.519611 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311
18:00:36.514199 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:36.519614 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311
18:00:44.513295 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 24:0a:c4:9c:d0:1f (oui Unknown), length 308
18:00:44.519617 IP 192.168.0.2.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 311


24:0a:c4:9c:d0:1f is the MAC adr of the ESP32-POE board.

And last the output from the ESP32 program with all debug options enabled (VERBOSE):

$ make monitor
MONITOR
--- idf_monitor on COM28 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:748
load:0x40078000,len:6208
load:0x40080000,len:5268
0x40080000: _iram_start at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/components/freertos/xten
sa_vectors.S:1779

entry 0x40080270
0x40080270: _Level5Vector at ??:?

I (119) cpu_start: Pro cpu up.
I (119) cpu_start: Single core mode
I (120) heap_init: Initializing. RAM available for dynamic allocation:
D (123) heap_init: New heap initialised at 0x3ffae6e0
I (128) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (134) heap_init: New heap initialised at 0x3ffbae98
I (139) heap_init: At 3FFBAE98 len 00025168 (148 KiB): DRAM
I (146) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (152) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (158) heap_init: New heap initialised at 0x4008793c
I (163) heap_init: At 4008793C len 000186C4 (97 KiB): IRAM
I (170) cpu_start: Pro cpu start user code
D (182) clk: RTC_SLOW_CLK calibration value: 3162931
V (191) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (191) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (196) intr_alloc: Connected src 46 to int 2 (cpu 0)
V (202) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (208) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xC0E
D (216) intr_alloc: Connected src 57 to int 3 (cpu 0)
V (221) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (227) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (235) intr_alloc: Connected src 24 to int 9 (cpu 0)
I (241) cpu_start: Starting scheduler on PRO CPU.
D (246) heap_init: New heap initialised at 0x3ffe0440
D (250) heap_init: New heap initialised at 0x3ffe4350
V (256) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (256) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (256) intr_alloc: Connected src 16 to int 12 (cpu 0)

ESP32-PoE Ethernet Demo. Press ENTER to start.

-------------------------------------

========== Ethernet Demo ==========
Plug Ethernet cable and press Enter
Start...........................................[ COMPLETE ]
Initialize LAN..................................D (15589) emac: EMAC 50MHz inverted clock output on GPIO17
I (15589) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
V (15597) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (15604) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (15612) intr_alloc: Connected src 38 to int 13 (cpu 0)
I (15617) emac: emac start !!!

I (15621) emac: emac resetting ....
I (15625) emac: emac reset done
D (15629) lan8720: phy_lan8720_init()
D (15633) lan8720: LAN8720 Registers:
D (15636) lan8720: BCR    0x3000
D (15640) lan8720: BSR    0x7809
D (15643) lan8720: PHY1   0x0007
D (15646) lan8720: PHY2   0xc0f1
D (15650) lan8720: ANAR   0x01e1
D (15653) lan8720: ANLPAR 0x0001
D (15656) lan8720: ANER   0x0000
D (15660) lan8720: MCSR   0x0000
D (15663) lan8720: SM     0xffff
D (15666) lan8720: SECR   0x0000
D (15669) lan8720: CSIR   0xffff
D (15673) lan8720: ISR    0xffff
D (15676) lan8720: IMR    0x0040
D (15679) lan8720: PSCSR  0x0002
D (15684) event: SYSTEM_EVENT_ETH_START
I (15685) emac: emac start success !!!
V (15688) event: enter default callback
V (15695) tcpip_adapter: check: local, if=2 fn=0x400e0fd4
0x400e0fd4: tcpip_adapter_start_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/components/t
cpip_adapter/tcpip_adapter_lwip.c:1101


V (15701) tcpip_adapter: call api in lwip: ret=0x0, give sem
V (15706) tcpip_adapter: check: remote, if=2 fn=0x400e0fd4
0x400e0fd4: tcpip_adapter_start_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/components/t
cpip_adapter/tcpip_adapter_lwip.c:1101


V (15712) event: exit default callback
[ COMPLETE ]
Receiving IP address............................D (17685) phy_common: phy_mii_check_link_status(DOWN)
D (19685) phy_common: phy_mii_check_link_status(UP)
D (19685) lan8720: LAN8720 Registers:
D (19685) lan8720: BCR    0x3100
D (19685) lan8720: BSR    0x782d
D (19689) lan8720: PHY1   0x0007
D (19692) lan8720: PHY2   0xc0f1
D (19695) lan8720: ANAR   0x0de1
D (19699) lan8720: ANLPAR 0x4de1
D (19702) lan8720: ANER   0x0003
D (19705) lan8720: MCSR   0x0000
D (19709) lan8720: SM     0xffff
D (19712) lan8720: SECR   0x0001
D (19715) lan8720: CSIR   0xffff
D (19718) lan8720: ISR    0xffff
D (19722) lan8720: IMR    0x0040
D (19725) lan8720: PSCSR  0x0002
D (19728) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19733) lan8720: phy_lan8720_get_speed_mode(100)
D (19738) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (19744) lan8720: phy_lan8720_get_duplex_mode(FULL)
I (19749) emac: eth link_up!!!
D (19753) lan8720: LAN8720 Registers:
D (19756) lan8720: BCR    0x3100
D (19760) lan8720: BSR    0x782d
D (19763) lan8720: PHY1   0x0007
D (19766) lan8720: PHY2   0xc0f1
D (19770) lan8720: ANAR   0x0de1
D (19773) lan8720: ANLPAR 0x4de1
D (19776) lan8720: ANER   0x0001
D (19780) lan8720: MCSR   0x0000
D (19783) lan8720: SM     0xffff
D (19786) lan8720: SECR   0x0001
D (19789) lan8720: CSIR   0xffff
D (19793) lan8720: ISR    0xffff
D (19796) lan8720: IMR    0x0040
D (19799) lan8720: PSCSR  0x0002
D (19803) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19808) lan8720: phy_lan8720_get_speed_mode(100)
D (19813) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (19818) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19823) lan8720: LAN8720 Registers:
D (19827) lan8720: BCR    0x3100
D (19830) lan8720: BSR    0x782d
D (19834) lan8720: PHY1   0x0007
D (19837) lan8720: PHY2   0xc0f1
D (19840) lan8720: ANAR   0x0de1
D (19844) lan8720: ANLPAR 0x4de1
D (19847) lan8720: ANER   0x0001
D (19850) lan8720: MCSR   0x0000
D (19853) lan8720: SM     0xffff
D (19857) lan8720: SECR   0x0001
D (19860) lan8720: CSIR   0xffff
D (19863) lan8720: ISR    0xffff
D (19867) lan8720: IMR    0x0040
D (19870) lan8720: PSCSR  0x0002
D (19873) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19878) lan8720: phy_lan8720_get_speed_mode(100)
D (19883) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (19889) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19894) lan8720: LAN8720 Registers:
D (19898) lan8720: BCR    0x3100
D (19901) lan8720: BSR    0x782d
D (19904) lan8720: PHY1   0x0007
D (19907) lan8720: PHY2   0xc0f1
D (19911) lan8720: ANAR   0x0de1
D (19914) lan8720: ANLPAR 0x4de1
D (19917) lan8720: ANER   0x0001
D (19921) lan8720: MCSR   0x0000
D (19924) lan8720: SM     0xffff
D (19927) lan8720: SECR   0x0001
D (19931) lan8720: CSIR   0xffff
D (19934) lan8720: ISR    0xffff
D (19937) lan8720: IMR    0x0040
D (19940) lan8720: PSCSR  0x0002
D (19944) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19949) lan8720: phy_lan8720_get_speed_mode(100)
D (19954) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (19959) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (19964) lan8720: LAN8720 Registers:
D (19968) lan8720: BCR    0x3100
D (19971) lan8720: BSR    0x782d
D (19975) lan8720: PHY1   0x0007
D (19978) lan8720: PHY2   0xc0f1
D (19981) lan8720: ANAR   0x0de1
D (19985) lan8720: ANLPAR 0x4de1
D (19988) lan8720: ANER   0x0001
D (19991) lan8720: MCSR   0x0000
D (19995) lan8720: SM     0xffff
D (19998) lan8720: SECR   0x0001
D (20001) lan8720: CSIR   0xffff
D (20004) lan8720: ISR    0xffff
D (20008) lan8720: IMR    0x0040
D (20011) lan8720: PSCSR  0x0002
D (20014) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (20019) lan8720: phy_lan8720_get_speed_mode(100)
D (20024) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (20030) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (20035) lan8720: LAN8720 Registers:
D (20039) lan8720: BCR    0x3100
D (20042) lan8720: BSR    0x782d
D (20045) lan8720: PHY1   0x0007
D (20049) lan8720: PHY2   0xc0f1
D (20052) lan8720: ANAR   0x0de1
D (20055) lan8720: ANLPAR 0x4de1
D (20059) lan8720: ANER   0x0001
D (20062) lan8720: MCSR   0x0000
D (20065) lan8720: SM     0xffff
D (20068) lan8720: SECR   0x0001
D (20072) lan8720: CSIR   0xffff
D (20075) lan8720: ISR    0xffff
D (20078) lan8720: IMR    0x0040
D (20082) lan8720: PSCSR  0x0002
D (20085) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (20090) lan8720: phy_lan8720_get_speed_mode(100)
D (20095) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (20101) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (20106) event: SYSTEM_EVENT_ETH_CONNECETED
V (20110) event: enter default callback
V (20114) tcpip_adapter: check: local, if=2 fn=0x400e11a4
0x400e11a4: tcpip_adapter_up_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/components/tcpi
p_adapter/tcpip_adapter_lwip.c:1101


V (20119) tcpip_adapter: call api in lwip: ret=0x0, give sem
V (20125) tcpip_adapter: check: remote, if=2 fn=0x400e11a4
0x400e11a4: tcpip_adapter_up_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/components/tcpi
p_adapter/tcpip_adapter_lwip.c:1101


V (20131) tcpip_adapter: check: local, if=2 fn=0x400e148c
0x400e148c: tcpip_adapter_dhcpc_start_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/compon
ents/tcpip_adapter/tcpip_adapter_lwip.c:1101


D (20137) tcpip_adapter: dhcp client init ip/mask/gw to all-0
D (20142) tcpip_adapter: if2 start ip lost tmr: enter
D (20148) tcpip_adapter: if2 start ip lost tmr: only sta support ip lost timer
D (20156) tcpip_adapter: dhcp client start successfully
V (20160) tcpip_adapter: call api in lwip: ret=0x0, give sem
V (20166) tcpip_adapter: check: remote, if=2 fn=0x400e148c
0x400e148c: tcpip_adapter_dhcpc_start_api at C:/Users/a239368/Privat/Mikrokontroller/ESP32/msys32/home/bue/esp/esp-idf/compon
ents/tcpip_adapter/tcpip_adapter_lwip.c:1101


V (20172) event: exit default callback
D (21685) phy_common: phy_mii_check_link_status(UP)
D (23685) phy_common: phy_mii_check_link_status(UP)
D (25685) phy_common: phy_mii_check_link_status(UP)
D (27685) phy_common: phy_mii_check_link_status(UP)
D (29685) phy_common: phy_mii_check_link_status(UP)
D (31685) phy_common: phy_mii_check_link_status(UP)
D (33685) phy_common: phy_mii_check_link_status(UP)
D (35685) phy_common: phy_mii_check_link_status(UP)
[ ERROR ]
IP address: 0.0.0.0
Press any key to start again!
D (37685) phy_common: phy_mii_check_link_status(UP)
D (39685) phy_common: phy_mii_check_link_status(UP)
D (41685) phy_common: phy_mii_check_link_status(UP)
D (43685) phy_common: phy_mii_check_link_status(UP)
D (45685) phy_common: phy_mii_check_link_status(UP)
D (47685) phy_common: phy_mii_check_link_status(UP)
D (49685) phy_common: phy_mii_check_link_status(UP)
D (51685) phy_common: phy_mii_check_link_status(UP)
D (53685) phy_common: phy_mii_check_link_status(UP)
D (55685) phy_common: phy_mii_check_link_status(UP)
D (57685) phy_common: phy_mii_check_link_status(UP)
D (59685) phy_common: phy_mii_check_link_status(UP)
D (61685) phy_common: phy_mii_check_link_status(UP)
D (63685) phy_common: phy_mii_check_link_status(UP)
D (65685) phy_common: phy_mii_check_link_status(UP)
D (67685) phy_common: phy_mii_check_link_status(UP)
D (69685) phy_common: phy_mii_check_link_status(UP)


Maybe somebody sees something ?

Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on March 13, 2019, 12:34:28 AM
@LubOlimex: Maybe you could provide a link to a binary image which works for you ? Or send me one per mail.

With this i could eliminate any build/toolchain problems on my side.

Regards,
Daniel
Title: Re: ESP32-POE wired ethernet not working
Post by: LubOlimex on March 14, 2019, 09:33:40 AM
Today my colleague also tested a few boards with both Arduino IDE and ESP-IDF and the Ethernet examples work fine for him too. DHCP assigns address properly. I made a short video of one of his attempts: https://youtu.be/r3W9z4AoURk - the wires sticking out of the PoE board are connected to an oscilloscope.

QuoteMaybe you could provide a link to a binary image which works for you ? Or send me one per mail.

I uploaded both Arduino IDE and ESP-IDF binaries here: ftp://staging.olimex.com/Lub-clients/PoE-ethernet-binaries.zip
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on March 14, 2019, 11:50:06 PM
Thanks for the binaries, i've tested both and both are not working

The Arduino image starts but hangs:

rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10312
load:0x40080400,len:6460
entry 0x400806a4
ETH Started
ETH Connected


and the ESP-IDF image constently reboots the board:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10312
load:0x40080400,len:6460
entry 0x400806a4

ESP32-PoE Ethernet Demo. Press ENTER to start.

-------------------------------------
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10312
load:0x40080400,len:6460
entry 0x400806a4

ESP32-PoE Ethernet Demo. Press ENTER to start.

-------------------------------------
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10312
load:0x40080400,len:6460
entry 0x400806a4

ESP32-PoE Ethernet Demo. Press ENTER to start.


Even when i quick press ENTER, it reboots.

I give up for now
Title: Re: ESP32-POE wired ethernet not working
Post by: stif on March 20, 2019, 02:36:38 AM
Same here; i did some testing with two new ESP32-PoE´s, and cannot get it to work  :-\

At first i tried the Arduino and ESP-IDF Examples from olimex github repo with PlatformIO (Core v3.6.5 Espressif32 Platform 1.7.0 and Staging Version)

To sort out possible problems with platformIO, i tried the native ways as well:
* with official Arduino IDE 1.8.8 and esp package 1.0.1 and 1.0.2-rc1
* and i also installed official development framework from espressif (ESP-IDF v3.1.3)

And i also tried the binaries LubOlimex provided, but they did not work for me either. (i used the bootloader files from my native arduino and esp-idf builds, because i dont know how to extract them from the *.elf file and if it is even possible.. - see the link below for all my files)
I documented my tries and the shell messages during upload and serial monitor output from ESP32 here: https://github.com/stif/Olimex.git

So now i have 3 ESP32-PoE and none of them is able to use wired Ethernet (Wifi works on all of them)

Please help me!




Title: Re: ESP32-POE wired ethernet not working
Post by: LubOlimex on March 20, 2019, 08:05:20 AM
So manufacturing/hardware issue is out of question. The problem is we can't replicate this behavior here at all. So we have to shoot in the dark what might be the problem. I still suspect some funny network setting that prevents ESP32 from getting an IP. Maybe try adding switch between the board and the router: https://forum.netgate.com/topic/111088/dhcp-not-handing-out-addresses Probably also worth testing the workaround this user mentioned (adding delay I guess): https://www.olimex.com/forum/index.php?topic=7116.0

I'd also suggest posting in espressif's ESP32 forums and pfSense forums about this IP problem - these should be more active and maybe somebody encountered something similar.
Title: Re: ESP32-POE wired ethernet not working
Post by: stif on March 20, 2019, 12:14:59 PM
Hi LubOlimex,

thanks for your response.

In my opinion a hardware issue is not out of question - but my first guess is a buggy library and/or problems in my toolchain.

I do not have any problems with pfSense nor the ESP32. The network is working fine and i can upload sketches to to ESP32 which also work as expected. the problem is solely with wired ethernet..

but for the sake of testing all i can, i hooked up the ESP32-PoE to a MikroTIK RouterBOARD 2011U (directly and via a netgear gs105e switch) -> no ethernet connection as well..

after ~100 different uploads to the esp board, not even the green ethernet activity LED is blinking on most uploads - only on rare occasions (changed patch cable, changed router, changed ESP32 board)

did you take a look at my tests (https://github.com/stif/Olimex.git)? is my setup ok? can you also provide me the bootloader.bin for the ESP-IDF example and the boot_app0.bin and bootloader_dio_40m.bin file for the Arduino example? is it possible to extract them from the *.elf file?


# ESP-IDF
python /home/stif/.esp-idf/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/stif/workspace/arduino/Olimex/Olimex-Github/ESP-IDF/ESP32_PoE_Ethernet/build/bootloader/bootloader.bin 0x10000 /home/stif/workspace/arduino/Olimex/PoE-ethernet-binaries/ESP-IDF/ESP32-PoE.bin 0x8000 /home/stif/workspace/arduino/Olimex/PoE-ethernet-binaries/ESP-IDF/partitions_singleapp.bin



# Arduino
/home/stif/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xe000 /home/stif/.arduino15/packages/esp32/hardware/esp32/1.0.2-rc1/tools/partitions/boot_app0.bin 0x1000 /home/stif/.arduino15/packages/esp32/hardware/esp32/1.0.2-rc1/tools/sdk/bin/bootloader_dio_40m.bin 0x10000 /home/stif/workspace/arduino/Olimex/PoE-ethernet-binaries/Arduino/ESP32_PoE_Ethernet_Arduino.ino.bin 0x8000 /home/stif/workspace/arduino/Olimex/PoE-ethernet-binaries/Arduino/ESP32_PoE_Ethernet_Arduino.ino.partitions.bin


I also tried the "workaround" from the other thread; despite there is no if(ret == ESP_OK) in recent examples, the closest thing i found is in ethernet/olimex_ethernet.c where i inserted the printf commands:

if(ret != ESP_OK) {
  return ret;
}
else {
  /* Enable ethernet */
  printf("Ethernet initialized.");
  printf("Starting eth_task.");
  return esp_eth_enable();
}


As expected, no difference with these changes as well..

Thanks in advance for any help

Title: Re: ESP32-POE wired ethernet not working
Post by: stif on March 20, 2019, 12:23:55 PM
And DHCP does not have to work necessarily, i also would be happy with a working static ip config..
Title: Re: ESP32-POE wired ethernet not working
Post by: itisnt on April 25, 2019, 11:49:16 PM
Just as an update, i got a new ESP32-POE-ISO today and ..... it works like a charm.
So the original ESP32-POE has definitly some kind of a HW-issue.

The new one works out of the box with allmost all of my test programs for the ESP32-POE with DHCP.

ETH Connected
ETH MAC: 24:0A:C4:20:xx:xx, IPv4: 192.168.1.110, FULL_DUPLEX, 100Mbps

connecting to google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Thu, 25 Apr 2019 20:38:43 GMT
Expires: Sat, 25 May 2019 20:38:43 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
closing connection

Title: Re: ESP32-POE wired ethernet not working
Post by: miro on April 29, 2021, 01:11:03 PM
Just seeing this, I am having similar issue. I have ESP32-POE-ISO module. It was working fine for past week or two since I had it and was configuring it. But in last days, I had it just sitting and today, coming back to continue with development, it is just not able to get an IP.

I have done Wireshark capture and I can see it sends DHCP discover, the DHCP server (I tried 2 different ones) sends DHCP offer and that's it. Next message is again DHCP discover.

I have debugged this on Fortigate router I have where I can see the same, discover coming and offer leaving. From the module itself, the LAN is active and link is up. It just does not get any IP at all.

Code wise, it was working fine even with temporary link down or no DHCP as I programmed it to check these things and wait and check again. So this is pretty much what is happening now, just waiting for IP that never comes.

I tried flashing it with fresh esp32-idf3-20210202-v1.14.bin, but did not help.

Nothing was done with the module apart from it just sitting and being on. I have no idea what is wrong. Can anyone share any ideas? 
Title: Re: ESP32-POE wired ethernet not working
Post by: miro on May 16, 2021, 07:55:42 AM
In addition to the above, I have also purchased a product from another manufacturer with the LAN8720 module and similar problem happened. After reaching out to the 3rd party, it was confirmed that these LAN8720 modules seem to be dying for multiple customers without any reason. This is more likely the cause we are seeing here.