Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get working on ESP-IDF? #6

Open
cortices opened this issue Nov 10, 2024 · 0 comments
Open

How to get working on ESP-IDF? #6

cortices opened this issue Nov 10, 2024 · 0 comments

Comments

@cortices
Copy link

I know this repo is the Arduino library, but you may be able to help.

The M5-PoECam-W doesn't connect the INT pin on the W5500, which means the MCU must poll the W5500 every few ms to check for data.
This is fine and acceptable by the W5500, but the Arduino and ESP-IDF frameworks have not supported this configuration until very recently, leading to various reports of "extremely slow/unreliable ethernet".

I have helped to get a PR into ESPHome (esphome/esphome#7503) to support this operation mode, which requires forcing it to Platformio Espressif32 platform v6.9.0 and ESP-IDF version 5.3.1.

Nevertheless, I'm still getting the following errors trying to initialise the ethernet component with the correct pins. Contributors report that this new library change has worked for other boards without the INT pin connected.

The following relevant lines are produced in DEBUG level logging:

...
[C][ethernet:041]: Setting up Ethernet...
[D][esp-idf:000]: E (2334) gpio: gpio_install_isr_service(502): GPIO isr service already installed
[D][esp-idf:000]: E (2438) w5500.mac: w5500_reset(306): reset timeout
[D][esp-idf:000]: E (2438) w5500.mac: emac_w5500_init(824): reset w5500 failed
[D][esp-idf:000]: E (2439) esp_eth: esp_eth_driver_install(228): init mac failed
 [E][ethernet:204]: ETH driver install error: (263) ESP_ERR_TIMEOUT
[E][component:119]: Component ethernet was marked as failed.
[E][component:164]: Component ethernet set Error flag: unspecified
...

Would you be able to help at all?

ESPHome config relevant parts:

esp32:
  board: m5stack-station
  #flash_size: 16MB
  framework:
    type: esp-idf
    version: "5.3.1" 
    platform_version: "6.9.0" 
   
# Enable logging
logger:
  level: DEBUG
  
# Enable Home Assistant API
api:

ethernet:
  type: W5500
  clk_pin: GPIO23
  mosi_pin: GPIO13
  miso_pin: GPIO38
  cs_pin: GPIO4
  # No interrupt pin connected -- is this correctly supported? Should pass interrupt pin as -1 to ESP-IDF
  #interrupt_pin: 25
  #polling_interval: 5ms
  #clock_speed: 30MHz


# Example configuration entry
esp32_camera:
  external_clock:
    pin: GPIO27
    frequency: 20MHz
  i2c_pins:
    sda: GPIO14
    scl: GPIO12
  data_pins: [GPIO32, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
  vsync_pin: GPIO22
  href_pin: GPIO26
  pixel_clock_pin: GPIO21
  reset_pin: GPIO15

  # Image settings
  name: Camera
  resolution: 640x480
  max_framerate: 0.2 fps
  idle_framerate: 0.05 fps
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

No branches or pull requests

1 participant