Testing ESP32 Ethernet Unit with PoE (SKU:U138 )



  • I tried to verify that these unit worked using M5Stack demo software at:https://docs.m5stack.com/en/unit/poesp32.
    I tried examples with Core, M5Stack Plus and Atom for both TCP Client, HTTP Client and MQTT Client. None of these worked.
    All of the examples resulted in the M5tack core device hanging with a serial debug message
    "wait device connect
    device connected"
    Taking one example using the ESP32 Ethernet Unit with Core + Base to get access to the ports. I found a potential error in the published code. The published code uses the configuration for line 23:
    "eth.Init(&Serial2, 9600, 32, 26);"
    If the 32 & 36 parameters refer to the Core ports then this is in error. For Port B this should be "eth.Init(&Serial2, 9600, 36, 26);". Alternatively if Port C is used then the replacement code is: Line 23 "eth.Init(&Serial2, 9600, 16, 17);" Do the parameters in "eth.Init(&Serial2, 9600, 36, 26);" refer to the host Core or the embedded ESP32 in the ESP32 Ethernet Unit?

    With the new code this results in progressing execution beyond the "device connect" and it now hangs waiting for an ethernet connecitons - debug message:
    "wait device connect
    device connected
    wait ethernet connect"
    I could not get it to progress beyond this stage.

    My hardware configuration was that I connected the ESP32 Ethernet Unit to an ethernet cable which was connected at the other end to a Tp-link PoE Injector TL-POE 15OS with a 12V DC supply. The input connection to the Tp-link PoE Injector came from a Ethernet Switch connected to my home network. There was a Grove cable connecting the ESP32 Ethernet Unit to the M5Stack Core on Port C.
    Is there any revised and update to date code for these examples?
    Do anyone else get the example code to work?
    I also could not get the UIFlow example to work.0_1671083224592_Screen Shot -test configuration - Dec22V2.jpg



  • Hello @dsrc12

    you are correct, the GPIOs for Serial2 in the M5Stack (M5Core) examples are incorrect. It should be 16/17 as you already figured out yourself. I've created a pull-request which corrects the three M5Stack (M5Core) examples.

    To get past wait ethernet connect multiple conditions need to be met:
    a) the network needs to have a DHCP server
    b) the IP address range needs to be 192.168.x.x
    c) the DHCP server needs to be compatible with ESPoE Unit

    re b) in case your network doesn't use 192.168.x.x you can modify it in this function

    bool Unit_PoESP32::checkETHConnect() {
        sendCMD("AT+CIPETH?");
        _readstr = waitMsg(1000);
    
        if (_readstr.indexOf("192") != -1) {
            return true;
        } else {
            return false;
        }
    }
    

    Thanks
    Felix