M5Stack PoECam ESP32 board support?

Did you manage to get the ethernet working?

Yes. It is flawlessly working like this:

esphome:
  name: m5-poesp32
  friendly_name: m5-poesp32

esp32:
  board: m5stack-core-esp32
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "..."

ota:
  password: !secret ota_password

external_components:
  - source: github://BMOD89/esphome_compontens
    refresh: 0s
    components: [ d0 ]

# Network interface for PoESP32
ethernet:
  type: IP101
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO5

Are you sure that’s not the PoESP32 that you’re thinking of @rtv ?

I have almost a hundred of those. That one’s known to work fine, it uses the IP101G.

The one that we’re specifically querying support for:

Uses the W5500 chipset, which doesn’t appear to be supported by ESPHome?

Updated for anyone else coming across this, the W5500 has had support added since Dec '22, meaning the PoECam or PoECam-W both get network:

ethernet:
  type: W5500
  clk_pin: GPIO23
  mosi_pin: GPIO13
  miso_pin: GPIO38
  cs_pin: GPIO4

However even with the following for the camera, my setup is failing:

esp32_camera:
  external_clock:
    pin: GPIO27
    frequency: 20MHz
  i2c_pins:
    sda: GPIO25
    scl: GPIO33
  data_pins: [GPIO32, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
  vsync_pin: GPIO22
  href_pin: GPIO26
  pixel_clock_pin: GPIO21
  reset_pin: GPIO15
  resolution: 1920x1080
  name: PoECamW

image

And it sounds like that may be due to the camera connection to the ESP32? Unsure, but, tempted to try buying another one just to see…

Try a smaller resolution, the default perhaps.

Was worth a try, but no joy sadly. Leaving that out, or having 640x480 specified still fails. The camera is rated at 1920x1080 though.

I saw a reference elsewhere for the same unit (I believe) but used GPIO23 for scl. Might be something to try… 23 vs 33.

  i2c_pins:
    sda: GPIO25
    scl: GPIO23

That’s the same as the ethernet clk pin?

Yeah, I just looked at the schematic and GPIO25/33 go together. So the example I saw must have been for a different board.

Now I’m thinking that the GPIO25/33 I2C pins are for the external grove connector and not part of the camera. Looking at the schematic again, I think GPIO 12/14 might be what you need… its labeled as SIO_C and SIO_D. Not sure if that is (D)ata and (C)lock. I’m trying to see which pins you haven’t assigned.

I was using the information they have from the pinmap:

Which is the same as the non-W unit from what I can see.

Yep, looks like G12/G14 is what you need base on what you just posted. From the esphome docs:

i2c_pins (Required): The I²C control pins of the camera.
sda (Required, pin): The SDA pin of the I²C interface. Also called SIOD.
scl (Required, pin): The SCL pin of the I²C interface. Also called SIOC.

So SIOC from camera is the i2c scl pin (G12) and SIOD is the i2c sda (G14).

Ahhhhh so the Ethernet is OK with this then (Coz that was working):

ethernet:
  type: W5500
  clk_pin: GPIO23
  mosi_pin: GPIO13
  miso_pin: GPIO38
  cs_pin: GPIO4

And I should just need to set the sda / scl pins like this?

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
  resolution: 1920x1080
  name: PoECamW

I’ll give that a try when at my PC soon, many thanks @kkellner :pray:

Yep, that should work. You might start with 1024x768 for resolution. I’ve had other esp32 cam modules that didn’t have enough memory to handle larger resolutions (the ESP32 would crash). You can always increase the resolution once you have a lower resolution working. Let me know if this all works as I’m considering getting the same module but wanted to confirm that all components can work with ESPHome.

You will also want to add the following to allow home assistant access to the video:

# Configuration for the ESP32 Camera Web Server
esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot

Ah brilliant, OK will set that too, thankyou.
Will come back soon with the details :slight_smile:

@Chilling_Silence Any update on M5Stock PoE board and getting camera working?

Sorry it’s been left at work, should get to it this week :slight_smile: Will keep you posted

Got it working, got like 5x images, but then it died:

[15:24:08][D][esp32_camera:196]: Got Image: len=104080
[15:24:26][D][esp32_camera:196]: Got Image: len=103188

I hadn’t added the esp32_camera_web_server and it still showed up in HA, but it seems to basically be overheating and just losing the plot now :frowning: Not sure I’d recommend it.

The PoESP32 from them works amazingly though by comparison so yeah :-/

That is unfortunate. Have you tried reducing the framerate and possibly the resolution? Would be interesting to see if you can get a stable configuration that doesn’t overheat.

Example:

esp32_camera:
  max_framerate: 1 fps
  idle_framerate: 0.1 fps
  resolution: 1024x768