ESPHome experience with m5stack products

I thought it was about time I tried out ESPHome, and this is my experience so far with m5stack products. I have uploaded it on a m5stick-c and five m5stamp-c3u’s. I’m using a Windows laptop for the install, whereas I’ve seen others have issues with a Pi or Ubuntu; so ymmv. I also have a Core 2 and v1 Paper, but ESPHome doesn’t (yet) support the displays, so I will skip them for now.

For the m5stick-c, once I clicked connect, it was there, but it would not install. I found I needed to press the middle button (below the screen) for the install to work. I’m not sure how long you have to keep it pressed, so I did so for the whole process of several minutes. I understand there’s more editing required to get the screen working with the m5stick-c, but this will come later.

For the m5stamp, you have to hold the middle button down while inserting the usb plug into the laptop. If you don’t, it won’t show up in the connection dialog. I have the c3u, and it’s possibly different for the c3, because I think that connects with an adapter rather than via the inbuilt usb. It sits on “Preparing install” for several minutes. After the install is complete, it will try to connect, and you will get “Configuration created but unable to detect the device on the network”, but don’t unplug! If you do, you’ll notice it keeps connecting and disconnecting from USB because it isn’t working. Plug it back in, remembering to hold the middle button. Then edit the config and change the top to match the code below (3 lines to be inserted). After installing this, and unplugging/re-plugging, you should be good to go.

esphome:
  name: your-name-here
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-c3-devkitm-1
  variant: ESP32C3
  framework:
    type: esp-idf

As a noob, I found out the hard way you shouldn’t navigate away from the page while it’s “Preparing installation”, or it will (probably) fail. The other first-timer experience is that it’s probably not a good idea to rename the device once installed. Initially it won’t work unless you power cycle, because it will still be connected to wifi with the old name. But even after that, it appears that the yaml file maintains the original name, which might cause confusion later on.

In the latest 2022.5 Esphome, there is a new Rename option. I’ve tried it and it works well. You do need to delete and re-add the integration though.

the m5stack core module has the best compatibility because of the buttons and display.
i have the m5stamp-c3 too, but also didn’t get it to work.
if one compares the pin assignments of the devkit-c3 and the stamp-c3, he finds differences.
i think the stamp must be supported by platformio by itself, not as the devkit from espressif

I have the m5stamp-c3u working with ESPHome and esp32_ble_tracker tracker. At first it seemed to be switching the antenna between BT and wifi, so it would miss BT broadcasts. OTA updates were also not working. However, when changing the config to that below, it is now working as expected. Having said that, when I move it to where its to belong, it’s not working properly - it doesn’t connect to wifi. If I plug it into my laptop at the same location, it works, so I’m still troubeshooting what’s going on. Consequently, I have not yet tried ESPresence.

board: esp32-c3-devkitm-1
variant: ESP32C3
framework:
  type: esp-idf
  sdkconfig_options:
    CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
    CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
    CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"

UPDATE: It seems it was working all along. With esp32_ble_tracker it seems to take a minute or two to connect to wifi, and I interpreted this as not working at all. Having the LED go from red (on_boot priority 600), to yellow (priority 260, Wifi connected) to green (once api is connected) made it a lot easier to see what was happening.

1 Like

so i got it working as well, thanks to your hints.

but i learned pretty fast that the c3 is basically a esp8266 with bluetooth, including the lower clock rate compared to a “full” esp32

[12:49:41][W][esp32_ble_tracker:085]: Too many BLE events to process. Some devices may not show up.