First time ESPHome flasher here. I was trying to install ESPHome on a Sonoff Mini, but i have messed up the network config in the .yaml file - exchanging static ip with default gateway and not putting wifi SSID and password in apostrophes. So now my sonoff mini is not connecting (obviously), but fallback wifi should still be seen. However its not.
Is there any way how to fix this without serial flashing?
Here’s the relevant parts of my .yaml file:
esphome:
name: sonoff_mini_backyard
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: wifi
password: password
manual_ip:
gateway: 192.168.50.82
subnet: 255.255.255.0
static_ip: 192.168.50.1
#Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: 'Sonoff Mini Back'
password: 'password'
captive_portal:
# Enable web server
web_server:
port: 80
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
That’s exactly it, that I don’t see any SSID. I am thinking that I may be able to create a wifi network where my messed up config would be correct, so I could connect the device correctly.
except that it doesn’t work i have set up a spare router with the same SSID, subnet, set the gateway to 192.168.50.82, disabled my main wifi that has the same ssid, but it still does not connect…
the two reasons I can imagine:
the missing apostrophes around the wifi credential (shouldn’t the yaml validity check in ESPHome catch this?)
enabling the webserver in combination with captive portal messed things up somehow
Nope forget that ! I would try to switch off your main wifi (the one your mini is supposed to connect to), put the Mini on power and then you should see the default fallback IP show up after 2/3 minutes and then be able to flash it with correct firmware
with my wifi disabled the device blinks once. with wifi enabled it blinks twice (which should signalize connection error)
pressing the button switches the relay
holding the button for 5 secs enters some kind of pairing mode - solid light with two blinks (but AP is still not visible)
are there any other tricks with the button that should do something? i have no adapter to perform a serial flash, but it’s on its way from china. will take a couple of weeks until it arrives. I have two more spare Sonoff Mini’s that I can try to brick as well, but rather be sure what I did wrong beforehand
As indicated by @sender you did nothing wrong out of inversing ip of router and ip of device ! For your second try I would remove for test the fixed IP assignment (you can also remove the port 80 in webserver as it’s default so no need to indicate it !
you won’t believe this, but i managed to brick a second sonoff mini, this time with correct IP addresses (forgot to take out of the static IP part as @vincen suggested ).
I still don’t have a USB-COM bridge, but my ESP32 board arrived today (for the record, i was able to flash it with ESPhome without any problems this time). I am planning to use it to collect data from BLE thermometers, but it seems I could use it to flash other devices as well.
My question: with the above connection will the board work as a kind of “USB-COM” passtrough or do i need to create a special firmware for that to work?
Did you configure a action in your esphome yaml when the button is pressed for 5 seconds then? If not you can be 110% sure there is no esphome running (yet) on your device…
It looks like there is a bunch of different sonoff mini’s out there (various hardware and soft/firmware revisions) which are flashed differently with ota.
If you can’t access it in any way by ota you are forced to use the serial method (kind of tricky with this device because it only has tiny solder pads)…
@meneelyt s description was exactly the one i followed, i just couldnt find the link when making my previous post.
I was thinking the 5-sec hold is something hardcoded into the bootloader or something, as i certainly did not configure it (nor the blinking pattern, which exactly matches sonoff’s default behaviour). I will give it a few more tries.
Yeah, soldering will be a pain, especially with my skills and tools
EDIT: ok, turns out i’m stupid. the device is still in DIY mode and the flash did not go trough apparently (despite the 200 response). I think the problem is that my webserver storing the file switches to HTTPS and the OTA flash is not able to handle this. using the exact same flashing method with docker as listed on https://blog.lukaskukacka.com/smarthome/2020/09/09/sonoff-mini-firmware-3.6-flashing-tasmota.html finally worked