yup. Good point. Completely missed that requirement. Duh.
Nevermindā¦
yup. Good point. Completely missed that requirement. Duh.
Nevermindā¦
It got the samen problem with a Sonoff basic R2. When i flash it wit Espflasher and reboot the sonoff the log in Espflasher stays empty. I see that it is connected ro my route, but refuses to talk to HA.
Posting my fix for anyone else.
I got the problem where after trying to update it through OTA it would just be stuck in a wifi connect loop.
I fixed this by removing captive_portal
and ap
and this seems to fix it. as suggest in this thread. Now i can update it and it does not go into a wifi connect loop afterwards.
Hi @DurgNomis-drol. @stevemann posted that same solution earlier in the thread, and Iām glad to hear that it works for some folks.
However, in my case, my yaml files never included the code for captive portals or aps, and the problem still persists.
Okay, then your issue is probably (at least slightly) different from the issue discussed in the GitHub topic. It might be a memory issue ā Iāve seen more reports about that lately, though I havenāt been able to point down what causes it. The good news is that Iāve got memory usage down about 20% for the upcoming v1.21 release next week, with another 20% on the way (depending on which integrations you use).
However, itās impossible to say for certain whatās causing your issues and what will resolve it until we can have a look at your serial logs.
Hi @oxan, congratulations on achieving a 20% shrink! Thank you for your work on ESPHome.
Iām going to be brave and see if I can work out how to get serial logs.
Iām following this thread from the beginning, very interesting. I have one Sonoff R2 as well, and it i giving me some headaches, too.
But that wasnāt the point of my answer. @DeeBeeKay You can get the serial log, with the tool youāre flashing your device. Iām assuming you used some kind of USB-to-serial adapter to flash your Sonoff on the bench. These tools have a log button, thatās what oxan is after.
How do you flash your devices without OTA?
Hi @paddy0174, I mostly use OTA. For the first flash, because I am running ESPHome as an add-on in Home Assistant, I compile the binary on the Raspberry Pi 4 that hosts my HA instance. I download the binary through Firefox on my desktop computer, and flash the Sonoff (or whatever) with an FTDI interface.
So what I now need to do is plug the FTDI into the Pi4, and see if I can get some serial logs. Iām not sure how the Pi4 will know which of my ESPHome devices is plugged into the USB, but Iāll jump off that bridge when I come to it.
Nope, no need to connect it to the rPi4. Use your desktop computer, as you do now, and just get the logs there.
What is the FTDI interface you are using? ESPHome-Flasher?
If you wouldnāt mind, just use ESPHome-Flasher, there is a log button right under āFlash ESPā and this getās you the logs you need.
EDIT: Canāt find a better picture, sorry. Take a look here, you see the āView Logsā button:
Hi @paddy0174, please ignore the DM I just sent you, I sent it before I read your reply here.
I just flashed a normally-working Sonoff with the ESPHome-Flasher tool you linked me to. However, it did not display any serial logs at all. I think the reason for this is that Sonoffs need to be power cycled after a flash.
I tried to get around this by disconnecting just the power pin and reconnecting it, and all I got was this:
[12:10:49]rd[I][logger:170]: Log initialized
[12:11:20][C][ota:378]: There have been 0 suspected unsuccessful boot attempts.
This is from a device that doesnāt have the problem and uses the default DEBUG logging. Surely there should be more data? What am I doing wrong?
OK, Iāll ignore your DM (already read it, but āpsssstā ).
I have to admit, itās been a long time since Iāve done this, but this sounds not right, a little more info should be available.
Give me some time, Iāll try it with one of my own Sonoffs when I get back home tonight (could be a little later, right now itās 3pm in Germany and I have to attend a birthday dinner tonight ), and Iāll see what my Sonoffs report.
Just as a safety precaution, youāre not running this Sonoff directly from your power line, are you? What I mean is the 110V/230V line. That would be very dangerous, please donāt do this (I donāt think so, but just to be sure!). While flashing and checking logs it must only be connected to the FTDI, not the power line!
Iām stupid about a lot of things, but not that stupid.
@DeeBeeKay, If youāve got the device connected to a Windows PC with an FTDI interface, then itās pretty easy using the PuTTY terminal emulator program. Open PuTTY, specify a SERIAL connection, select your appropriate COMx: port, set the baud rate to 115200, and let her rip. If youāre fortunate enough to have a reboot/reset switch on the ESP8266, that helps you obtain output from the very earliest stages. Now, if you want to capture those logs to a text file, PuTTY will do that for you, as well.
Hi @FredTheFrog, thanks for that description of the process.
Note that I am trying this with a working Sonoff, to get the procedure down before pulling a version 1 out of the wall.
I followed your procedure, and used Putty to connect to the Sonoff over COM3 (which is what the FTDI interface is). Initially it produced nothing, so I reset the Sonoff by disconnecting the VCC pin and reconnecting it. I did then get some output over the serial connection, but it is virtually identical to what I got using the ESPHome-Flasher tool. Specifically, this:
[I][logger:170]: Log initialized
[C][ota:378]: There have been 0 suspected unsuccessful boot attempts.
Is that normal?
What is logger level set to?
logger:
level: VERBOSE
Yes, that is pretty much normal. Depending on your device and its lowest level boot code, you may see a few registers and a boot
/reset message before that ESPHome output. Not ordinarily useful, but interesting and definitely useful when the device is failing to boot properly.
Thatās about right. If everything is operating properly, the log output you get is mostly the same as what you get over the network (and it might not be that much when the device is running). However, when the device crashes, there should be a lot more information printed over the serial output.
The OTA message about unsuccessful boot attempts is normal.
Very oddā¦ran into the same thing. Flashing a magichome LED controller and no logs, no wifi connection, seemed dead in the waterā¦until I set the log level to INFO. Thank you for figuring this out!
Hi @oxan,
OK, hereās my plan of action. Iām going to first run the new update to get ESPHome 2021.8.0. Then Iām going to do an OTA flash of one of the Sonoffs that I know had this problem, first editing the yaml to restore the logger to its default DEBUG level.
If it fails to connect to WiFi after the update, Iāll go fetch it out of the wall (itās easy to get to, just inside a light switch), plug it into the FTDI, and report back what the log says.
Here goes.
Iām sorry I havenāt reported back for so long, there have been some real life crises to deal with that have prevented my following up on this.
The node I am trying to flash OTA is riiiiight on the edge of my WiFi coverage, and the pipe keeps breaking when I attempt to do the update. Tomorrow I will pull it out of the wall and flash it manually. Sorry to keep you all waiting.