Apart from your bad quoting, the error is outputs:
should be output:
I was finally able to get this to work…
[16:41:14][C][wifi:504]: WiFi:
[16:41:14][C][wifi:362]: Local MAC: 48:27:E2:46:F7:E0
[16:41:14][C][wifi:363]: SSID: [redacted]
[16:41:14][C][wifi:364]: IP Address: 192.168.1.173
[16:41:14][C][wifi:366]: BSSID: [redacted]
[16:41:14][C][wifi:367]: Hostname: 'esp32-test'
[16:41:14][C][wifi:369]: Signal strength: -48 dB ▂▄▆█
[16:41:14][C][wifi:373]: Channel: 11
[16:41:14][C][wifi:374]: Subnet: 255.255.255.0
[16:41:14][C][wifi:375]: Gateway: 192.168.1.1
[16:41:14][C][wifi:376]: DNS1: 192.168.1.1
[16:41:14][C][wifi:377]: DNS2: 0.0.0.0
[16:41:14][C][logger:293]: Logger:
[16:41:14][C][logger:294]: Level: DEBUG
[16:41:14][C][logger:295]: Log Baud Rate: 115200
[16:41:14][C][logger:296]: Hardware UART: UART0
[16:41:14][C][captive_portal:088]: Captive Portal:
[16:41:14][C][mdns:103]: mDNS:
[16:41:14][C][mdns:104]: Hostname: esp32-test
[16:41:14][C][ota:093]: Over-The-Air Updates:
[16:41:14][C][ota:094]: Address: esp32-test.local:3232
[16:41:14][W][ota:103]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[16:41:14][C][api:138]: API Server:
[16:41:14][C][api:139]: Address: esp32-test.local:6053
[16:41:14][C][api:143]: Using noise encryption: NO
[16:41:53][D][api:102]: Accepted ::FFFF:192.168.1.250
[16:41:53][D][api.connection:918]: Home Assistant 2023.1.5 (::FFFF:192.168.1.250): Connected successfully
Config:
esphome:
name: esp32-test
esp32:
board: lolin_s2_mini
variant: ESP32S2
framework:
type: arduino
version: 2.0.3
platform_version: 5.0.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-Test Fallback Hotspot"
password: "P2N0HpTgPYZC"
captive_portal:
Connected USB Cable to the server and chose “For devices connected via USB to the Server”
THEN I pressed 0 and then Reset for a few secconds. Let go of both buttons and it then flashed at 115kb (440kb failed).
That process is outlined here: Get started with Arduino [S2 series] — WEMOS documentation
FYI I’m running HA Supervised on plain vanilla Debian 11.
Thank you so much! This also worked for me! Finally!!
I had been interested in trying out the ESP32S2 minis for a while. It’s the same form factor as the wemos D1 mini but faster, more GPIOs, lower power consumption+heat generation. On paper, this board is awesome with no downsides. Well, at least in theory. I’ve had a frustrating weekend trying to get a few of the minis to boot with esphome and be stable for more than 5 minutes without crashing.
Thanks to the tip about the framework versions, I was able to get a sketch uploaded to one of the chips which ran for maybe an hour without crashing. Everytime it crashes, I kept running into the downsides of the integrated USB - no more logs when esphome goes crazy. I’ve finally done more reading up, and this is the stable sketch I have, on esphome 2023.2.3:
esphome:
name: miniweather
friendly_name: Mini Weather Station
# This disables usb logging, but is needed to use native uart https://github.com/esphome/issues/issues/3988
platformio_options:
board_build.extra_flags:
- "-DARDUINO_USB_CDC_ON_BOOT=0"
esp32:
board: lolin_s2_mini
variant: ESP32S2
framework:
type: arduino
version: 2.0.6
platform_version: 5.3.0
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "<insert key>"
ota:
password: !secret ota_pw
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: !secret wifi_domain
power_save_mode: none
fast_connect: True
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Miniweather Fallback Hotspot"
password: !secret fallback_pw
captive_portal:
web_server:
status_led:
pin: 15
switch:
- platform: restart
name: "$friendly_name Restart"
The main thing that brought stability was disabling power_save_mode
for wifi. My target application is mains powered, and I don’t care about power savings in this use case. After setting it, I still see timeouts, but the device quickly reconnects in ~15 seconds. I am running this for 24 hours first to get a baseline, and I’ll try to pare down the cruft from my config to get a minimal working version. With power_save_mode disabled, I was able to get an OTA update working for the first time.
This journey has been very frustrating, and I should probably have looked at this thread first to see that ESP32S2s are finicky. Hopefully, more updates to esphome will bring more stability.
I finally got my Wemos ESP32-S2 Mini’s to program.
TLDR: use 0x0
not 0x010000
in the esptool
programming command for the .bin file.
I couldn’t get any web based tool to work, none would connect, despite different OSs, cables, and browsers.
In the end esptool worked with the 0x0
address instead of 0x010000
. I didn’t modify the yaml file, nor erase or install a bootloader.
So here’s the process, albeit bit verbose:
Create .bin file in ESPhome (i’m using Home Assistant but that shouldn’t matter?)
I selected New Device, gave it a name, and then selected ESP32-S2 for the device, and selected install. – I didn’t modify anything in the auto generated yaml file. (Thought look at has_hass’s comments on low power modes above, as that may impact actual usage experience, I tried that yaml and of course it works too).
Select install and select Manual, and Modern Format. Note where the <Name>-Factory.bin
file ends up.
UART Drivers:
I did install the CP210X drivers. CP210x USB to UART Bridge VCP Drivers - Silicon Labs. However, remember you need to put the device in boot mode (see bottom of post).
Programming tool:
ESPTool:
- Windows 10: Releases · espressif/esptool · GitHub
- MacOS 13.1: (note where
esptool.py
is installed, min was in~/.local/bin
)
pip install --user esptool
To program the device, I only tried these two commands and they each worked. The --chip
might not actually be necessary.
Windows:
esptool -p <COMPORT#> write_flash 0x0 <NAME-factory.bin>
MacOS/Linux:
./esptool.py -- chip esp32-S2 -p < /dev/USB_PORTNAME> write_flash 0x0 <full_filename path>
in Windows, using COM7
and calling the device Wemos, I ran the esptool
from the directory where it extracted and copied the bin file into that directory:
esptool -p COM7 write_flash 0x0 Wemos-factory.bin
in MacOS, the wemos S2 mini was on /dev/cu.usbmodem01
, The bin file download was located in my downloads folder.
esptool.py ---chip esp32-S2 -p /dev/cu.usbmodem01 write_flash 0x0 ~/Downloads/Wemos-factory.bin
In both Windows and MacOS you can find the port name by using the ESPTools (ESP Web Tools). Once in boot mode the ESP32-S2’s port will show up. Note in MacOS only the portname, not the full path (/dev/<PORTNAME>
) will show up.
You need to put the ESP32-S2 into boot mode, by holding both reset and boot (GPIO0
, labelled ‘0’), simultaneously and releasing the reset then the boot button, or alternatively hold the boot button when plugging in the board.
In both cases the programming command above ran without a hitch, I reset the ESP32-S2 and it showed up in ESPHome within 10-15 seconds or so.
Lolin s2 - working! Thanks!
I’ve had uploading working for a while; I use the following:
esp32:
board: lolin_s2_mini
variant: esp32s2
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP_CONSOLE_USB_CDC: y
packages:
base: !include ../base.yaml
logger:
hardware_uart: USB_CDC
This gives logs over the USB connection, and only requires holding down the flash button, hitting reset and then is able to flash.
However, on the one I have that has been running for several months, I get a lockup that results in me having to physically power cycle the device. Unfortunately this is my irrigation system, and one time it crashed while the sprinkler was running, which then ran overnight.
I’m not sure if it’s a hardware fault (I haven’t put a replacement in there yet, or tried a D1 mini), but I’m trying some other devices just running a simple logging loop connected directly to the computer to see if they show anything interesting.
I’ll also try the power_save_mode
trick to see if that makes the problem go away.
Phew I also had some trouble with S2 mini (clones).
First of all I was only able to flash them with esptool to 0x0 and the bin file from ESPHome.
Secondly, they were very instable, especially regarding Wifi.
I am still not sure if everything is fixed now but at least they are now in ESPHome and can be flashed wirelessly.
Here is the configuration I used in the end:
esp32:
board: lolin_s2_mini
variant: ESP32S2
framework:
type: arduino
version: 2.0.6
platform_version: 5.3.0
...
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
output_power: 10
...
status_led:
pin: 15
So I used the framework described in another reply here and for the wifi, I disabled power_save_mode
but also I had to set the output_power
to 10. Not sure what other values do work.
What’s also still strange is that the status_led
is mostly blinking like a warning is there but there is nothing in the log. Sometimes it stops for a few minutes but then start again.
All in all the S2 mini sounds great but in the current state, for me it is not worth the hassle and I will not use it for “production” projects as of now.
Edit: Found about about the flashing status led: This is because I have api enabled but not connected to HA (yet). It stopps also when I am connected to view the logs.
This is the correct answer ! Windows 10 the esp32-2 mini, esphome.exe … Thanks ! i’ve tried tons of solutions, this one worked. The board connects to wifi !
1.install-manual download-modern download;[esphome]
2.Get the *.bin
3.Only upload the *.bin by “flash_download_tool_3.9.4” to 0x00000;
Hello everyone! I’m also trying to connect a Lolin ESP32 S2 to Esphome. I’ve tried all the hints in this chat, but I can’t get a connection. Creating the bin file and flashing it with the Flash Download Tool works well. After uploading the example sketch mentioned here, only the blue LED is flashing…
The ESP does not register in the wifi.
Do you have other ESP boards that CAN connect to HomeAsisstant?
If you do, than try to flash this S2 just with first lines and my board is like this:
esp32:
board: lolin_s2_mini
framework:
type: arduino
This works. Thanks
No matter what I do Lolin ESP32 S2 does not work well and Im sur that is problem with ESPHome. Im trying to get I2S audio working, but sound quality is intermittent and very bad through external DAC.
Other board refused to connect to WiFi at all.
I have flashed the board with Tasmota and it connected to my WiFi no probs, however unfortunately I couldn’t find a way to get mediaPlayer working over Tasmota.
Note
Support for the ESP32-S2 and ESP32-C3 is still in development and there could be issues.
Thanks for your prompt reply, what about ESP32 DEVKIT v1? I used to play media files accessing my https links however since I have updated firmware it’s not possible any more.
That didn’t work for me. The board was no longer booting and didn’t even draw enough power to get warm.
However I have finally found a way that works for me.
I didn’t know about but there actually is a CLI version of ESPHome.
If you have python 3 and pip already installed on your PC, you can just type pip install esphome
to install the esphome cli. If you haven’t python installed on your PC or that does not work, I suggest reading this guide.
Check if it is installed using this command: esphome version
How to flash your Wemos ESP32-S2 mini?
- Make sure you already created your device in ESPHome by selecting the board manually in the list.
- Download the yaml file of the device.
For the board settings I used the following configuration (which got automatically generated when selecting the board):
esp32:
board: lolin_s2_mini
framework:
type: arduino
-
Download your secrets.yaml file (if you use it)
-
Make a folder and put the two yaml files into it
-
Open an terminal in that folder
-
Prepare the command:
esphome run <name of your device.yaml>
Note: For me it didn’t work the first time. I just tried again and it worked. You could also try it withesphome upload <device.yaml>
if run does not work. -
Hold down the boot button of the S2 mini while plugging it in
-
Execute the command. After compiling, the program will ask you which device you want to use. Select your board here. If it does not ask you and directly tries to upload (which will not work if you haven’t managed to flash the board yet), it means it hasn’t detected it. Make sure to hold the boot button, short press the reset button, release the boot button and try again.
-
It should upload the program using esptool. After that my board booted up and connected to WiFi.
That’s the way it worked for me. The web installed only gave me initialisation errors.
If you have managed to install ESPHome this way on the board, you can from now on flash it using the ESPHome page again using the “Wirelessly” option (at least it now works this way for me).
Note: I flashed it on Ubuntu. On Windows it didn’t work for me (but the problem was only that this dumb cmd could not find the esphome command after I installed it with pip…). So it probably works too if you manage to execute the command.
Note: If you get the message “Could not open /dev/xxx, the port doesn’t exist”, execute these commands (only for Linux):
$ sudo adduser <username> dialout
$ sudo chmod a+rw /dev/<device path>
Has anyone managed to keep an S2 mini running for more than a few hours before it goes offline or reboots? If so, please can you share your esp32 and wifi configs and/or anything else that kept it running continuously?
I’ve used several esphome versions, tried the arduino framework (several versions) and esp-idf. I’ve tried power_save_mode: none
and a few different output_power
values. I’ve connected via MQTT and the HA api. I’ve tested two hardware devices, powered via a 3A 5v supply (utilising the on-board 3.3v LDO regulator) and I’m now testing via a dedicated offboard 3.3v supply.
No hardware or software combination I’ve tried over the past 3 months has kept an S2 running reliably for over 12hrs.
My use-case involves environmental monitoring and driving variable speed pumps, fans and valves via PWM. Lately, I’ve found the esp-idf framework better than arduino at quicky rebooting and recovering the S2 when it goes awry (mine is remote) so for me it is just about usable but is not reliable like other ESP32s and ESP8266s I’ve deployed.
It would be great to find out if anyone has found a way to get an uptime of days or weeks on an S2…
Sometimes, you need lots of backup capacitors to have a stable power supply, especially when having motors near. Try a small one in combination with a larger one, I can look up the values I have found to work for me if want me to.
Also try
wifi:
output_power: 10
in the config, that helped me immensely.
(s2_pico instead of s2_mini)
Did you ever come right with your modules?