WT32-ETH01

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

WT32-ETH01

#1 Post by iron » 19 Nov 2020, 19:04

Anyone has any experience with this ESP32 / LAN8720 module ?

Product Page :
http://www.wireless-tag.com/portfolio/wt32-eth01/

Datasheet:
https://tinyurl.com/WT32-ETH01

AliExpress:
https://www.aliexpress.com/item/1005001739834076.html

-D
-D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#2 Post by TD-er » 19 Nov 2020, 19:38

Have you tried the "eth" builds?

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#3 Post by iron » 19 Nov 2020, 19:44

TD-er wrote: 19 Nov 2020, 19:38 Have you tried the "eth" builds?
Yeah, i have a few Olimex ESP32-POE working stable on the eth builds.

I wish there was support for more Enviroment and switch (MCP23017) devices.
(Not sure how a GPS module is useful to a wired module)

-D
-D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#4 Post by TD-er » 19 Nov 2020, 21:31

GPS can be useful to get a very accurate time, without any drift.
It is like an atomic clock.

And about the MCP23017 you mentioned...
I ordered it 8 days ago, so I guess it will be here soon.

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#5 Post by iron » 20 Nov 2020, 08:00

NTP, DST and Location settings work great for me in terms of time.

MCP23017 has been stable in ESP8266 for a long time now.

-D
-D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#6 Post by TD-er » 20 Nov 2020, 08:33

MCP23017 is part of P009.
The GPIO related stuff has now moved to be an internal command, so I guess it should now work on ESP32 too in the more recent builds.
Isn't it working?

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#7 Post by iron » 20 Nov 2020, 08:48

MCP23017 is not available on the eth .bin of the ESP32

-D
-D

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#8 Post by iron » 28 Nov 2020, 21:45

Checking on Tasmota's work in an effort to save me any headache if possible on the WT32-ETH01 (should be coming in soon)

Code: Select all

 * {"NAME":"Olimex ESP32-PoE","GPIO":[1,1,1,1,1,1,0,0,5536,1,1,1,1,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
 * GPIO12 = ETH POWER
 * GPIO18 = ETH MDIO
 * GPIO23 = ETH MDC
 * #define ETH_TYPE          ETH_PHY_LAN8720
 * #define ETH_CLKMODE       ETH_CLOCK_GPIO17_OUT
 * #define ETH_ADDR          0
 *
 * {"NAME":"wESP32","GPIO":[0,0,1,0,1,1,0,0,1,1,1,1,5568,5600,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
 * GPIO16 = ETH MDC
 * GPIO17 = ETH MDIO
 * #define ETH_TYPE          ETH_PHY_LAN8720
 * #define ETH_CLKMODE       ETH_CLOCK_GPIO0_IN
 * #define ETH_ADDR          0
 *
 * {"NAME":"WT32-ETH01","GPIO":[1,1,1,1,1,1,0,0,1,0,1,1,3840,576,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":1}
 * GPIO16 = Force Hi
 * GPIO18 = ETH MDIO
 * GPIO23 = ETH MDC
 * #define ETH_TYPE          ETH_PHY_LAN8720
 * #define ETH_CLKMODE       ETH_CLOCK_GPIO0_IN
 * #define ETH_ADDR          1
 *
\*********************************************************************************************/
Seems GPIO18 and 23 are common. In the Olimex board I use GPIO12 as "Ethernet Power pin:"
I wonder if it is as simple as choosing GPIO16 as on arendst's code above ?
-D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#9 Post by TD-er » 28 Nov 2020, 23:41

Have you tried the ETH builds?
I do have all Olimex ETH boards running here for months and all configurations they use are working very well in ESPEasy.

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#10 Post by iron » 29 Nov 2020, 09:12

TD-er wrote: 28 Nov 2020, 23:41 Have you tried the ETH builds?
I do have all Olimex ETH boards running here for months and all configurations they use are working very well in ESPEasy.
Seems like you missed the last part of my post below the code.

The eth bins work great on the Olimex ESP32-PoE units I have on hand.

I am now expecting to receive the WT32-ETH01 units and was wondering on the GPIO settings for that, therefore I looked into arendst's code.
-D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#11 Post by TD-er » 29 Nov 2020, 11:15

Judging the code you posted from Tasmota, it indeed looks like the GPIO16 pin may be connected as power enable pin.
But I wonder why it is marked for the Olimex as "ETH POWER" and on the WT32-ETH01 as "Force Hi".
That sounds like it may be a bit different.

Here it is suggested it is indeed the power pin: https://community.home-assistant.io/t/e ... /110390/65

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#12 Post by Rub87 » 30 Nov 2020, 19:57

Hi,

Im pretty fresh to these iot stuff but I admire it. I have a domoticz setup running but would now like to expand it in areas without wifi or zwave coverage, like a gate and in basement and in my garden to control rgbw led fllood lights. The PoE makes it also very versatile for my needs.

Is there a chance the espeasy would also run onto the wesp32? I read the blog of the creator and it seems for the novice eye perfect for my needs and I would like to support him also using his boards. But ffcourse I am not into programming so as a almost end user I would need to have some feeling how good the ESPEasy firmware would suit this hardware.

https://hackaday.io/project/85389-wesp3 ... et-and-poe
https://wesp32.com/

If not I will need to use the Olimex ISO esp32 board.

thanks in advance

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#13 Post by TD-er » 30 Nov 2020, 22:43

Taken from the product brief: https://wesp32.com/files/wESP32-Product-Brief.pdf (page 8)
• Ethernet PHY type is Microchip LAN8720
• PHY address is 0
• EMAC clock mode is GPIO0 input
• Use PHY power pin is disabled
• SMI MDC pin is 16, SMI MDIO pin is 17
So based on that I would expect it will work just fine with ESPEasy.

User avatar
enesbcs
Normal user
Posts: 572
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: WT32-ETH01

#14 Post by enesbcs » 14 Jan 2021, 21:14

iron wrote: 28 Nov 2020, 21:45 Checking on Tasmota's work in an effort to save me any headache if possible on the WT32-ETH01 (should be coming in soon)

Code: Select all

 * {"NAME":"WT32-ETH01","GPIO":[1,1,1,1,1,1,0,0,1,0,1,1,3840,576,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":1}
 * GPIO16 = Force Hi
 * GPIO18 = ETH MDIO
 * GPIO23 = ETH MDC
 * #define ETH_TYPE          ETH_PHY_LAN8720
 * #define ETH_CLKMODE       ETH_CLOCK_GPIO0_IN
 * #define ETH_ADDR          1
 *
\*********************************************************************************************/
Seems GPIO18 and 23 are common. In the Olimex board I use GPIO12 as "Ethernet Power pin:"
I wonder if it is as simple as choosing GPIO16 as on arendst's code above ?
Yes, i have tested with ESP_Easy_mega_20201102_custom_ESP32_4M316k_ETH-factory.bin binary and WT32-ETH01 works fine.

Code: Select all

Preferred network: Ethernet
Ethernet PHY type: LAN8710
Ethernet PHY Address: 1
GPIO MDC: GPIO-23
GPIO MIO: GPIO-18
GPIO POWER: GPIO-16
Ethernet Clock: External crystal oscillator

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#15 Post by Rub87 » 20 Jan 2021, 23:15

I tried the above named firmware but then of the newest release on github. It does work on the Wesp32 but the wired LAN communication is not working. I set the GPIO 16 and 17 as described in the wesp32 manual.

With the original firmware on that came shipped on the wesp32 the wire ethernet worked fine. I hope I didnt kill it by now. Although I do not see how I could have configured the GPIO correct in the .bin before flashing it. When it was flashed offcourse it had the wrong GPIO pins for MIO and MDC

This is what it says now in the console. im unsure how to fix it at this time..

Code: Select all

INIT : Booting version:  (ESP32 SDK v3.2.3-14-gd3e562907)
31 : Info   : INIT : Free RAM:293692
32 : Info   : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1:                 for APP CPU, reseted by PRO CPU
33 : Info   : FS   : Mounting...
69 : Info   : CRC  : SecuritySettings CRC   ...OK
73 : Info   : INIT : ETH_WIFI_MODE:Ethernet
144 : Info   : INIT : Free RAM:287624
145 : Info   : INIT : I2C
146 : Info   : INIT : SPI not enabled
169 : Info   : INFO : Plugins: 21  (ESP32 SDK v3.2.3-14-gd3e562907)
170 : Info   : Connect to:
170 : Info   : Ethernet
171 : Info   : Eth Wifi mode: Ethernet ETH: PHY Typee: LAN8710 PHY Addr: 0 Eth C                lock mode: 50MHz APLL Ouput on GPIO0 MDC Pin: 16 MIO Pin: 17 Power Pin: -1
177 : Info   : ETH Started
177 : Info   : After ETH.begin
190 : Info   : Webserver: start
1524 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 226876 EthSpeedState N                o Ethernet ESPeasy internal wifi status: DISCONNECTED
30316 : Info   : ETH Connected
30317 : Info   : firstLoopConnectionsEstablished
31524 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 226512 EthSpeedState Link Down ESPeasy internal wifi status: DISCONNECTED
34176 : Error  : ETH Disconnected
38212 : Info   : ETH Connected
40176 : Error  : ETH Disconnected

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#16 Post by TD-er » 20 Jan 2021, 23:51

How did you build it?
I did a test yesterday with the current master branch of ESP32 Arduino and even though the build looks to work, I could not get ethernet to work (LAN8710A chip)
Reverting to the revision referred to by PlatformIO's espressif32@2.1.0 and with the same code and settings all worked again.

So if you used the latest ESP32 Arduino code, please have a test with PlatformIO's espressif32@2.1.0

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#17 Post by Rub87 » 21 Jan 2021, 01:15

I didnt build it. I downloaded the latest ESP release from github (ESPEasy_ESP32_mega-20210114.zip) and flashed the ESP_Easy_mega_20210114_custom_ESP32_4M316k_ETH-factory.bin using the ESP.Easy.Flasher.exe flashing tool. This didnt directly work so then I flashed it again using the flash_download_tool_3.8.5.exe. then the wesp showed up in AP mode, I configured the GPIO pins 0 16 and 17 as per Wesp32 manual but the result can be seen above. Ethernet not working.

Ok Ill try to give thefirmware you mentioned tomorrow. can I find the .bin somewhere or does it need to be build with the PlatformIO software?

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#18 Post by iron » 21 Jan 2021, 09:33

Rub87 wrote: 21 Jan 2021, 01:15 I didnt build it. I downloaded the latest ESP release from github (ESPEasy_ESP32_mega-20210114.zip) and flashed the ESP_Easy_mega_20210114_custom_ESP32_4M316k_ETH-factory.bin using the ESP.Easy.Flasher.exe flashing tool. This didnt directly work so then I flashed it again using the flash_download_tool_3.8.5.exe. then the wesp showed up in AP mode, I configured the GPIO pins 0 16 and 17 as per Wesp32 manual but the result can be seen above. Ethernet not working.

Ok Ill try to give thefirmware you mentioned tomorrow. can I find the .bin somewhere or does it need to be build with the PlatformIO software?
Have your tried what enecbs posted above ?

Code: Select all

Preferred network: Ethernet
Ethernet PHY type: LAN8710
Ethernet PHY Address: 1
GPIO MDC: GPIO-23
GPIO MIO: GPIO-18
GPIO POWER: GPIO-16
Ethernet Clock: External crystal oscillator
-D

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#19 Post by Rub87 » 21 Jan 2021, 09:45

No. As I assumed he has the Olimex board and I have the Wesp32.. here is what the wesp manual says:

Code: Select all

 
 Ethernet PHY type is Microchip LAN8720
• PHY interface is RMII
• PHY address is 0
• Clock mode is GPIO0 external input
• PHY power/reset pin is disabled (set to -1)
• SMI MDC pin is 16, SMI MDIO pin is 17

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#20 Post by TD-er » 21 Jan 2021, 10:39

Olimex has several boards with LAN, with different pin configurations.
Not all of them use a pin to power/reset the LAN chip.

The Olimex boards (as far as I know) do use the LAN8710A, not the LAN8720A.
But as far as I know the main difference between both is (apart from the pin count) the LAN8710A does support RMII and the older protocol (MII?)
Since we only use RMII, both should work just fine, as long as you're using the correct GPIO configuration and PHY address (which can be set by resistor configuration on some pins)
Maybe I should change the configuration text into LAN8710/20. (No idea if the newer LAN874x chips also work just fine)

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#21 Post by Rub87 » 21 Jan 2021, 14:05

Any chance you could attach the espressif32 platformIO .bin file here I could test before spend 2 days trying to build it myself and having a 99% change that if it not runs it will be an user error?

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#22 Post by TD-er » 21 Jan 2021, 16:50

Why not use the "eth" ones from the last nightly build?
https://github.com/letscontrolit/ESPEas ... 210114.zip

User avatar
enesbcs
Normal user
Posts: 572
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: WT32-ETH01

#23 Post by enesbcs » 21 Jan 2021, 16:53

iron wrote: 21 Jan 2021, 09:33 Have your tried what enecbs posted above ?

Code: Select all

Preferred network: Ethernet
Ethernet PHY type: LAN8710
Ethernet PHY Address: 1
GPIO MDC: GPIO-23
GPIO MIO: GPIO-18
GPIO POWER: GPIO-16
Ethernet Clock: External crystal oscillator
The configuration i'd posted is for "WT32-ETH01" only. "wESP32" is another board with a different setup which popped up somehow in this topic.

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#24 Post by Rub87 » 21 Jan 2021, 18:36

TD-er wrote: 21 Jan 2021, 16:50 Why not use the "eth" ones from the last nightly build?
https://github.com/letscontrolit/ESPEas ... 210114.zip

The one I used came out of that archive. It was this one to be exact: ESP_Easy_mega_20210114_custom_ESP32_4M316k_ETH-factory.bin

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#25 Post by Rub87 » 21 Jan 2021, 21:44

I tried also a version older firmware: ESP_Easy_mega_20201227_normal_ESP32_4M316k_ETH-factory.bin

No luck. keep getting these messages in the terminal. GPIO pins are correct according to the wESP32 manual.
116288 : Info : ETH Connected
118223 : Error : ETH Disconnected
120275 : Info : ETH Connected

User avatar
iron
Normal user
Posts: 136
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: WT32-ETH01

#26 Post by iron » 22 Jan 2021, 09:03

Rub87 wrote: 21 Jan 2021, 21:44 I tried also a version older firmware: ESP_Easy_mega_20201227_normal_ESP32_4M316k_ETH-factory.bin

No luck. keep getting these messages in the terminal. GPIO pins are correct according to the wESP32 manual.
116288 : Info : ETH Connected
118223 : Error : ETH Disconnected
120275 : Info : ETH Connected
This is how tasmota has it working :

Code: Select all

* {"NAME":"wESP32","GPIO":[0,0,1,0,1,1,0,0,1,1,1,1,5568,5600,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
 * GPIO16 = ETH MDC
 * GPIO17 = ETH MDIO
 * #define ETH_TYPE          ETH_PHY_LAN8720
 * #define ETH_CLKMODE       ETH_CLOCK_GPIO0_IN
 * #define ETH_ADDR          0
GPIOS 16.17 and 0 are used
-D

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#27 Post by Rub87 » 22 Jan 2021, 12:02

Where can I enter for exmaple the ETH_TYPE setting? In the config.dat there are not really settings I think. or does this need to be done while compiling a bin?

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#28 Post by TD-er » 22 Jan 2021, 12:19

Via the web interface in the "hardware" tab.
Or via commands.
Taken from the source code:

Code: Select all

    #ifdef HAS_ETHERNET
      COMMAND_CASE_R(   "ethphyadr", Command_ETH_Phy_Addr,   1); // Network Command
      COMMAND_CASE_R(   "ethpinmdc", Command_ETH_Pin_mdc,    1); // Network Command
      COMMAND_CASE_R(  "ethpinmdio", Command_ETH_Pin_mdio,   1); // Network Command
      COMMAND_CASE_R( "ethpinpower", Command_ETH_Pin_power,  1); // Network Command
      COMMAND_CASE_R(  "ethphytype", Command_ETH_Phy_Type,   1); // Network Command
      COMMAND_CASE_R("ethclockmode", Command_ETH_Clock_Mode, 1); // Network Command
      COMMAND_CASE_R(       "ethip", Command_ETH_IP,         1); // Network Command
      COMMAND_CASE_R(  "ethgateway", Command_ETH_Gateway,    1); // Network Command
      COMMAND_CASE_R(   "ethsubnet", Command_ETH_Subnet,     1); // Network Command  
      COMMAND_CASE_R(      "ethdns", Command_ETH_DNS,        1); // Network Command
      COMMAND_CASE_R( "ethwifimode", Command_ETH_Wifi_Mode,  1); // Network Command
    #endif // HAS_ETHERNET
As you can see, those commands are "restricted" so you can only enter them from a limited set of origins.
But the serial port is allowed as source.

These are all commands with only 1 argument, so it should be clear how to format them.

e.g. "ethpinmdc,16"

Don't forget to save them when you're done.
And you cannot edit your command via serial if you make a mistake, so better copy/paste them from a text editor.

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#29 Post by Rub87 » 22 Jan 2021, 14:43

In the web interface I can only choose for PHY type LAN8710, dont know if that is the problem or not. When I attempt to change it per serial to LAN8720 I suppose I do:

Code: Select all

'ethphytype,ETH_PHY_LAN8720'
the response is then:

Code: Select all

ETH_Phy_Type:0

Ok

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#30 Post by TD-er » 22 Jan 2021, 15:11

ethphytype needs an integer value.
If it doesn't see an integer value, it will return the current value ("0")

Code: Select all

enum class EthPhyType_t : uint8_t {
  LAN8710 = 0,
  TLK110  = 1
};
Meaning the LAN8710 is type 0, so you have the type already set to this.

Like I wrote in a reply earlier, I do expect LAN8710A and LAN8720A to be the same from a software perspective.


And just to answer your next question which you didn't know you were about to ask:

Code: Select all

enum class EthClockMode_t : uint8_t {
  Ext_crystal_osc       = 0,
  Int_50MHz_GPIO_0      = 1,
  Int_50MHz_GPIO_16     = 2,
  Int_50MHz_GPIO_17_inv = 3
};
So the clock mode to use GPIO 0 must be set to "1".

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#31 Post by Rub87 » 22 Jan 2021, 15:19

Ok it seems the config was already correct then from configuring it through the web interface. I just flashed back the original wESP32 MicroPhyton and also cannot get an IP through the Ethernet.. I tested the same when the unit came and then it worked perfectly. Could it be that the initial GPIO settings in the ESPEasy firmware drives any of the below mentioned IO's to the wrong type and this could cause damage?

Code: Select all

 
Pins involved in connectivity between the ESP32 and PHY are IO0, IO16, IO17, IO19, IO21, IO22, IO25, IO26, IO27.
If the user loads software on the ESP32 that does not configure the RMII pins correctly, it is possible
the software will configure the pins in such a way that physical damage may result, for instance
connecting an output from the PHY to an output of the ESP32, resulting in a short circuit through the
chip’s output drivers.

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#32 Post by TD-er » 22 Jan 2021, 15:48

I don't think the settings can damage the PCB.
But I do know (from experience, sadly) that the LAN8710A chip can quite easily get damaged by ESD (electro static discharge)

I have some boards (made by myself) and one of them was working just fine until it was taken out of its enclosure.
After removing it from its enclosure it is no longer possible to get it to signal a connection to the switch.
So the switch does not indicate an active link status on that board anymore.

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#33 Post by Rub87 » 22 Jan 2021, 15:54

Ok, I will use the wESP32 with wifi for now and order a replacement one. I will wait before using it till someone more experienced in the matter can confirm an out of the box 'ETH' binary file doesnt damage the board and has working ethernet port after setting the GPIO settings correct in the hardware tab. Thanks so far all you for the excellent support :!: :D

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#34 Post by TD-er » 22 Jan 2021, 16:17

What specific board is it? (link)
Do you know if there is some demo code available to verify the settings?

Pepe
Normal user
Posts: 2
Joined: 22 Jan 2021, 23:26

Re: WT32-ETH01

#35 Post by Pepe » 22 Jan 2021, 23:51

Hi guys,

I'm trying to flash or load my own code to this board.... at the moment to try upload the code the board is not getting connected, you know, it keeps like .....____.....____ I'm trying with these serial converters (in the image) without luck, actually I'm reading serial messages good, since when I connect to my USB the device I can see in the serial monitor the message "module ok" sent by the default firmware, my problem is at load my code... :( , could you share some info about how you are programming this board? or some diagram of connections.

thanks in advance!
WhatsApp Image 2021-01-22 at 4.44.36 PM.jpeg
WhatsApp Image 2021-01-22 at 4.44.36 PM.jpeg (132.83 KiB) Viewed 6690 times

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#36 Post by TD-er » 23 Jan 2021, 00:07

If your board doesn't have an embedded USB to UART converter chip, you may need to trigger the boot-into-flash-mode yourself.

To do this you need to perform these steps in this order:
- Connect GPIO-0 via some resistor (470 Ohm, or direct connect) to GND
- Reset the node, while keeping GPIO-0 connected to GND
- Only let the GPIO-0 loose if the flashing has started.

The reason to use a resistor for pulling GPIO-0 down is to protect the GPIO pin if it may be running some firmware which has the pin set as an output and high level.
But I guess you can also get away with just connecting it to GND.

Most boards have the "boot" button connected to GPIO-0 like this.

Oh and if you're connecting an external USB to uart... make sure RX of the USB chip is connected to TX of the ESP and vice verse.
Also double check the voltage is correct as a lot of those converter boards do have a very bad voltage regulator on them.

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#37 Post by Rub87 » 23 Jan 2021, 00:21

TD-er wrote: 22 Jan 2021, 16:17 What specific board is it? (link)
Do you know if there is some demo code available to verify the settings?
its a wESP32 --> https://wesp32.com/

it comes shipped with microPhyton 3.1.12 on it and you can plug lan cable, gets an IP and works. I contacted the designer of the board and he kind of suspect still the damage would be done by some of the mentioned gpio being configuered in a way they would serve as an output of both the esp32 and the 8720. he says ESD is not impossible but yes. I didnt really touch the board when flashing it from the MicroPheaton to ESPEASY frimware..

User avatar
enesbcs
Normal user
Posts: 572
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: WT32-ETH01

#38 Post by enesbcs » 23 Jan 2021, 16:07

Pepe wrote: 22 Jan 2021, 23:51 Hi guys,

I'm trying to flash or load my own code to this board.... at the moment to try upload the code the board is not getting connected, you know, it keeps like .....____.....____ I'm trying with these serial converters (in the image) without luck, actually I'm reading
If GPIO-0 connected to GND and serial connection did not start, you have to try a bigger power supply, around 5V1A. But be careful with common GND!
This module may use up to 0.2A at startup especially when wifi is connected and/or LAN cable connected. The serial adapter itself can not provide as much, even the best CP2102 (max 100mA) can not do that.
I do not see the converter type on your picture, i guess it can be a CH340G which can provide ~25mA max.
Image

But if wifi/LAN is not connected i'd able to program it CP2102 + the wiring below, using Thonny:
Image

As i looking your wiring i guess you are using GPIO35 and GPIO17 for RX/TX which will never work. Real RX/TX is near the ESP chip at the right side.
https://bitekmindenhol.blog.hu/2020/11/ ... kes_lan-al

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#39 Post by Rub87 » 24 Jan 2021, 01:10

In the meantime I have managed to get PlatformIO running in VSC and I could compile a bin with the correct default settings for the GPIO 0, 16 and 17 for the wESP32.

Now is there a way in PlatformIO I can findout or make sure any of the other pins required for the LAN8710/20 arent wrongly configured as output when they should be an input for example?

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#40 Post by TD-er » 24 Jan 2021, 01:16

Search in the code for "DeviceMode_Olimex_ESP32_PoE" to see some examples of factory default settings (can be chosen on the reset factory default page, when not using a "testing" or "dev" build)

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#41 Post by Rub87 » 24 Jan 2021, 12:37

not easy for me to understand the code but here I found a check for the RMII gpio pins. Although if I understand correctly here it gives just a warning but doesnt really configure the pin either as input or output.

If I compare the pins against the wESP manual I find the same pins apart from GPIO 17

Code: Select all

Pins involved in connectivity between the ESP32 and PHY are IO0, IO16, IO17, IO19, IO21, IO22, IO25, IO26, IO27.

Code: Select all

[/# ifdef HAS_ETHERNET

  // Check pins used for RMII Ethernet PHY
  if (NetworkMedium_t::Ethernet == Settings.NetworkMedium) {
    switch (gpio) {
      case 0:
      case 21:
      case 19:
      case 22:
      case 25:
      case 26:
      case 27:
        warning = true;
        break;
    }

    // FIXME TD-er: Must we also check for pins used for MDC/MDIO and Eth PHY power?
  }

Edit: my mistake pin17 is already configured correct elsewere als MIO. :oops:
Last edited by Rub87 on 24 Jan 2021, 12:47, edited 3 times in total.

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#42 Post by TD-er » 24 Jan 2021, 12:40

The Olimex POE was just one example.
I added all Olimex boards I know of which have an ethernet connector.
They do differ between boards.
So please also have a look at the others to see which one matches yours.
If there is a match, I can add your board to the description too.

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#43 Post by Rub87 » 24 Jan 2021, 12:55

What I did now if trace to where the 'DEFAULT_ETH_xx points to and made that correct. So i now compiled a ESP_Easy_mega_20210124_normal_ESP32_4M316k_ETH-factory.bin and I loaded it and the settings as far a clock, MDC MIO and power pin are correct directly after flashing the firmware.
gpio.png
gpio.png (46.55 KiB) Viewed 6563 times

Code: Select all

1651 : Info  : Eth Wifi mode: Ethernet ETH: PHY Type: LAN8710 PHY Addr: 0 Eth Clock mode: 50MHz APLL Output on GPIO0 MDC Pin: 16 MIO Pin: 17 Power Pin: -1
What I am still unsure off is that any of the other pins

Code: Select all

IO19, IO21, IO22, IO25, IO26, IO27
are perhaps not configures wrongly somewhere... I have ordered some spare LAN8720 ic's so I will try to solder one on and see if I can make it to work

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#44 Post by TD-er » 24 Jan 2021, 13:06

All pins that cannot be configured in ESPEasy are fixed and are always the same on ESP32 as the needed function cannot be re-mapped to other pins.

User avatar
enesbcs
Normal user
Posts: 572
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: WT32-ETH01

#45 Post by enesbcs » 24 Jan 2021, 17:53

Rub87 wrote: 24 Jan 2021, 12:55 What I am still unsure off is that any of the other pins

Code: Select all

IO19, IO21, IO22, IO25, IO26, IO27
are perhaps not configures wrongly somewhere... I have ordered some spare LAN8720 ic's so I will try to solder one on and see if I can make it to work
These pins are the same on every ESP32 as ESP-IDF is not providing a way to alter them:

GPIO22 - EMAC_TXD1 TX1
GPIO19 - EMAC_TXD0 TX0
GPIO21 - EMAC_TX_EN TX_EN
GPIO26 - EMAC_RXD1 RX1
GPIO25 - EMAC_RXD0 RX0
GPIO27 - EMAC_RX_DV CRS

Power pin is optional, MDIO and MDC can be altered, and PHY Clock can be GPIO-0 / GPIO-16 or GPIO-17, and this is the end of options.

You can view wesp32 pinout diagram here:
https://cdn.hackaday.io/files/853893653 ... SP32-1.pdf

If you are trying to use bare LAN8720 modules, a little DIY will be needed on the board, as GPIO-0 has special meaning for ESP32..
I've used LAN8720 with WROVER modules which a little different than WROOM, as WROVER GPIO16/GPIO17 is occupied by onboard PSRAM, but not impossible to do:
https://translate.google.com/translate? ... etekes_lan

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#46 Post by Rub87 » 24 Jan 2021, 18:28

If you are trying to use bare LAN8720 modules, a little DIY will be needed on the board, as GPIO-0 has special meaning for ESP32..
I've used LAN8720 with WROVER modules which a little different than WROOM, as WROVER GPIO16/GPIO17 is occupied by onboard PSRAM, but not impossible to do:
https://translate.google.com/translate? ... etekes_lan
Yes... and just to not have to do this I thought let me get the wESP32 which has a purpose made small controller to handle this. Can be read by the designer of the board on hackaday https://hackaday.io/project/85389-wesp3 ... et-and-poe

User avatar
enesbcs
Normal user
Posts: 572
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: WT32-ETH01

#47 Post by enesbcs » 24 Jan 2021, 19:23

Rub87 wrote: 24 Jan 2021, 18:28
If you are trying to use bare LAN8720 modules, a little DIY will be needed on the board, as GPIO-0 has special meaning for ESP32..
I've used LAN8720 with WROVER modules which a little different than WROOM, as WROVER GPIO16/GPIO17 is occupied by onboard PSRAM, but not impossible to do:
https://translate.google.com/translate? ... etekes_lan
Yes... and just to not have to do this I thought let me get the wESP32 which has a purpose made small controller to handle this.
Yes, but the "WT32-ETH01" board which is in the topic subject is also an ESP32 with LAN, just cheaper than wESP32... ;)

Pepe
Normal user
Posts: 2
Joined: 22 Jan 2021, 23:26

Re: WT32-ETH01

#48 Post by Pepe » 25 Jan 2021, 04:14

enesbcs wrote: 23 Jan 2021, 16:07
Pepe wrote: 22 Jan 2021, 23:51 Hi guys,

I'm trying to flash or load my own code to this board.... at the moment to try upload the code the board is not getting connected, you know, it keeps like .....____.....____ I'm trying with these serial converters (in the image) without luck, actually I'm reading
If GPIO-0 connected to GND and serial connection did not start, you have to try a bigger power supply, around 5V1A. But be careful with common GND!
This module may use up to 0.2A at startup especially when wifi is connected and/or LAN cable connected. The serial adapter itself can not provide as much, even the best CP2102 (max 100mA) can not do that.
I do not see the converter type on your picture, i guess it can be a CH340G which can provide ~25mA max.
Image

But if wifi/LAN is not connected i'd able to program it CP2102 + the wiring below, using Thonny:
Image

As i looking your wiring i guess you are using GPIO35 and GPIO17 for RX/TX which will never work. Real RX/TX is near the ESP chip at the right side.
https://bitekmindenhol.blog.hu/2020/11/ ... kes_lan-al
Hi enesbcs,

Men!!! you make my day! I don't know why I never tested "Real RX/TX is near the ESP chip at the right side" that was my mistake... :D :D :D

now it's working :) , I share the simple test code I used to check this board if this helps to someone else...

Code: Select all

#include <Arduino.h>
/*
    This sketch shows how to configure different external or internal clock sources for the Ethernet PHY
*/

#include <ETH.h>

/* 
   * ETH_CLOCK_GPIO0_IN   - default: external clock from crystal oscillator
   * ETH_CLOCK_GPIO0_OUT  - 50MHz clock from internal APLL output on GPIO0 - possibly an inverter is needed for LAN8720
   * ETH_CLOCK_GPIO16_OUT - 50MHz clock from internal APLL output on GPIO16 - possibly an inverter is needed for LAN8720
   * ETH_CLOCK_GPIO17_OUT - 50MHz clock from internal APLL inverted output on GPIO17 - tested with LAN8720
*/
#define ETH_CLK_MODE    ETH_CLOCK_GPIO17_OUT

// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source)
#define ETH_POWER_PIN   16

// Type of the Ethernet PHY (LAN8720 or TLK110)
#define ETH_TYPE        ETH_PHY_LAN8720

// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR        1

// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN     23

// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN    18


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(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
}


void loop() {
  if (eth_connected) {
    testClient("google.com", 80);
  }
  delay(10000);
}
I'm reusing the this USB to UART adapted to ESP8266 to flash this board

https://es.aliexpress.com/item/40012677 ... web201603_

and the wiring (as enesbcs's previous diagram)
WhatsApp Image 2021-01-24 at 9.10.36 PM.jpeg
WhatsApp Image 2021-01-24 at 9.10.36 PM.jpeg (124.48 KiB) Viewed 6487 times

Rub87
Normal user
Posts: 26
Joined: 29 Nov 2020, 22:28
Location: Belgium

Re: WT32-ETH01

#49 Post by Rub87 » 29 Jan 2021, 21:34

back to the wESP32..

I soldered a fresh LAN8720 onto the unit and with the ESPEASY binary flashed onto it which I had compiled with the correct gpio settings for the wESP32 I was still unable to get connected over the ethernet port.

it does find the MAC of the LAN8720 but it keeps saying ethernet connected and shortly after ethernet disconnected. it doesnt matter if the ethernet port has a cable in or not...

Then I flashed MicroPhyton on it, to verify if the newly soldered LAN8720 would be physically ok or if I fucked it by soldering the damn tiny thing.

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (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:4844
load:0x40078000,len:9656
load:0x40080400,len:6216
entry 0x400806f0
I (457) cpu_start: Pro cpu up.
I (457) cpu_start: Application information:
I (457) cpu_start: Compile time:     Dec 20 2019 07:50:41
I (460) cpu_start: ELF file SHA256:  0000000000000000...
I (466) cpu_start: ESP-IDF:          v3.3
I (471) cpu_start: Starting app cpu, entry point is 0x40083600
I (0) cpu_start: App cpu up.
I (482) heap_init: Initializing. RAM available for dynamic allocation:
I (488) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (495) heap_init: At 3FFBA488 len 00025B78 (150 KiB): DRAM
I (501) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (507) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (514) heap_init: At 40092D6C len 0000D294 (52 KiB): IRAM
I (520) cpu_start: Pro cpu start user code
I (203) cpu_start: Chip Revision: 1
W (203) cpu_start: Chip revision is higher than the one configured in menuconfig. Suggest to upgrade it.
I (206) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (40) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (50) emac: emac reset done
I (318) ethernet: start
MicroPython v1.12 on 2019-12-20; ESP32 module with ESP32
Type "help()" for more information.
>>> I (4318) ethernet: LAN cable connected
I (5298) event: eth ip: 10.0.1.44, mask: 255.255.255.0, gw: 10.0.1.1
I (5298) ethernet: Got IP
Now this proves the LAN8720 is workin fine and still something in the ESPEASY causes it not to connect. the mdc and mio gpio are correct. the clock with gpio 0 also. Anyone hs an idea what could be done to make it work?

TD-er
Core team member
Posts: 4523
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: WT32-ETH01

#50 Post by TD-er » 29 Jan 2021, 22:29

Code: Select all

I (40) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
It looks like the MAC address is not set???
I thought it took the MAC from the ESP, but this looks like this may be something different here?

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests