ESPhome ESP32-WROOM-32 AZ Delivery board does not appear to run generated firmware

I’m a bit stuck here; any help you can give will be appreciated.

Background

I’m trying to get an AZ Delivery ESP32-WROOM-32 board to run the following config from ESPhome. Note that I’ve currently commented out the parts of the config that actually do anything, because I wanted to eliminate it as the cause of the trouble:

substitutions:
  device_name: cat_locator

esphome:
  name: ${device_name}
  platform: ESP32
# board: esp32dev
  board: nodemcu-32s
  platformio_options: 
    platform: espressif32
    board: az-delivery-devkit-v4
    board_build.mcu: esp32
    board_build.f_cpu: 240000000L
#   on_boot:
#     priority: -10
#      then:
#       - switch.turn_on: ${device_name}_tux_home
#       - switch.turn_on: ${device_name}_tux_away
#       - switch.turn_on: ${device_name}_emmy_home
#       - switch.turn_on: ${device_name}_emmy_home
      
wifi:
  ssid: "Ubiquiti-IoT-Newbold"
  password: !secret ubiquiti_iot_newbold_pass

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Cat Locator"
    password: !secret esphome_admin_pass

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  reboot_timeout: 15min
  password: !secret esphome_admin_pass

ota:
  password: !secret esphome_admin_pass
  
######################

# the web_server & sensor components can be removed without affecting core functionaility.

web_server:
  port: 80
  auth:
    username: admin
    password: !secret esphome_admin_pass

# sensor:
#   - platform: wifi_signal
#     name: ${device_name} Wifi Signal Strength
#     update_interval: 60s
#   - platform: uptime
#     name: ${device_name} Uptime

# text_sensor:
#   - platform: wifi_info
#     ip_address:
#       name: ${device_name} IP Address
#     ssid:
#       name: ${device_name} Connected SSID
#     bssid:
#       name: ${device_name} Connected BSSID
#     mac_address:
#       name: ${device_name} Mac Wifi Address
      
#######################################
# Device specific Config Begins Below #
#######################################

# switch:
#   - platform: gpio
#     id: ${device_name}_tux_home
#     pin:
#       number: GPIO2
#       inverted: true
#       
#   - platform: gpio
#     id: ${device_name}_tux_away
#     pin:
#       number: GPIO3
#       inverted: true
# 
#   - platform: gpio
#     id: ${device_name}_emmy_home
#     pin:
#       number: GPIO4
#       inverted: true
#       
#   - platform: gpio
#     id: ${device_name}_emmy_away
#     pin:
#       number: GPIO5

As you might imagine, I have 4 LEDs and appropriate current-limiting resistors attached to GPIOs. I have verified that the LEDs and the board are functional by uploading an Arduino sketch that flashes the LEDs in turn. Board and LEDs function as expected.

I should also say, I’m running ESPhome within home assistant on an RPi.

The Problem

I compile the above config in ESPhome, and upload to the board. Either with or without the functional parts of the config in play (commented or uncommented), the same thing happens: I power up the board after flashing, and it does not come on line; nor does it join the WiFi network or anything. Weirdly, 2 of the LEDs do light up; one brightly, and the other dimmed. (Bright is on GPIO3, dimmed is on 5). Worth saying here, is that if I leave the LEDs connected and put the board in flashing mode, they light in the same pattern. As an experiment, I also tried uploading the original Arduino sketch after having flashed the binary generated by ESPhome from the above config, and it uploads without me pushing the button to put the board into flash mode?

The documentation does say that the GPIO pins I’m using are used to determine boot mode, so I also did try uploading without anything connected to the board via the PINs; i.e., with only the USB interface connected and nothing else; this made no difference. The same behaviour is observed once the board is re-powered and re-connected to the LEDs.

I guess I should also say here that I’d normally expect to show logs of some kind to try to help those trying to help me figure out what is going on, however I can’t see where I would get anything useful like that from.

As I said above, any help offered will be appreciated…

Thanks!

Paul.

The logs show in the esphome UI by clicking ‘Logs’

@nickrout, I tried that. You mean the “Logs” button on the node in question, right? It doesn’t do anything for this node (well, it says it can’t resolve the IP for cat_locator.local…); I don’t think the node even gets as far as connecting to the network - I think that’s what the logs button does right? tries to connect to the node over the network? Worth also saying is that I check for the new device via the management software for my network (Ubiquiti, if that matters) and it does not show up…

@nickrout, meant to say: thanks for your help so far…

When you flash the chip are you using esphome with a usb? After flashing a log should come up right away from the usb connection. You can increase the log output by adding

logger:
  level: VERY_VERBOSE

While the esp device is still connected physically to the machine running esphome, the logs should be gathered via serial, not the network. Make sure you have the serial device is chosen at top right, not OTA.

@Mikefila, @nickrout, I think you are both saying the same thing: I should try flashing from the RPi running HA? Currently, I am flashing from my Ubuntu laptop by downloading the binary after compilation, and then flashing with esptool.py. I will give it a go from the Pi. Thanks both. Will report back with what happens…

Use the esphome flasher. There is an ubuntu version.

@nickrout, @Mikefila, Well: flashing from the pi worked without flaw. Would mark both your answers as the solution if the site would let me. Thanks both; appreciate the help.

@Mikefila, will try the esphome flasher on Ubuntu as well.

I can’t even seem to be able to upload anything to the ESP32 (same brand & model)…
This is what I got:
imagem
Tried to press the BOOT button (as suggested). Does not work. Tried through ESP Home Web. Does not work. Also the esphome flasher does not seem to recognize the device. Also tried with different units.
Any help I can get, I would be very thankful.

@sergioxavier, dunno if this is it, but the wording on the message you got around the boot button isn’t that clear. What it should say is something like:

“…pressing the boot button whilst plugging the device in to your computer’s USB port”

Hope this helps.

1 Like

In the end, it worked for me to press it exactly just before when I selected the serial port, BUT, I had to hold it from there, until the device initiates its configuration. It is true that this ESPHome message is not perfectly clear, and surely it could be improved.
Thank you for your reply :slight_smile:

1 Like