[go: nahoru, domu]

MQTT

ESP8266 wifi connection speed optimization

It’s been a while since I initially looked into what it takes to make an optimal wifi connection with an Espressif ESP8266 / ESP-01 (old post). Using the code from the old post didn’t work … anymore? What the heck. So much for rolling out another kind of battery-powered ESP8266 device. Time to dig into what goes on with the wifi connection timing. The code is on Github. Most of this post is from the readme file there.

Boot, connect to wifi, server requests in under 1 second with ESP-01

Making a hardware button that connects to wifi and sends a request off to a server is possible using Arduino. Light switches are (almost) immediate – but simple wifi switches easily take 8-10 seconds to connect & switch. How do you get that time down? Here’s my approach. Measure end-to-end - what’s the default time? Is it really that bad, or just sometimes bad? Split into parts Measure the parts Determine which parts should be optimized, and try options Combine the best options Debug why it doesn’t work and try again The computer we’re using to run on is an ESP8266, model ESP-01.

Setting up MQTT with Auto-Discovery on Home Assistant (settings)

After you’ve installed things for MQTT in Home Assistant, it’s time to make some settings. 1. Enable debug logs. I don’t actually have much insight into what this does, but whatever. It sounds good. I did it. It didn’t hurt. In the configuration.yaml file (see previous post for information on how to edit files), add: logger: default: warning logs: homeassistant.components.mqtt: debug … and then reload the settings by restarting. Configuration -> Server Controls -> Check Configuration.

Setting up MQTT with Auto-Discovery on Home Assistant (software setup)

MQTT on Home Assistant is one of the most annoying things to figure out. The documentation is extremely minimal, their forum is filled with links to the documentation when people ask about not being able to understand the documentation. I’m keeping notes & warnings here. There are a few elements of MQTT that are important for this. You might already have some of this set up, if you followed some general Home Assistant getting started guides.