Difference between revisions of "ESP8266"

From Makers Local 256
Jump to: navigation, search
m (Random resources)
m (dangling paren... argh)
 
(12 intermediate revisions by one user not shown)
Line 1: Line 1:
== Overview ==
+
This is a collection of resources for '''software/hardware/firmware development on/with an ESP8266'''.
This is a collection of resources for '''software/hardware/firmware development on/with an ESP8266'''. To be fleshed out Soon(tm).
+
 
 +
== Basics ==
 +
* [https://drive.google.com/file/d/0B2VtMT70lamBdEc4Ull1VENxTlk/view Datasheet]
 +
 
 +
== Choice pieces of information ==
 +
[[File:Esp8266-boot-pins.jpg|framed|right|Figure 1]]
 +
* The module nominally runs on 3.0-3.6V. In practice, it tends to boot just fine as low as 2.5V, and 4.7V is the absolute maximum. [https://forum.makehackvoid.com/t/esp8266-operating-voltage-range-and-sleep-current/286 Source]
 +
** This means you can probably get away with running an ESP8266 directly off of a single Li-ion/Li-poly cell. [http://batteryuniversity.com/learn/article/confusion_with_voltages More information on Li-ion battery voltages]
 +
** The often-repeated information stands: '''This is not a 5V device. If you run it off of 5V, you will smoke it within a few seconds.'''
 +
** Check out [https://www.adafruit.com/product/2745 this voltage regulator] for battery and/or 5V powered applications.
 +
* According to the datasheet, the module "typically" can draw up to 170mA (whatever that means). In practice, your supply needs to be able to provide at least 300mA.
 +
** This is really just information that "is known". You can see references to it [http://www.nfriedly.com/techblog/2015/07/build-a-diy-esp8266ex-esp-01-dev-test-programming-board/ here]. I ([[User:hfuller]]) have personally measured 240mA, and I don't even have a fast meter, so I'm likely missing any spikes in draw due to Wi-Fi transmission or whatever.
 +
* You have to have certain pins in certain states in order to boot your code, run the boot loader, etc. See Figure 1.
 +
** In reality, GPIO2 doesn't seem to matter too much. And sometimes you can float GPIO0. But this is the nominally required setup, so if you start encountering weird behavior like boot loops and such, remember this diagram!
 +
 
 +
== Power saving ==
 +
* Use deep sleep to save power when you don't need to be running for a long time.
 +
** Docs for Arduino IDE [https://github.com/esp8266/Arduino/blob/master/doc/libraries.md#esp-specific-apis here].
 +
*** Something unclear: deepSleep with time of 0 sleeps forever.
 +
** "GPIO16 needs to be tied to RST to wake from deepSleep" if you want to wake based on RTC. (External wake sources can just mess with GPIO16 directly.)
 +
** Datasheet claims 60 microamps in this state. Realistic results with testing [https://www.sparkfun.com/news/1842 here].
 +
** You can wake up several different ways; there are settings to tweak RF calibration and other stuff. [https://forum.makehackvoid.com/t/esp8266-deep-sleep-cycle-times-and-power-consumption-with-wifi-on/786 Measurements here].
  
 
== Random resources ==
 
== Random resources ==
Line 9: Line 30:
 
* https://tzapu.com/sonoff-firmware-boilerplate-tutorial/ - Sonoff
 
* https://tzapu.com/sonoff-firmware-boilerplate-tutorial/ - Sonoff
 
* https://github.com/esp8266/Arduino/blob/master/doc/libraries.md#esp-specific-apis - Library list
 
* https://github.com/esp8266/Arduino/blob/master/doc/libraries.md#esp-specific-apis - Library list
 +
* https://github.com/me-no-dev/ESPAsyncTCP - async tcp operations. There is a Web server too.
  
 
[[Category:ESP8266]]
 
[[Category:ESP8266]]

Latest revision as of 21:58, 9 April 2017

This is a collection of resources for software/hardware/firmware development on/with an ESP8266.

Basics

Choice pieces of information

Figure 1
  • The module nominally runs on 3.0-3.6V. In practice, it tends to boot just fine as low as 2.5V, and 4.7V is the absolute maximum. Source
    • This means you can probably get away with running an ESP8266 directly off of a single Li-ion/Li-poly cell. More information on Li-ion battery voltages
    • The often-repeated information stands: This is not a 5V device. If you run it off of 5V, you will smoke it within a few seconds.
    • Check out this voltage regulator for battery and/or 5V powered applications.
  • According to the datasheet, the module "typically" can draw up to 170mA (whatever that means). In practice, your supply needs to be able to provide at least 300mA.
    • This is really just information that "is known". You can see references to it here. I (User:hfuller) have personally measured 240mA, and I don't even have a fast meter, so I'm likely missing any spikes in draw due to Wi-Fi transmission or whatever.
  • You have to have certain pins in certain states in order to boot your code, run the boot loader, etc. See Figure 1.
    • In reality, GPIO2 doesn't seem to matter too much. And sometimes you can float GPIO0. But this is the nominally required setup, so if you start encountering weird behavior like boot loops and such, remember this diagram!

Power saving

  • Use deep sleep to save power when you don't need to be running for a long time.
    • Docs for Arduino IDE here.
      • Something unclear: deepSleep with time of 0 sleeps forever.
    • "GPIO16 needs to be tied to RST to wake from deepSleep" if you want to wake based on RTC. (External wake sources can just mess with GPIO16 directly.)
    • Datasheet claims 60 microamps in this state. Realistic results with testing here.
    • You can wake up several different ways; there are settings to tweak RF calibration and other stuff. Measurements here.

Random resources