Skip to content

Conversation

@rmontrosecbw
Copy link
Contributor

You identified a problem with deprecated ESP Ethernet calls, so I got a few WT32-ETH01 boards to test the changes. They didn't work with the changes, and that led me down a rabbit hole to get them working. I don't know if Espressif changed how their stack works, but with these boards (probably all internal PHY devices) and the Espressif examples, you need to initialize netif and the event loop before creating netif objects (ethernet.c used first to make the network objects). While tracking down the problem, I added many debugging statements and gated them with the Moddable define ethernet_debug. We need to switch between static and DHCP, so I've added methods to support this and to report the IPv6 address (we will be supporting that). There are several additional MODDEF flags to support the WT32-ETH01 boards.
I didn't think this would require as many changes but it now allows better monitoring of the ESP32 Ethernet behavior.

Code required to support the W5500 Ethernet-SPI chipset, specifically for the ESP32 processors. This includes modifications to:
- ethernet.c main Ethernet driving code.
- Providing manifest.json files for both the ENC28J60 and W5500 SPI Ethernet chipsets
- ESP32S3 CMakeLists.txt file to include needed Espressif SDK library components
- Ethernet.md documentation to provide additional details of what needs to be modified to support Ethernet, especially on the ESP32 processors.
- Added the SPI Ethernet module images to the assets directory (the picture of the ENC28J60 HAN module from atomsindustries.com is no longer available).
The updated ethernet-monitor example will show:
- timeapi.io only accepts HTTPS connections, so this example illustrates how to make a HTTPS connection using Moddable
- HTTPS requires the date and time to be set, or the certificate validation fails. This example also shows getting the time from SNTP service.
- Using DNS pool entries for host name lookup.
- Improved handling of the Ethernet callbacks to monitor the connection.
…o Wiznet_W5500_Ethernet_support

* 'public' of https://github.com/rmontrosecbw/moddable: (25 commits)
  419 ble server - first time
  mcsim mac background modes
  eliminate unnecessary floating point operations
  (@ps) mcrun option: -noCheckModule
  use MODDEF values
  version bump 5.11.0
  idf v5.5.1
  Incorporated suggestions from Peter.
  jsontest.com is no longer active. Replaced with code to use timeapi.io
  WIZnet W5500 Ethernet support
  ble notification isn't fixed in 5.5.1
  mac ble pairing dialog
  mac ble error clears completion
  more security
  rand() returns signed integer
  wait for connection to be secured before starting discovery
  secure health temperature monitor example
  security: first try
  quiet warning
  esp-nimble#108 is fixed in IDF v5.5.1
  ...
…o Wiznet_W5500_Ethernet_support

* 'public' of https://github.com/rmontrosecbw/moddable:
  include manifest file of embedded:io/provider/MCP23X17
  Add MCP23017 expander module to manifest
  add xsCallFunction* Moddable-OpenSource#1536
  don't need to import UDP
  first try at 419 mDNS typings
  419 mdns - first time
  xsbug & mcsim icons for macOS Tahoe
  xsbug & mcsim icons for macOS Tahoe
  xsbug & mcsim icons for macOS Tahoe
  The mbedtls include path in Espressif SDK version 5.5.x is $(IDF_PATH)/components/mbedtls/mbedtls/include/. This is correct in make.esp32.mk but was left out of nmake.esp32.mk Moddable-OpenSource#1534
  Fix typo in controller
  fix default manifest for git repos Moddable-OpenSource#1532
  option to use Map for txt record
  changes from TC53 discussion
  XS linker; fix byte code map of strings > 64 KB
  onReady isn't passed connection
- Added setStaticIP(ipAddr, netmask, gateway) and doDHCP() emthods
- Added IPV6 address reporting (if available) to debug
- Added reporting of link speed and duplex status to debug
- Added MODDEF_ETHERNET_POWER_PIN, if set, will cycle power on the poin and then asset it to power up the Ethernet device
- Initialize netif and event loop first, required before creating netif objects to ensure reliable creation of ESP network stack
- For internal Phy, will scan for the address and report the found address and tell if mismatch with MODDEF_ETHERNET_INTERNAL_PHY_ADDRESS
- Added MODDEF_ETHERNET_DEBUG, if set to 1, will print additional diagnostic messages on ESP32 log output
- Added MODDEF_ETHERNET_INTERNAL_PHY_GPIO0_CLOCK_INPUT that will set GPIO0 to an input, since some WT32-ETH01 boards sonnect the clost to GPIO0 pin
- Updated to Espresif 5.5.1 SDK calls
- ethernet_monitor was changed to use HTTPS connection to timeapi.io and required specifying creation parameters to additional memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant