E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel
  • Need Help?

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

What Closing Costs Do Home Buyers Have?

February 25, 2023

What Is Realtek HD Audio Manager

February 2, 2023

A Basic Guide To Cell Tower Leasing

February 2, 2023
Facebook Twitter Instagram
E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel
  • Need Help?
Facebook Twitter Instagram
E Amazings
You are at:Home»Technology»ESP8266 Web Server Saves 60% Power With A 1 Ms Delay
Technology

ESP8266 Web Server Saves 60% Power With A 1 Ms Delay

By October 28, 2022No Comments2 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter Pinterest WhatsApp Email

[ad_1]

Arduino has a library for quickly and easily setting up a simple web server on an ESP8622-based board, and [Tomaž] found that power consumption on an ESP-01 can be reduced a considerable amount by simply inserting a 1 ms delay in the right place. The reason this works isn’t because of some strange bug or oddball feature — it’s really just a side effect of how the hardware operates under the hood.

[Tomaž] uses the “hello world” example from ESP8266WebServer to explain. In it, the main loop essentially consists of calling server.handleClient() forever. That process checks for incoming HTTP connections, handles them, sends responses, exits — and then does it all over again. A simple web server like this one spends most of its time waiting.

A far more efficient way to handle things would be to launch server.handleClient() only when an incoming network connection calls for it, and put the hardware to sleep whenever that is not happening. However, that level of control just isn’t possible in the context of the Arduino’s ESP8266WebServer library.

So what’s to be done? The next best thing turns out to be a simple delay(1) statement right after each server.handleClient() call in the main loop.

Why does this work? Adding delay(1) actually causes the CPU to spend the vast majority of its time in that one millisecond loop. And counting microseconds turns out to be a far less demanding task, power-wise, than checking for incoming network requests about a hundred thousand times per second. In [Tomaž]’s tests, that one millisecond delay reduced idle power consumption at 3.3 V from roughly 230 mW to around 70 mW — about 60% — while only delaying the web server’s response times by 6-8 milliseconds.

For simple web server applications, this is is for sure a good trick to keep in mind. There are also much more advanced techniques for saving power on ESP8266-based boards; from boards that barely sip a single microamp while sleeping, to coin-cell powered boards that go so far as to modify the TCP/IP stack to help squeeze every bit of power savings possible.

[ad_2]

Source link

Related Posts

What Is Realtek HD Audio Manager

By Corbin BowenFebruary 2, 2023

A Basic Guide To Cell Tower Leasing

By Corbin BowenFebruary 2, 2023

The Flight Of The Dremel

By January 5, 2023

A White-Light Laser, On The Cheap

By January 5, 2023
Add A Comment

Comments are closed.

Our Picks

What Closing Costs Do Home Buyers Have?

By Corbin BowenFebruary 25, 2023

What Is Realtek HD Audio Manager

By Corbin BowenFebruary 2, 2023

A Basic Guide To Cell Tower Leasing

By Corbin BowenFebruary 2, 2023
Recent Posts
  • What Closing Costs Do Home Buyers Have? February 25, 2023
  • What Is Realtek HD Audio Manager February 2, 2023
  • A Basic Guide To Cell Tower Leasing February 2, 2023
  • Air Duct Repair 101: Everything You Need To Know February 2, 2023
  • Advantage LIC? How Budget Insurance Amendment Bill may benefit the PSU insurance giant January 5, 2023
  • The Flight Of The Dremel January 5, 2023
  • LIC offering multiple benefits on premium payment with co-branded credit cards with Axis Bank: Check features, offer January 5, 2023
Archives
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • September 2021
Facebook Twitter Instagram Pinterest TikTok
© 2022 E Amazings - All Rights Reserved.

Type above and press Enter to search. Press Esc to cancel.