mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-14 04:46:49 +00:00
Blog post (#18213)
This commit is contained in:
parent
63720f19d3
commit
cbcfcda579
261
source/_posts/2021-06-16-power-up-your-esp-projects.markdown
Normal file
261
source/_posts/2021-06-16-power-up-your-esp-projects.markdown
Normal file
@ -0,0 +1,261 @@
|
|||||||
|
---
|
||||||
|
title: "Power-up your ESP8266 and ESP32 projects: browser-based installation and configure Wi-Fi via Bluetooth LE"
|
||||||
|
description: "Power-up your ESP8266 and ESP32 projects: browser-based installation, configure Wi-Fi via Bluetooth LE and a renewed ESPHome dashboard!"
|
||||||
|
date: 2021-06-16 00:00:00
|
||||||
|
date_formatted: "June 16, 2021"
|
||||||
|
author: Paulus Schoutsen
|
||||||
|
author_twitter: balloob
|
||||||
|
categories: Announcements
|
||||||
|
og_image: /images/blog/2021-06-power-up-your-esp-projects/social.png
|
||||||
|
---
|
||||||
|
|
||||||
|
ESP8266 and ESP32 are microcontrollers made by the Chinese company Espressif.
|
||||||
|
Microcontrollers are teeny tiny computers with little processor power,
|
||||||
|
memory and space that can interact with sensors, send infrared commands
|
||||||
|
and many other things.
|
||||||
|
|
||||||
|
With the ESP devices Espressif has achieved something formidable: their devices
|
||||||
|
have Wi-Fi, are compatible with code for the popular Arduino microcontroller
|
||||||
|
and they are cheap. Like, $5-including-shipping-from-China-cheap
|
||||||
|
([AliExpress][aliexpress]) or $15 for 2 on [Amazon][amazon] cheap.
|
||||||
|
So cheap that they are the de facto standard for microcontrollers used in
|
||||||
|
IoT products, both for manufacturers and creators in the DIY space.
|
||||||
|
|
||||||
|
<p class='img'>
|
||||||
|
<img
|
||||||
|
src='/images/blog/2021-06-power-up-your-esp-projects/quindor-drzzs-esp32-wled.png'
|
||||||
|
alt='Quindor and DrZzs playing with an ESP32-based QuinLED running WLED'
|
||||||
|
>
|
||||||
|
Quindor and DrZzs playing with an ESP32-based QuinLED running WLED
|
||||||
|
(<a href="https://www.youtube.com/watch?v=lXHQ5iTpCfg" target="_blank">YouTube</a>)
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Microcontrollers are just computers and so are nothing without their software.
|
||||||
|
Open source software like [ESPHome][esphome], [WLED][wled] and
|
||||||
|
[Tasmota][tasmota] allow users to turn their ESP8266 and ESP32 devices into
|
||||||
|
powerful little machines that can gather information and control devices.
|
||||||
|
In your home, microcontrollers are the eyes and ears while Home Assistant
|
||||||
|
is the brain.
|
||||||
|
|
||||||
|
But these projects all have a common problem: it is difficult to get started.
|
||||||
|
We identified three pain points:
|
||||||
|
|
||||||
|
1. Installing the software on the microcontroller.
|
||||||
|
2. Connecting the microcontroller to your wireless network.
|
||||||
|
3. Configure the software on the microcontroller.
|
||||||
|
|
||||||
|
These pain points stand in the way for creators to reach a wider audience. It’s
|
||||||
|
our mission to make local home automation succeed, and these projects,
|
||||||
|
and all the possibilities that they unlock, are an important part of this.
|
||||||
|
|
||||||
|
**Today, we are introducing some things to make using microcontrollers easier.**
|
||||||
|
|
||||||
|
## Using terms everybody understands
|
||||||
|
|
||||||
|
We are going to start using words that a user understands instead of forcing
|
||||||
|
the technical terms on them. Terms like _“firmware”_ and _“flashing”_ are the
|
||||||
|
correct terminology but for inexperienced users they do more harm than good.
|
||||||
|
They will make the user feel uncomfortable before they even start.
|
||||||
|
|
||||||
|
So instead of _“upload firmware”_ we’ve updated the ESPHome dashboard to talk
|
||||||
|
about _“installing”_. We are encouraging other projects to do the same.
|
||||||
|
|
||||||
|
Things will get more technical as a user continues playing with microcontrollers.
|
||||||
|
But this change might just be that little thing why they will actually continue.
|
||||||
|
|
||||||
|
## ESP Web Tools: Installing projects on your microcontroller via the browser
|
||||||
|
|
||||||
|
We have created [ESP Web Tools][esp-web-tools]. ESP Web Tools allows project
|
||||||
|
websites to offer a great onboarding by enabling users to install the software
|
||||||
|
on their microcontrollers via their browser. All the user has to do is connect
|
||||||
|
their microcontroller to their computer and hit the install button on the
|
||||||
|
website. ESP Web Tools will automatically select the right build for your
|
||||||
|
microcontroller and install it.
|
||||||
|
|
||||||
|
This works for both the ESP8266 and ESP32 and with any project for these
|
||||||
|
devices. This technology is powered by Web Serial, a web standard for serial
|
||||||
|
communication that is part of Google Chrome and Microsoft Edge.
|
||||||
|
|
||||||
|
ESP Web Tools Web has already been adopted as part of the onboarding by
|
||||||
|
[WLED][wled] and [ESPEasy][espeasy].
|
||||||
|
|
||||||
|
<div class='videoWrapper'>
|
||||||
|
<iframe
|
||||||
|
width="560"
|
||||||
|
height="315"
|
||||||
|
src="https://www.youtube-nocookie.com/embed/k88BS8zgWq0"
|
||||||
|
frameborder="0"
|
||||||
|
allowfullscreen
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[Learn how to add ESP Web Tools to your website][add-esp-web-tools]
|
||||||
|
|
||||||
|
If you have an ESP32 or ESP8266 device handy, you can try it out right here:
|
||||||
|
|
||||||
|
<center style="margin-bottom: 25px">
|
||||||
|
<script
|
||||||
|
type="module"
|
||||||
|
src="https://unpkg.com/esp-web-tools@3.3.0/dist/web/install-button.js?module"
|
||||||
|
></script><esp-web-install-button
|
||||||
|
manifest="https://esphome.github.io/esp-web-tools/static/firmware_build/manifest.json"
|
||||||
|
></esp-web-install-button>
|
||||||
|
</center>
|
||||||
|
|
||||||
|
ESP Web Tools uses [code][adafruit-esptool] written by
|
||||||
|
[@MakerMelissa][makermelissa] from [Adafruit][adafruit]. We’re currently relying
|
||||||
|
on an enhanced fork that can fit a wider range of use cases, including ours.
|
||||||
|
We have a pull request open to get our changes contributed back.
|
||||||
|
|
||||||
|
[ESP Web Tools website][esp-web-tools]
|
||||||
|
|
||||||
|
_Note: We don’t like to use technology that is not available in all browsers
|
||||||
|
and cannot be made available in other ways. However, in this case the benefits
|
||||||
|
outweigh the cons. We hope that Firefox and WebKit add support for Web Serial
|
||||||
|
in the future._
|
||||||
|
|
||||||
|
## Improv Wi-Fi: Open standard to provision Wi-Fi credentials via Bluetooth Low Energy
|
||||||
|
|
||||||
|
We have created [Improv Wi-Fi][improv]. Improv Wi-Fi is a free and open standard
|
||||||
|
that anyone can use to offer a user-friendly way for users to connect their
|
||||||
|
devices to the wireless network.
|
||||||
|
|
||||||
|
<p class='img'>
|
||||||
|
<img
|
||||||
|
src='/images/improv-logo.svg'
|
||||||
|
alt='Improv Wi-Fi logo'
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
For open source firmware there are two popular ways of getting a device to
|
||||||
|
connect to your wireless network. The device sets up a wireless network and you
|
||||||
|
need to connect to it via your phone or laptop, or the user compiles the
|
||||||
|
network and password into the firmware before installing it on the ESP.
|
||||||
|
Both methods are difficult and error prone, they offer a bad user experience.
|
||||||
|
|
||||||
|
If you look at off-the-shelf products, you see another approach:
|
||||||
|
send Wi-Fi credentials to the device via Bluetooth Low Energy (BLE). BLE allows
|
||||||
|
the user to get instant feedback if something goes wrong. This technology is
|
||||||
|
used in many products, but there is no open standard that is free to implement.
|
||||||
|
Improv Wi-Fi is an open standard that is free to implement.
|
||||||
|
|
||||||
|
Open source projects often host their control interface as a website on the
|
||||||
|
ESP device. Improv Wi-Fi supports this and when provisioning is done, the user
|
||||||
|
can be redirected to a URL to finish onboarding.
|
||||||
|
|
||||||
|
<div class='videoWrapper'>
|
||||||
|
<iframe
|
||||||
|
width="560"
|
||||||
|
height="315"
|
||||||
|
src="https://www.youtube-nocookie.com/embed/AdCsX7Ni6Jc"
|
||||||
|
frameborder="0"
|
||||||
|
allowfullscreen
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Improv Wi-Fi can be used today to provision ESP32 microcontrollers running
|
||||||
|
[ESPHome][esphome] (ESP8266 devices do not support BLE). Users will soon be
|
||||||
|
able to provision devices with the Improv Wi-Fi service via the Home Assistant
|
||||||
|
Android and iOS apps. All these implementations are open source and can be used
|
||||||
|
in your projects.
|
||||||
|
|
||||||
|
Improv Wi-Fi is also available for the web in the form of a button that can be
|
||||||
|
added to your website. This will allow users to configure and set up a device
|
||||||
|
from any browser that supports Web Bluetooth.
|
||||||
|
|
||||||
|
If you’ve used the installation button in the previous section but have not yet
|
||||||
|
connected it to the wireless network, you can onboard that device here:
|
||||||
|
|
||||||
|
<center style="margin-bottom: 25px">
|
||||||
|
<script
|
||||||
|
type="module"
|
||||||
|
src="https://www.improv-wifi.com/sdk-js/launch-button.js"
|
||||||
|
></script><improv-wifi-launch-button></improv-wifi-launch-button>
|
||||||
|
</center>
|
||||||
|
|
||||||
|
[Improv Wi-Fi website][improv]
|
||||||
|
|
||||||
|
## ESPHome Dashboard: simplified and streamlined
|
||||||
|
|
||||||
|
With [ESPHome][esphome] users don’t program microcontrollers, they configure
|
||||||
|
them. Tell ESPHome there is a temperature sensor on pin 3 of your ESP device
|
||||||
|
and ESPHome will install custom software on your ESP device that makes this
|
||||||
|
information available in Home Assistant.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example ESPHome configuration
|
||||||
|
sensor:
|
||||||
|
- platform: dht
|
||||||
|
pin: D2
|
||||||
|
temperature:
|
||||||
|
name: "Living Room Temperature"
|
||||||
|
humidity:
|
||||||
|
name: "Living Room Humidity"
|
||||||
|
update_interval: 60s
|
||||||
|
```
|
||||||
|
|
||||||
|
<p class='img'>
|
||||||
|
<img
|
||||||
|
src='/images/blog/2021-06-power-up-your-esp-projects/dht22.png'
|
||||||
|
alt='Result of how it shows up in Home Assistant with the example ESPHome above'
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
The ESPHome Dashboard has been updated with a simplified and streamlined wizard
|
||||||
|
for new configurations. You now enter the name of your project and your Wi-Fi
|
||||||
|
credentials and it will install it on your ESP device via the browser. After
|
||||||
|
that all further updates will happen wirelessly.
|
||||||
|
|
||||||
|
<div class='videoWrapper'>
|
||||||
|
<iframe
|
||||||
|
width="560"
|
||||||
|
height="315"
|
||||||
|
src="https://www.youtube-nocookie.com/embed/luE1hjCf3HI"
|
||||||
|
frameborder="0"
|
||||||
|
allowfullscreen
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## ESPHome: embracing projects
|
||||||
|
|
||||||
|
We want to make it easy for creators to sell ESPHome powered products that offer
|
||||||
|
a great user experience. ESPHome projects embrace local control and integrate
|
||||||
|
nicely with Home Assistant, and so each extra ESPHome product that our users
|
||||||
|
can buy is a win.
|
||||||
|
|
||||||
|
To make it easier to keep creators and users connected once a product is
|
||||||
|
installed, projects can now add a project identifier and version to their
|
||||||
|
firmware ([docs][esphome-project]). With
|
||||||
|
today’s release this information will be available in the device information,
|
||||||
|
logging output and the mDNS discovery info.
|
||||||
|
|
||||||
|
The goal is to integrate the projects tighter into the ESPHome dashboard by
|
||||||
|
showing the project’s logo, link to the documentation and issue pages and allow
|
||||||
|
installing updates.
|
||||||
|
|
||||||
|
## Why we build this
|
||||||
|
|
||||||
|
Home Assistant’s mission is to make local home automation a viable alternative
|
||||||
|
to cloud based solutions and accessible to everyone.
|
||||||
|
|
||||||
|
To make this mission a reality, we started the company Nabu Casa. Together with
|
||||||
|
the community, Nabu Casa develops Home Assistant and ESPHome and is funded
|
||||||
|
solely by people that support this mission. No investors or loans.
|
||||||
|
|
||||||
|
If you want to help fund our work, subscribe to [Home Assistant Cloud][nabucasa].
|
||||||
|
|
||||||
|
[adafruit-esptool]: https://github.com/adafruit/Adafruit_WebSerial_ESPTool
|
||||||
|
[adafruit]: https://www.adafruit.com
|
||||||
|
[add-esp-web-tools]: https://esphome.github.io/esp-web-tools/#add-website
|
||||||
|
[aliexpress]: https://www.aliexpress.com/item/1005002354577296.html
|
||||||
|
[amazon]: https://amzn.to/35cUvGj
|
||||||
|
[esp-web-tools]: https://esphome.github.io/esp-web-tools/
|
||||||
|
[espeasy]: https://github.com/letscontrolit/ESPEasy
|
||||||
|
[esphome-project]: https://www.esphome.io/components/esphome.html#project-information
|
||||||
|
[esphome]: https://www.esphome.io
|
||||||
|
[improv]: https://www.improv-wifi.com
|
||||||
|
[makermelissa]: https://github.com/MakerMelissa
|
||||||
|
[nabucasa]: https://www.nabucasa.com
|
||||||
|
[tasmota]: https://tasmota.github.io/docs/
|
||||||
|
[wled]: https://wled.me
|
BIN
source/images/blog/2021-06-power-up-your-esp-projects/dht22.png
Normal file
BIN
source/images/blog/2021-06-power-up-your-esp-projects/dht22.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 737 KiB |
BIN
source/images/blog/2021-06-power-up-your-esp-projects/social.png
Normal file
BIN
source/images/blog/2021-06-power-up-your-esp-projects/social.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
3
source/images/improv-logo.svg
Normal file
3
source/images/improv-logo.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="103" height="39" viewBox="0 0 103 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M91.9054 9.93591C94.2195 11.9374 95.9238 14.5495 96.8236 17.4738C96.8562 17.5864 96.8661 17.7044 96.8526 17.8209C96.8391 17.9374 96.8026 18.0501 96.7451 18.1523C96.6877 18.2546 96.6104 18.3443 96.5179 18.4164C96.4254 18.4885 96.3195 18.5414 96.2063 18.5721L96.0925 18.6052C95.8773 18.6654 95.6472 18.6406 95.4498 18.5361C95.2523 18.4315 95.1025 18.2551 95.0314 18.0433C94.2366 15.444 92.7244 13.1217 90.6686 11.3436C88.6127 9.56547 86.0968 8.40366 83.4101 7.99177C83.1903 7.95187 82.9941 7.82907 82.8622 7.64873C82.7302 7.4684 82.6726 7.24428 82.7011 7.02266L82.7175 6.90532C82.7337 6.78842 82.7732 6.67596 82.8336 6.57457C82.894 6.47319 82.9741 6.38493 83.0692 6.31502C83.1643 6.24511 83.2724 6.19495 83.3872 6.16752C83.502 6.14008 83.6211 6.13592 83.7376 6.15528C86.7609 6.62431 89.5914 7.93442 91.9054 9.93591ZM87.0042 17.7343C87.3824 17.2789 87.3211 16.6021 86.8673 16.2226C86.4135 15.8432 85.739 15.9047 85.3609 16.3601L75.415 28.3366L69.8258 22.728L68.3132 24.2458L74.7306 30.6856C74.9431 30.8988 75.2352 31.0125 75.5354 30.9988C75.8356 30.9852 76.1162 30.8454 76.3086 30.6137L87.0042 17.7343ZM92.7606 18.6474C92.0919 16.5061 90.8387 14.5941 89.142 13.1266C87.4453 11.6591 85.3726 10.6945 83.1574 10.3413C83.0416 10.3238 82.9236 10.3295 82.8101 10.358C82.6966 10.3865 82.5899 10.4373 82.4962 10.5073C82.4025 10.5774 82.3236 10.6654 82.2642 10.7662C82.2047 10.867 82.1659 10.9787 82.15 11.0946L82.1336 11.2119C82.1051 11.4336 82.1627 11.6577 82.2947 11.838C82.4266 12.0183 82.6227 12.1411 82.8426 12.181C84.7174 12.4785 86.4718 13.2942 87.9075 14.536C89.3433 15.7778 90.4032 17.3963 90.9677 19.2087C91.0389 19.4205 91.1887 19.5969 91.3861 19.7015C91.5836 19.806 91.8137 19.8308 92.0289 19.7706L92.1426 19.7375C92.255 19.7068 92.3601 19.6542 92.4521 19.5827C92.544 19.5112 92.6209 19.4223 92.6783 19.321C92.7357 19.2197 92.7726 19.108 92.7867 18.9924C92.8008 18.8768 92.7919 18.7596 92.7606 18.6474ZM8.39453 31H6.14453V13.9375H8.39453V31ZM14.2188 18.3203L14.2773 19.7265C15.207 18.6328 16.4609 18.0859 18.0391 18.0859C19.8125 18.0859 21.0195 18.7656 21.6602 20.125C22.082 19.5156 22.6289 19.0234 23.3008 18.6484C23.9805 18.2734 24.7812 18.0859 25.7031 18.0859C28.4844 18.0859 29.8984 19.5586 29.9453 22.5039V31H27.7773V22.6328C27.7773 21.7265 27.5703 21.0507 27.1562 20.6054C26.7422 20.1523 26.0469 19.9257 25.0703 19.9257C24.2656 19.9257 23.5977 20.1679 23.0664 20.6523C22.5352 21.1289 22.2266 21.7734 22.1406 22.5859V31H19.9609V22.6914C19.9609 20.8476 19.0586 19.9257 17.2539 19.9257C15.832 19.9257 14.8594 20.5312 14.3359 21.7421V31H12.168V18.3203H14.2188ZM42.6133 29.4648C43.4961 28.2851 43.9375 26.7304 43.9375 24.8007V24.6015C43.9375 22.5546 43.4922 20.957 42.6016 19.8086C41.7188 18.6601 40.5156 18.0859 38.9922 18.0859C37.4219 18.0859 36.1953 18.6328 35.3125 19.7265L35.207 18.3203H33.2266V35.875H35.3945V29.7695C36.2773 30.7461 37.4883 31.2343 39.0273 31.2343C40.5352 31.2343 41.7305 30.6445 42.6133 29.4648ZM40.8555 21.1679C41.4648 21.9961 41.7695 23.125 41.7695 24.5546C41.7695 26.1796 41.4609 27.4062 40.8438 28.2343C40.2344 29.0546 39.4102 29.4648 38.3711 29.4648C37.0352 29.4648 36.043 28.8867 35.3945 27.7304V21.6718C36.0508 20.5078 37.0352 19.9257 38.3477 19.9257C39.4102 19.9257 40.2461 20.3398 40.8555 21.1679ZM52.832 20.2656C52.5039 20.2109 52.1484 20.1836 51.7656 20.1836C50.3438 20.1836 49.3789 20.789 48.8711 22V31H46.7031V18.3203H48.8125L48.8477 19.7851C49.5586 18.6523 50.5664 18.0859 51.8711 18.0859C52.293 18.0859 52.6133 18.1406 52.832 18.25V20.2656ZM54.7539 21.1914C54.2695 22.1836 54.0273 23.3007 54.0273 24.5429V24.6953C54.0273 26.664 54.5586 28.2461 55.6211 29.4414C56.6914 30.6367 58.0859 31.2343 59.8047 31.2343C60.9453 31.2343 61.9531 30.9609 62.8281 30.414C63.7109 29.8671 64.3867 29.1054 64.8555 28.1289C65.332 27.1445 65.5703 26.0351 65.5703 24.8007V24.6484C65.5703 22.664 65.0352 21.0742 63.9648 19.8789C62.9023 18.6836 61.5078 18.0859 59.7812 18.0859C58.6641 18.0859 57.668 18.3554 56.793 18.8945C55.9258 19.4336 55.2461 20.1992 54.7539 21.1914ZM57.1797 28.1875C56.5312 27.3359 56.207 26.207 56.207 24.8007C56.207 23.2148 56.5352 21.9961 57.1914 21.1445C57.8477 20.2929 58.7109 19.8671 59.7812 19.8671C60.875 19.8671 61.75 20.3007 62.4062 21.1679C63.0703 22.0273 63.4023 23.1523 63.4023 24.5429C63.4023 26.0976 63.0781 27.3086 62.4297 28.1757C61.7812 29.0351 60.9062 29.4648 59.8047 29.4648C58.7109 29.4648 57.8359 29.039 57.1797 28.1875Z" fill="#212121"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
Loading…
x
Reference in New Issue
Block a user