My ESP32 (esp32: board: esp32dev) disconnected from the wifi router few times a day for few seconds. I did set fix IP and disabled power save mode. It improved and the connection is very stable but it is still disconnecting for no reason . it looks that it reboots itself. wifi signal in around -49dbm
Is there any code i can add to prevent disconnections? Any idea why this could happens
thank you
Having said that, your issue might be interference from some other source. I used to see disconnects on my ESP every time I turned on my PS4. It took me a while to realise, so keep an eye out for the disconnection patterns and check whether they coincide with any other devices turning on/connecting to wifi.
Wow I lot of good suggestions and ideas thank you all.
I have two identical ESP32 reading temperatures of my hotwater tank. they are closed together, one in a nice plastic box and one without the box. The one inside the box measure -70dbm and was disconnecting all the time, the one without the plastic box is -49dbm and very stable. So I removed the box and both read ~-48dbm, and very stable.
Im going to add the uptime sensor to confirm whether the ESP actually reboots.
3)also I’ll add this code ```
fast_connect: true , output_power: 20.4 dB, power_save_mode: none
I'm not sure what the 20.4db means...
4) I think it might be some sort of interference as both ESP disconnects almost at the same time. I 'll check what happens in the utility room at that time.
5) these short disconnections are ok , I can live with them it's just that I want to learn more about the reasons and how to troubleshoot or maybe i missing something in the config, even is it's a normal behavior i'd like to know. I ordered one ESP32 version with an external wifi antena to test if it makes any difference. But yes, I can live with it.
6) power supply--- I am using one little block of apple's phone I think it is 1Amp should the ESP need more than 1Amp PowerSupply?
7) where should I get the log? is it in the ESPHome -- ? or the logs from the ESP32 device?the life log does not show much and it will be hard to catch it when it disconnects because i can't read the logs when its lost .. so I'm not sure..
Thank you very much
I just went through similar testing with bluetooth_proxy. Originally I had the ESPHome device in my electronics cab … of course that is easiest.
But it would stay connected for about 30 seconds and at first refresh disconnect and after a while of course show everything away. Never came back. The only way I could get it back was to reload the configuration and that would repeat.
So I tried a new charger block, new cable … same.
So I moved it to another location next to my computer to do some things and essentially stare at it (glare really).
Better, but still not right. It could last 3 or maybe four scans and then one of the connected devices failed, then another, then the last and reload was required.
So I thought … what if I move it to somewhere there is possible interference?
I moved the block and device way WAY WAY away from anything else. No electronics whatsoever. Nada.
It works now. Still a few glitches where status is not updated.
It just solidified to me that Bluetooth sucks, anyone using it shouldn’t unless you have to.
Yes well. It all depends on what you are trying to do. For me, it is tracker tags on dogs. Especially when they leave the area near the house/winery and “wander” off.
On 42 acres in the hills of California there is very little infrastructure. We have Starlink at house/winery and 4G/5G internet at the gate which is over 1/2 mile away. The dogs wander the driveway to the gate and sometimes go outside the gate. At the gate I have HA Green, a cellular modem and several other controllers in a box that must be weather proof (open gate, turn on lights, cameras).
Goal = pick up if any dog enters that gate area and notify me.
I will likely have to run special power just for it to separate it away from all other (weatherproofed) equipment.
OR … buy a real GPS system but hanging those on a small dog is ridiculous.
I also love that comment as it speaks to people that actually know everything about what they are doing. Comment:
You can set interval equal to window …
Where?
Where is that YAML placed? Is it placed in Home Assistant? Is it placed in the code before you compile ESPHome? What if you installed using the default ESPHome BLE Tracker? If so, how do you change it afterwards? What if that code does not actually even expose the Web ESPHome API (aka Bluetooth)? And what if you have HA Core and not an installation that have add-ons?
All of these comments are missing from every single ESPHome integration I read. No one tells you where the YAML should be. No one has thought through all installations and what to do afterwards. You are expecting a super, qualified, programmer/hacker … no product will succeed with that mentality.
After an hour or so, no dogs left anywhere but they are unvavailable or Away. One is not true simply put, not ever been away and not away. The other well equipment is likely unavailable, again it just cannot do bluetooth and wireless at same time. And during all that testing, the dogs have been sitting next to me. Sleeping actually.
The documentation Spiro hinted at is from esphome, so the example timing settings would go in the yaml for the esp. But the point was NOT to use the settings. If you read both the docs and this comment below, it basically says the same as you: Wifi and bluetooth are a difficult combination on an esp.
That is because they do time sharing on the same radio. So changing timings on the bluetooth communication will affect wifi and vice versa. That is why the quoted documentation advises to go for an Ethernet ESP if you can. The timings settings shown would hurt your cause because they are for ethernet, not for wifi. For wifi it says to not use timings other than the default.
Your post shows a lot of frustration. Please try not direct the frustration of not getting the ESP to work at the people trying to help you. We get the frustration, but we are not the cause. Plus ESP’s are technical stuff. ESPHome makes it as easy as possible to write firmware, but you are programming nontheless, and that comes with its own challenges. Usually things work quite well, but there are many things that can go wrong too.
What you (and the OP too) failed to do was provide us with the yaml you use for the esp. As said, without it we are only guessing. So please post your yaml.
Yes frustration is right. And to the point of what I said … what YAML should I post?
I plugged in an ESP and clicked a link on ESPHome website to flash the standard Bluetooth Proxy to the card. Please tell me what YAML to post for you.
I do not see any YAML here nor anyway to change it and do something else. Or better said I see the YAML I assume it uses in Github but which one I do not know and no way to change anything anyway unless you install different I guess than a “ready made” project.
I mentioned the yaml for the esp. I did not know you used a pre-built one, but these too have a yaml file. This is all new information you did not give before. That is frustrating for me too. It is exactly why I linked you to the “Help us help you” page. Tell us what you did, tell us what you used, …
You say the standard one, do you mean you selected the generic variant from that page (there are three standard prebuilt ones, seven if you followed the link to Github)?
It says on the same page: “This option only works for “plain” ESP32 and not for ESP32-C3 or other variants.”. What type of esp did you use? And what version of the ESP firmware does it mention here:
Ah … as I have a core installation there are no add-ons. So as far as I know, I cannot do anything of that sort. Which continues the question as I said, how can someone change anything?
Sounds to me like this …
You need a different installation method than just Core to get Addons to access this.
You could use the web GUI to the device, but that is not enabled in the default install
So essentially you options are (a) use a different installation and not just Core or (b) rebuild the flash software to enable some web GUI (although I have no idea if that would do what I want).
I would guess your link here Getting Started with the ESPHome Command Line — ESPHome is what I want to do. But personally this is exactly why I posted what I said. Even those directions are written for a programmer, there is nothing “ready-made” here … not to be rude as you have pointed out frustrations and such, but it is far from “ready-made” and more “half-baked”.