I have an Athom Garage Door Opener that I’ve misconfigured - I think I gave it some inaccurate wifi information. I’m having trouble getting it to boot into wifi network mode so I can connect and correct the info. Does anyone know the process for making this happen? I know its simple, just a matter of supplying power and pressing the button yet I’m still not seeing the network appear.
Do you have captive_portal
set in the firmware? If so, the mechanism is described here. Captive Portal — ESPHome
Hmn, I think I flashed without that. I thought I only needed ‘ota’
Well you know what you flashed with it is in your yaml file.
Ota doesn’t work if it doesn’t connect to wifi.
I think it should have connected to wifi.
At this point I’m not sure what specifically was in that yaml file as I saved over it. Good lesson not to do that, although I’d probably be where I am just the same.
You might have to flash it via serial.
I’ve kept digging deeper, now flashing with esptool and getting
A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
Any advice? I’m beginning to wonder if I have a dead device.
How are you flashing? Directly flashing an ESP chip needs the correct high/low signals on the pins in order to put it into serial flash mode.
For direct serial flashing you need to pull GPIO0 low when the chip is powered on, otherwise it boots into regular mode.
EDIT: If you could post a picture of your flashing setup it would help.
Here’s a link to my setup. I was able to flash an ESP32 but obviously I might be overlooking something. Note that I’ve jumpered boot to ground
Much appreciated
How about the complete output of esptool, including the command you’re actually typing.
➜ esphome esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/cu.usbserial-ABSCDMU6 --chip esp8266 write_flash -z --flash_size detect 0x0 /Users/-----/esphome/.esphome/build/athom-garage-door/.pioenvs/athom-garage-door/firmware.bin
esptool.py v4.7.0
Serial port /dev/cu.usbserial-ABSCDMU6
Connecting....
Chip is ESP8285H16
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: e0:98:06:f9:a6:09
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash will be erased from 0x00000000 to 0x0007afff...
Flash params set to 0x0330
Compressed 499952 bytes to 340708...
Writing at 0x00075332... (100 %)
A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
Are you sure that your serial interface can supply enough power to boot the ESP? In my experience USB from a serial adapter isn’t enough (the ESP can pull up to ~400mA at 3V) - maybe try powering the Athom board from the USB adapter when you attempt to flash.
If you just boot the device in normal mode, do you get any content at all over the serial port in this arrangement? The default Athom config leaves the serial logger active so it should work.
Have you tried swapping TXD/RXD around? The way they’re labelled is not always consistent (i.e. “like for like” labelling is done sometimes).
If as you say you have an ESP config on there, I’d expect to see serial logging in normal boot mode.
I’ve booted / flashed with power supplied via usb in addition to the serial connection.
Looks like its stuck in a low level boot loop. The content changes a bit but I’m not sure if in a meaningful way.
[18:21:32][C][ota:483]: There have been 3 suspected unsuccessful boot attempts.
[18:21:32][I][app:029]: Running through setup()...
[18:21:32]
[18:21:32]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[18:21:32]
[18:21:32]Exception (0):
WARNING Exception type: Illegal instruction (Is the flash damaged?)
[18:21:32]epc1=0x402307ff epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
WARNING Decoded 0x402307ff: std::function<void ()>::function(std::function<void ()>&&)
[18:21:32]
[18:21:32]>>>stack>>>
WARNING Found stack trace! Trying to decode it
[18:21:32]
[18:21:32]ctx: cont
[18:21:32]sp: 3ffffd60 end: 3fffffd0 offset: 0190
[18:21:32]3ffffef0: 3fff19fc 3fff1a34 00000000 402017b4
WARNING Decoded 0x402017b4: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag$isra$0 at api_connection.cpp
[18:21:32]3fffff00: 00000000 3fff2400 3fff1a2c 00000038
[18:21:32]3fffff10: 3fffff60 0000ea60 3fff140c 4021aa2e
WARNING Decoded 0x4021aa2e: esphome::Component::set_interval(unsigned int, std::function<void ()>&&)
[18:21:32]3fffff20: 3fffff28 00000000 3ffe8600 40100d8c
WARNING Decoded 0x40100d8c: umm_free_core at umm_malloc.cpp
[18:21:32]3fffff30: 3fff2444 3fff19c4 3fff2430 3fffff80
[18:21:32]3fffff40: 40231614 4021bf50 3fff2444 3ffefbc0
WARNING Decoded 0x40231614: std::_Function_handler<void (), esphome::preferences::IntervalSyncer::setup()::{lambda()#1}>::_M_manager(std::_Any_data&, std::_Function_handler<void (), esphome::preferences::IntervalSyncer::setup()::{lambda()#1}> const&, std::_Manager_operation)
WARNING Decoded 0x4021bf50: std::_Function_handler<void (), esphome::preferences::IntervalSyncer::setup()::{lambda()#1}>::_M_invoke(std::_Any_data const&)
[18:21:32]3fffff50: 3fff140c 00000001 3ffefbc0 4021c194
WARNING Decoded 0x4021c194: esphome::preferences::IntervalSyncer::setup()
[18:21:32]3fffff60: 3fff19fc 3fff1a34 00000000 00000020
[18:21:32]3fffff70: 3fff0e74 00000000 3ffefbc0 4021a581
WARNING Decoded 0x4021a581: esphome::Application::setup()
[18:21:32]3fffff80: 0000001c 0000001c 3fff2444 3fff1654
[18:21:32]3fffff90: 00000008 feefeffe feefeffe feefeffe
[18:21:32]3fffffa0: feefeffe feefeffe feefeffe 3fff0080
[18:21:32]3fffffb0: 3fffdad0 00000000 3fff006c 4022cd8c
WARNING Decoded 0x4022cd8c: loop_wrapper() at core_esp8266_main.cpp
[18:21:32]3fffffc0: feefeffe feefeffe 3ffe8640 40100475
WARNING Decoded 0x40100475: cont_wrapper
[18:21:32]<<<stack<<<
[18:21:32]
[18:21:32]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[18:21:32]
[18:21:32] ets Jan 8 2013,rst cause:1, boot mode:(3,7)
[18:21:32]
[18:21:32]load 0x4010f000, len 3460, room 16
[18:21:32]tail 4
[18:21:32]chksum 0xcc
[18:21:32]load 0x3fff20b8, len 40, room 4
[18:21:32]tail 4
[18:21:32]chksum 0xc9
[18:21:32]csum 0xc9
[18:21:32]v0007a0f0
[18:21:32]~ld
[18:21:32][I][logger:359]: Log initialized
[18:21:32][C][ota:483]: There have been 4 suspected unsuccessful boot attempts.
Progress!
What you want to do now is flash a configuration with fallback AP enabled and captive portal. Make sure you do an esphome compile
to ensure you’ve built a new image for the device.
I recommend downloading a copy of the “out of the box” config from here: https://raw.githubusercontent.com/athom-tech/athom-configs/2438c3f1e4bdd1ac463498fcd93a964e5361d4bc/athom-garage-door.yaml
and flashing that to the device which will get it back to out of the box config.
The other thing to try is make sure you have the latest ESPHome (mainly coz I do and I have this opener so I know both work together).
You should be able to get everything you need done with just this command and the YAML file:
esphome run --device=/dev/cu.usbserial-ABSCDMU6 athom-garage-door.yaml
EDIT: The flash damaged message might look scary, but if you’ve been trying to flash and it’s been running out of power, then most likely that’s the cause - flashing got “something” done and then fell over when it hit the current limit.
huh. I was just able to install with the ‘prepare for first use’. Now lests see if I can take the steps that come next.
Eh, doesn’t seem like it. I need to come back to this later. It seems like the initial flash to first use works but thenit goes through the adoption setup and its no longer working. I’m having trouble getting logs from the serial port. Is there a way to capture logs as its plugged in instead of plugging it in and then starting logging?
I’m not sure what you’ve actually flashed. If the initial device setup is working, and then you configure your wifi and it’s not, then most likely it’s just failing to connect to wifi. In this state it should spawn the fallback AP after about 60 seconds.
Probably double check the wifi signal is working properly wherever you’re doing this, and see if you see it comes online?
re: logs - you can just connect to the serial port at the logging baud rate and leave it open while you reboot. It’ll show everything being reported.
I flashed “Prepare for first use” from web.esphome.io
For some reason I see this at the end but it appears to work anyway -
I did esphome clean athom-garage-door.yaml
and then esphome compile athom-garage-door.yaml
. This creates a directory of files and I assume firmware.bin
is the file I want.
Its on my network but Home Assistant doesn’t see it so I’m trying to connect to the device over wifi to do an OTA flash. It only gets a couple of percent through before the device apparently resets.
re: logs - you can just connect to the serial port at the logging baud rate and leave it open while you reboot. It’ll show everything being reported.
I could use some specific directions on this. Haven’t been able to figure it out myself.
I keep seeing this in the logs - Reading failed: BAD_INDICATOR errno=11
I know it has something to do with encryption between the device and esphome but its unclear to me what actions to take to fix it.
While it seems I can somewhat reliably return to the ‘Prepare for First Use’ setup, I’m having trouble taking steps after that. Similarly, I’ve had trouble flashing the full featured bin file to the device.
Okay so the command you want is this:
esphome run --device=/dev/cu.usbserial-ABSCDMU6 athom-garage-door.yaml
or if you’ve already compiled, this:
esphome upload --device=/dev/cu.usbserial-ABSCDMU6 athom-garage-door.yaml
when you’re flashing over serial. That will upload the firmware.
This will be as “as from factory” device though, so the current device in ESPHome/Home Assistant won’t be setup correctly for it - what you need to do is delete the current device config files from ESPHome (since the mac addresses/IPs will be the same) so you can set it up again - which is the stage that HA/ESPHome sets up noise encryption (which is likely what’s failing).
But it should be enough to flash the basic athom config, then you can connect to the device on port 80 and it’s IP address and see the logs and web UI for controlling it - which will tell you if it’s healthy.
➜ esphome esphome upload --device=/dev/cu.usbserial-ABSCDMU6 athom-garage-door.yaml
INFO ESPHome 2024.2.0
INFO Reading configuration athom-garage-door.yaml...
WARNING Found '${friendly_name} WiFi Signal' (see sensor->1->name) which looks like a substitution, but 'friendly_name' was not declared
WARNING Found '${friendly_name} WiFi Signal' (see sensor->1->name) which looks like a substitution, but 'friendly_name' was not declared
/Users/---/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
warnings.warn(
INFO Detected timezone 'America/Chicago'
esptool.py v4.7.0
Serial port /dev/cu.usbserial-ABSCDMU6
Connecting....
Chip is ESP8285H16
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: e0:98:06:f9:a6:09
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 2MB
Flash will be erased from 0x00000000 to 0x0007afff...
Flash params set to 0x0330
Compressed 499952 bytes to 340708...
Writing at 0x00075332... (100 %)ERROR Running command failed: Serial data stream stopped: Possible serial noise or corruption.
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/cu.usbserial-ABSCDMU6 --chip esp8266 write_flash -z --flash_size detect 0x0 /Users/---/esphome/.esphome/build/athom-garage-door/.pioenvs/athom-garage-door/firmware.bin locally.
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
esptool.py v4.7.0
Serial port /dev/cu.usbserial-ABSCDMU6
Connecting......................................
ERROR Running command failed: Failed to connect to ESP8266: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/cu.usbserial-ABSCDMU6 --chip esp8266 write_flash -z --flash_size detect 0x0 /Users/---/esphome/.esphome/build/athom-garage-door/.pioenvs/athom-garage-door/firmware.bin locally.
➜ esphome esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/cu.usbserial-ABSCDMU6 --chip esp8266 write_flash -z --flash_size detect 0x0 /Users/---/esphome/.esphome/build/athom-garage-door/.pioenvs/athom-garage-door/firmware.bin
esptool.py v4.7.0
Serial port /dev/cu.usbserial-ABSCDMU6
Connecting....
Chip is ESP8285H16
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: e0:98:06:f9:a6:09
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash will be erased from 0x00000000 to 0x0007afff...
Flash params set to 0x0330
Compressed 499952 bytes to 340708...
Writing at 0x00075332... (100 %)
A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
…it fails. Its boot looping like it was before.
At this point I can’t help but wonder if a portion of the flash memory is broken in such a way that the simple flash works but not the more complex.
It is weird it’s getting to 100% though before failing.
Maybe try doing a full erase_flash
operation and see if that works? If there’s a flash memory problem with the chip, that should reveal it:
esptool.py --port /dev/cu.usbserial-ABSCDMU6 erase_flash
If that works then try a reflash again.
The other thing to do is just double check all your wire connections are actually solid: I’ve had some very funky results with serial flashing that turned out to be a marginal connection.