[ad_1]
The ESP8266 microcontroller can establish connections to a WLAN without additional components. The inexpensive chip is therefore ideally suited for smart home devices developed in-house. They should set up their own network for the configuration of the WLAN access data and query the data via a browser-based form with a web server and store all configuration data in the flash of the microcontroller. Most projects use the WifiManager library for this, which automatically organizes the web server, form and connection establishment after configuration.
If the WifiManager does not yet know any WLAN access data, the library waits in setup()
thereon. loop()
the ESP does not run until the WLAN is configured. What is a sensible approach for many smart home tinkering, however, blocks devices whose WLAN communication is only an additional feature. The AeVOC aerosol and VOC sensor is such a device: it warns of contaminated air via colored LEDs and shows its measured values on a small OLED display. VOCs are volatile organic molecules (volatile organic compounds). LEDs, display and sensors also work without a WiFi connection. If this exists, the sensor box can also send its data via the MQTT home automation protocol, which means that the smart home can automatically ventilate. If you take the device out of the reception area of the home WLAN, it shouldn’t wait for data, but also measure, display and warn offline.
The developer Balázs Kelemen probably once built a similar device. Namely, with “IotWebConf” he wrote a library inspired by the WifiManager, which however does not block if there is no WLAN access data. It is just as easy to use as the WifiManager. The firmware for AeVOC uses the library and is suitable as an example of how to integrate IotWebConf into your own projects for the ESP8266.
- Access to all heise + content
- exclusive tests, advice & background: independent, critically sound
- Read c’t, iX, Technology Review, Mac & i, Make, c’t photography directly in your browser
- register once – read on all devices – can be canceled monthly
- first month free, then 9.95 € per month
- Weekly newsletter with personal reading recommendations from the editor-in-chief
Start FREE month
Start your FREE month now
Already subscribed to heise +?
Sign up and read
Register now and read articles right away
More information about heise +
[ad_2]