-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F/w v0.4 stops responding after 5-10 minutes #12
Comments
Version 0.4 has the latest changes incorporated then to official HomeKit framework. I attach here a firmware with debug enabled, so, you can verbose logs to put here when device doesn't respond. |
Sorry for the delay. Just uploaded a debug firmware to Sonoff basic. |
The device works great and instantly so far. This debug binary is somehow more stable. 🥇 |
Please, describe, how to collect debug info. That would be useful for others too. A new Wiki page mbe.. I also suggest running some tiny web GUI, where these logs could be viewed and downloaded remotely. |
By the way, Wiki tells to flash 8m, but actual Sonoff flash is 1m, could it cause out of space crashes? I’m moving to Tasmota+HomeBridge: extra layer, but it’s rock stable. |
From the beginning, Wiki tells you how to get UART output: https://github.com/RavenSystem/esp-homekit-devices/wiki/Build-instructions Run another web server is not possible due to low RAM available. Wiki tells to flash 8m... yes, 8m = 8megabits = 1MegaByte. Actual Sonoff flash is 8megabits. |
Thanks. I've heard around, that TLS itself eats more resources than a web server. |
You can monitor output with Arduino IDE. You must select the correct TTYPort and set speed to 115200. |
Hello, I am having the exact same issue as @i3laze. I flashed my v1.6 Sonoff Basic with v0.4 binary build via macOS terminal esptool.py. Everything works great after the setup for a couple of minutes, but then it simply stops responding and shows "No Response" at the Home app. Moreover, I also noticed that in addition to not responding the wifi "Sonoff-24E181" becomes available, but nothing happens when I connect to it. Finally, the 10 second reset helps, but after setup and working perfectly fine for 10 minutes or so, it crashes again. I would be more than happy to provide debug information so that this could be fixed. I would truly appreciate if someone could please let me know how to collect debug information via macOS. Thanks, |
Alright, so what I now flashed the Sonoff Basic once more - this time with the Sonoff_Basic_debug.bin. I can confirm that the issue persists, but it is a bit different. Here are the steps:
I am ready to provide logs so this can be fixed, hence I would truly appreciate if someone could please provide step-by-step instructions about how to read the log from the sonoff (I suppose there is a log in there because it runs Sonoff_Basic_debug.bin). Thanks! |
Can you try the Sonoff S20 firmware and tell results? Don't worry about model; you can use it with Sonoff Basic. |
@RavenSystem - I just now successfully flashed the Sonoff Basic with Sonoff_S20_Button_v0.4.bin. After connecting the Sonoff Basic to 230V the Sonoff Wifi appeared and I was able to select the wifi and enter password. Then, in the Home app on my iPhone I saw the Sonoff, entered the code and started waiting for setup to finish "Adding Sonoff 24E181". Unfortunately, it never did finish the setup and then simply showed "Couldn't add Sonoff 24E181". I pressed the physical Sonoff Basic for 10 seconds, but nothing is happening - the Sonoff Wifi does not show up. I guess I have bricked the Sonoff Basic. Perhaps re-flashing will help. Suggestions are welcome. Thanks |
@reinisb erase flash ( |
@RavenSystem I already erased flash before flashing with Sonoff_S20_Button_v0.4.bin. |
@RavenSystem - I removed the old Sonoff Basic device from Home app, then erased flash from Sonoff Basic, and in the end re-flashed the Sonoff Basic with the Sonoff_S20_Button_v0.4.bin. Now everything is working perfectly fine - I managed to successfully select wifi/enter password as well as complete the setup at the Home app (this time the icon of the Sonoff Basic during setup was a round purple thing - I guess it is because of the Sonoff_S20_Button_v0.4.bin binary). Bottom line - flashing Sonoff Basic v1.6 with Sonoff_S20_Button_v0.4.bin binary works perfectly fine. I will report back if issues arise. If I don't report back, then assume that there are no issues. Thanks! |
Update: Alright, 10 minutes past and again there is "No Response" in the Home app and the "Sonoff-24E181" wifi is again showing up - I guess the sonoff somehow automatically hard reset itself and entered "AP mode to setup wifi again". So the Sonoff_S20_Button_v0.4.bin did not help. Can someone else reproduce the issue? What else can I try? |
@RavenSystem In the General user manual it states "If configured wifi network is unreachable, device will enter in AP mode to setup wifi again." Could it be that the sonoff simply stops seeing my wifi network? I am using a brand new Netgear R7000P router and the sonoff is located 2 meters from the router - perhaps I need to change a setting in the router? |
It could be anything, but I had the same symptoms with three different models of routers. So, it’s not on AP side. I had no time to troubleshoot the issue, so I moved to Tasmota+HomeBridge. Maybe you’ll finish the bug hunt. |
@i3laze - I appreciate the input. Good to hear that it is not issue of the router. I am fully committed to finish the bug hunt. @RavenSystem - I can erase flash, then reflash with Sonoff_Basic_DEBUG.bin.zip, then reproduce the issue. The question is - how can I read the output to paste it here? I see that there is a command to read UART outpot at the Build instructions page, but as I have not done any of the six steps and don't know the <device_name> I cannot perform the command (I am using stock Terminal on macOS High Sierra, hence I don't know if it makes sense to do those commands in the first place.). Is it perhaps possible to read the UART output via esptool.py? They have some basic comands as well as advanced commands. Would any of these commands allow me to read the debug output? (Sorry, I know that I do not posses required technical knowledge to figure this out by myself). |
Alright, I managed to read the output. I erased flash, then reflashed with Sonoff_Basic_DEBUG.bin.zip, completed the setup, and waited until Sonoff Basic would not respond anymore and enter the AP mode (I took only a minute - I simply turned Sonoff Basic on and off via the Home app around five times until it stopped responding). Then, I unplugged Sonoff Basic from mains (230v) and without entering the flash mode I simply plugged the TTL adapter with sonoff attached to it into my mac's USB port and run screen /dev/tty.usbserial-FT1BN31F 115200 in Terminal. Here is the output from Terminal. I do not understand it hence I am looking forward to feedback! |
@reinisb good job, but the problem is that necessary logs must be taken when Sonoff fails, not then. Can you reproduce the issue when Sonoff is only connected to your TTL adapter? |
@RavenSystem - oh alright, I did not know that it is actually possible to operate the Sonoff Basic while being powered by TTL adapter's 3.3V (aka without mains 230v) - somehow I had not thought about this. Anyway, I erased flash and reflashed the Sonoff Basic once more with the debug binary and managed to get it set up and working while being powered by the TTL adapter. Now, whenever I press the on/off button via the Home app or physically on the Sonoff then I see real-time output in Terminal, which is pretty cool. The strange thing however is that while the Sonoff Basic is powered by TTL everything is working perfectly fine - I have pressed the on/off buttons via the Home app and physically hundreds of times over an hour period and everything is working perfectly. I cannot get it to crash (hence there is no crash info to report here from the output log)! However, when I disconnect the TTL cable and connect the Sonoff Basic to mains power (230v) and then switch it on and off multiple times, then it crashes and enters the AP mode in a couple of minutes time. What is more, I repeated the same process with other Sonoff Basics that I have and the same happens with those as well - so my Sonoff Basic is not faulty. To sum up - at this point in time it seems that the Sonoff Basic is crashing (aka entering AP mode) only when powered from mains 230v, but working perfectly fine when powered from TTL. Do you have any ideas why this might be happening? Can you reproduce this with your Sonoff Basic? Thanks! |
@reinisb The issue is caused by an AC interference. It’s a common problem that happens with some people. Personally, I haven’t that issue, and actually I use 3 Sonoff TH and 1 Sonoff S20. I’m working on an universal Sonoff firmware and I hope that I can implement a low pass filter to avoid AC interferences. If you want, you can help me to test it, because your Sonoff only works for a few minutes, and it would be very fast to check the AC interf. I can not test it because I can not reproduce it. |
@RavenSystem - oh, I see! I could definitely help you by testing it! Just let me know when a new build is available! PS This means that the tasmota firmware includes the low pass filter to avoid interference, right? cc @i3laze |
I’ve heard that AC filtering is just about false state triggers by AC... Anyway, maximkulkin has that pulled into master recently: |
@i3laze AC filtering is just about false triggers, but here devices will run out of work because a false trigger activates the reset settings. Pulled mentioned is not a good approach because it uses a task that constantly reads GPIO states using an endless loop, meaning that a lot of resources are used, and this way is not recommended by esp-open-rtos nor espressif. |
I flashed one of my Sonoff Basics with Tasmota and I can confirm that there is no interference when Sonoff is powered from mains AC 230v and that it is working perfectly fine. Perhaps it is possible to borrow some chunks of code/logic from Tasmota. Still, I would prefer to use "esp-homekit-devices" hence I am willing to help and test future builds for interference. |
I would also prefer autonomous stable HomeKit build too for my 3 Sonoffs over current rock-stable Tasmota + HomeBridge (which rely on PC running). So, if issue reveals itself only on AC mains, we agreed it is lack of filtering, yeap? |
@reinisb please, try this firmware when you can. |
@RavenSystem - thanks! I just now successfully flashed my Sonoff basic with Sonoff_Basic_0.4.1beta.bin.zip and set it up via Home app. Now, I will test it and report back with results. Fingers crossed! |
@RavenSystem after two days of thorough testing I can confirm that the Sonoff_Basic_0.4.1beta.bin has been stable and the main issue of it going into the AP mode have been resolved. Thanks for that! That being said, I have experienced another issue ~30% of the times when I open the iOS Home app. I think that we have all experienced the situation when opening the iOS Home app will display some/all devices with status "No response". The "No response" status then either goes away by itself after a couple of seconds or when the respective device icon is pressed. Well, in the case of Sonoff Basic running Sonoff_Basic_0.4.1beta.bin the status "No response" will be shown for some loooong 5-40 seconds during which it is not possible to turn the Sonoff Basic on/off. See the attached video zip where I managed to capture it happening. The Sonoff Basic running Sonoff_Basic_0.4.1beta.bin is "Living Room Switch". Two other devices as running on Homebridge and one is a Homekit certified Koogeek wall switch. As I wrote this is happening in 30% of the times when I open the iOS Home app. Any ideas? |
@reinisb Mmm... Maybe the slow response of Sonoff is caused by the low pass filter task used in GPIO14. I don't know if you use GPIO14; this is used to connect an external wall mount switch. 0.4.1 beta has 2 changes:
This new firmware 0.4.2 beta disables GPIO14 and low pass filter task, so you can test it: The idea is to check if low pass filter task is using a lot of CPU and causing your Sonoff responses slow. |
@RavenSystem - alright, thanks. I just now succesffully flashed my Sonoff Basic with Sonoff_Basic_0.4.2beta.bin and set it up in iOS Home app. I will now test it and report back with results. PS I do not use GPIO14, however I am planning to use is at some point in the future (in a year or so). |
@reinisb well, the idea is to keep GPIO14 working finally. One question, what is your DTIM value of your Wifi AP settings? |
@RavenSystem My Netgear R7000P router does not show (and thus does not allow changing) the DTIM value. See the screenshot below. Moreover, I guess the hidden DTIM value works fine for my other homekit devices. |
@reinisb Ok. I asked only because in my case (talking about certified HomeKit devices, not Sonoff) I don't have the initial "not response"; when I open Home.app, all my certified devices responses immediately without any delay time, and this is because I set DTIM to 1 (repeat, in my case). |
@reinisb Another firmware to test. After testing 0.4.2beta, here is 0.4.3beta, that enables GPIO14 but with an interval of 50 milisecs instead 10 of 0.4.1beta. |
@RavenSystem About DTIM. To make matters more clear, 95% of the times my other homekit devices do not show the "No response". Thus I think that my router is behaving correctly. Actually, when thinking about it, I think that the other homekit devices will show the "No response" right after I have enabled WiFi on my iPhone, which is actually expected and normal. However, Sonoff behaves differently - it will show "No response" when WiFi has been on for a long time and other devices are working perfectly fine. Moreover, after testing Sonoff_Basic_0.4.2beta.bin I can confirm that the issue still persists - the Sonoff Basic frequently shows "No response" - sometimes for 10-40 seconds, sometimes for minutes, sometime will only become live only after turn WiFi on/off on my iPhone. I will now flash with Sonoff_Basic_0.4.3beta.bin and report back with results. |
In case you got Mac around, I would suggest using a free network sniffer Charles, which is quite easy to set up to log timing and decode SSL dialog between iPhone/iPad running Home.app and Sonoff. |
@reinisb Ok, I thought that your delay with certified devices happened always. Well, with your info, I can confirm that AC interference is not reseting Sonoff and GPIO14 works with the low pass filter task. Next, when you test 0.4.3 beta, test it connected only to USB too, and try to reproduce the "no response" delay. |
@RavenSystem - I have been testing Sonoff_Basic_0.4.3beta.bin while having the sonoff basic connected to my computer via USB and I cannot seem to reproduce the issue of it "Not responding". The issue happened once, but I cannot reproduce it. I will be away for the weekend, so I will continue testing on Monday to put here more systematic results. |
@RavenSystem I may have the same issue. My sonoff drops out seconds after turning it on and also when pressing the iOS switch multiple times. Sometimes I get a steady green light (sometimes for hours) until I shut off the mains. I think it’s related to the ac-interferences. I have 3 units in use, all having problems sometimes but only one of them has issues on a daily basis. Do you have a theory or can I help out by doing some testing? Thx in advance. |
@phlexx Ok. The best way to avoid interferences is with a hardware filter like this: I'm working on a new firmware that can be used in several Sonoff models, with some customizable options and Internet OTA updates, to avoid disassembling for wired flashing. If you want, you can flash Sonoff_Basic_0.4.3beta.bin and test it. |
@RavenSystem - Thx for the infos. The problem child does funny things:
it didnt drop out the network yet. (yay!) Sorry for all my questions and thanks for your time! :) |
Because ac-interference.
You must press and hold built-in button until you see led turn on for a couple of seconds. Then, you must configure your wifi settings again and HomeKit. But hard-resetting it will not help. It's necessary to improve low pass filter. Soon I will release a new firmware for Sonoff (An initial version), with OTA updates and custom setup. |
Hi, I had the problem as described in the title of this issue. I used the latest beta (0.4.3) and now it is connected stable for more that a week. What is the difference between firmware 0.4.3 and Ravencore 0.1.0 ? All the best! |
Sonoff RavenCore has a lot of enhancements. Others firmwares are unsupported. |
Overall user experince for your build (and wifi pairing screen) is awesome! Exactly how Sonoff should have been HomeKit-compatible out of the box.
Thanks for your efforts!
I've used binary v0.4 build for my v1.6 Sonoff Basic.
By the way, it didn't flash the first time. Seems, erasing flash was a mandatory step I missed.
So.. after several minutes of working just great.. HomeKit.app starts telling me "No response" for my Sonoff Basic, although I continue to ping the device fine.
Resetting AC power doesn't help. Only 10 sec factory reset and re-pairing helps.. for half an hour.
I'm currently on Windows and can't build from source.
Could you please publish a fresh binary with official esp-homekit lib?
The text was updated successfully, but these errors were encountered: