16 ms·
A Beginner's Guide to the ESP8266 (2017)
- paul_funyun 3y agoA useful gizmo but bang for your buck seems esp32 is the way to go
- jareklupinski 3y agoi reach for an esp8266 for the same reasons i try to design a 2 layer pcb instead of 4 layer: the challenge and maybe just maybe if i have to make a thousand, i'll be ahead of the game
- connicpu 3y agoI mean, if it's for a task where I know my program will fit in 512K flash and 80K ram, then an ESP8266 is still cheaper. One of those is powering my DIY thermostat right now :)
- peterhadlaw 3y agoAny resources on how you made your diy thermostat? :)
- connicpu 3y agoIf you've done any basic electronics before it would be relatively straightforward. I didn't follow any specific guides, just spent a lot of time reading the datasheets for components that sounded like they might work. My ESP8266 is connected to a GPIO expansion board from Adafruit over I²C, which controls 3 TRIACs through TRIAC opto-isolators. HVAC control wires use 24VAC so TRIACs are the silent option for switching, although relays would have probably worked just as well. After that I just programmed the ESP8266 in Arduino to listen to the MQTT broker on my network to send the values from its temperature probe (also an I²C board from Adafruit) and receive commands. It also has a basic thermostat mode programmed in if it stops receiving commands for too long.
- pantalaimon 3y agoUnfortunately it relies on an outdated GCC 5 toolchain that will never get an update
- LeafItAlone 3y agoI have to imagine that in most hobby (as in, one off) use cases the $1-$2 difference makes no real difference. And at one point (years ago) I was able to buy ESP32s for practically the same price on Aliexpress.
- connicpu 2y agoSpace and power savings shouldn't be discounted either. Especially if you're going to run it off a battery ;)
- reaperman 3y agoBiggest advantage of the ESP32 for me is that it can connect to WiFi networks with enterprise encryption with X.509 certificates. ESP8266 doesn't have the CPU horsepower to manage this.
- throwup238 3y agoThe other big advantage is nonvolatile storage. The ESP32 can store the state of modules between restarts.
- gh02t 2y agoEvery ESP8266 module I've ever used had a chunk of flash memory you could use for persistent storage that survived reboots/poweroff too. It's used to store WiFi credentials in a lot of frameworks, but you can stick other data in there. I guess it's not integrated into the chip, but don't most people use the integrated modules even in custom designs? All mine have. Also IIRC it's not as well known, but the RTC also has a very tiny amount of memory you can use to pass state between deep sleep cycles. That one won't survive a power loss, but it's handy when sleeping and doesn't wear out like the flash memory.
- jes5199 3y agoI’ve used both, and I’m actually more productive with the ESP8266 because it is so limited - I can usually squeeze in a minimal implementation of one or two things and that’s it. With the ESP32 there’s always other options, and it means I have to make more decisions, so I end up getting bogged down in irrelevant stuff
- eternityforest 3y agoESPHome completely solves that for me.
- sircastor 3y agoThe ESP32 line is the natural progression. Specifically the ESP32-C3 is the successor to the 8266.
- weinzierl 3y agoThe ESP32-C is a RISC-V, unlike the others.
- pantalaimon 3y agoAll the new ESP32 parts are RISC-V
- weinzierl 3y agoIsn't the C3 the only one so far?
- pantalaimon 3y agoESP32-C2, ESP32-C5, ESP32-C6, ESP32-H2, ESP32-H4 and ESP32-P4 are also RISC-V. Xtensa are ESP8266, ESP32, ESP32-S2 and ESP32-S3.
- yau8edq12i 3y agoIf you're looking for a "successor" for the ESP8266, then it's clearly the ESP8684, part of the C2 line - even Espressif says so.
- 3abiton 3y agoIt totally depends on the usecase, but I find that esp32 is so powerful, it's not power efficient. Al lot of IoT application run on batteries with a single task usually, and this where ESP8266 shines.
- cranium 3y agoThe ESP32 has series tailored for different purposes: https://www.espressif.com/en/products/socs https://www.espressif.com/en/products/socs (eg. the ESP32-H is for low-powered applications). I don't know how it fares against the ESP8266 in power consumption but as a hobbyist I would pick an appropriate ESP32-XX first and only look at alternatives if it's really lacking. See also: https://products.espressif.com/#/product-comparison https://products.espressif.com/#/product-comparison
- mavamaarten 3y agoIt's almost problematic how many variants there are these days. I'm sure they all have their particular application but I sure don't know the difference anymore without spending a lot of time comparing. I feel like a few years ago you just went for an Esp8266 with x amount of flash. I thought the only difference was that and the form factor, but I might just have been oblivious of all variants back then.
- HeyLaughingBoy 3y agoI used to work for an engineering services company, and by default, our quotes would include a minimum of 40 hours just for finding and sourcing appropriate components. Even for an experienced EE, it can be ridiculously time consuming. And it's one of those "hidden tasks" that has to be done but is rarely explicitly accounted for.
- GuB-42 3y agoThis guide is from 2017, before the ESP32 essentially took over.
- krish98sai 3y agoVery clean guide. I wish I had something like this when I attempted to make my Roomba "smarter": https://github.com/krish98sai/smart-roomba https://github.com/krish98sai/smart-roomba
- chaosprint 3y agoesp32 s3 or c6 can be better to get started with: https://gist.github.com/sekcompsci/2bf39e715d5fe47579fa184fa819f421 https://gist.github.com/sekcompsci/2bf39e715d5fe47579fa184fa...
- deleted 3y ago[deleted]
- bahmboo 3y ago(2017)
- YugyDugan 3y ago[dead]
- devsda 3y agoThis is a good and extensive guide. Most guides out there work with dev boards that are powered by usb. It's great to see a section dedicated to power them with alternatives like LM-1117. I'm still hoping to find a guide dedicated to power management of espxxx boards that includes guides for powering them with a range of sources like coin cells, aa, lithium, 9v, 12v batteries etc along with a primer on different features (like sleep modes) and their impact on power consumption to maintain the battery life. I always see mentions of all these interesting diy projects but not how they are powered. So, its difficult to get a complete picture of the maintenance needed and their usefulness in the long term.
- 2Gkashmiri 3y agoI have an esp8266 hooked up to a solar inverter. it used to have problems with not getting enough power so i hooked up a power bank between the inverter and the esp. if the power from solar gets out, the power bank (10k mah on paper, must be less) can run it for around 36 hours on full charge.
- gh02t 2y agoFinding a powerbank that doesn't auto shut off with small power draws from a esp/microcontroller is hit or miss, it's not something that is advertised and the threshold can vary wildly. There are workarounds but they can get a little complex if you don't want them to just burn a bunch of excess power. I've also had bad luck with power banks that can survive outside more than a little while. Not moisture, you can seal that out, but heat and cold seems to kill the batteries.
- YugyDugan 3y agoThat's like your nan being frustrated that there isn't a single definitive guide to buying a laptop. There are so many factors that it's a near-impossible task. And even if you somehow managed to do so, it would already be obsolete by the time you stopped typing. The datasheet (for each of the ESPxx, regulator, etc) will specify power consumption in different states. But sadly there's a lot of misleading amateurish pseudoscience in Arduino-land so you're best to ignore everything else (which would even include a guide like this, for example).
- zippox 3y agoI always see these low prices (<$5) on articles and comments but this doesn't seem the be the case for the boards people actually recommend. Are people buying on aliexpress or other cheap alternatives?
- mft_ 3y agoI’ve got three from AliExpress that were all €2-3 (I pushed the boat out for a USB-C model most recently) and they’re all working perfectly so far.
- yjftsjthsd-h 3y agoAliexpress is probably cheaper, but TBH I just order them on Amazon. If you buy a bundle of like 6 then the unit cost gets around... I would have said $6, but I might be misremembering. Of course, for the number I've used, ~$4 and ~$6 are equivalent so YMMV.
- regularfry 3y agoRight now I can see knock-off D1 mini clones on Amazon for about £2.40 each. Real Wemos boards are about £4 each in bulk.
- kube-system 3y ago$1.10 US on eBay: https://www.ebay.com/itm/314750044526 https://www.ebay.com/itm/314750044526
- microtonal 3y agoWemos D1 Mini is about 5 Euro from many local sellers here. It’s a great little board (if you have the official ones, don’t know about clones).
- smilespray 3y agoIf you liked the D1 Mini, you can now get the excellent S2 Mini with an ESP32 S2 microcontroller for $2.50 on eBay. I just ordered a 10-pack for my HomeKit projects. https://www.wemos.cc/en/latest/s2/s2_mini.html https://www.wemos.cc/en/latest/s2/s2_mini.html
- dvh 3y agoIs there a wifi module with smaller power consumption?
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- BenjiWiebe 3y agoThis isn't really answering your question, but Wi-Fi isn't a very power efficient protocol.
- deleted 3y ago[deleted]
- defanor 3y agoStrange to see an overview of network protocols in the guide, and a web server in the SDK: they are very generic, do not seem like any of that should be specific to ESP8266. Edit: Removed two points of the comment that were wrong (as mentioned in a reply).
- zargon 3y agoThe introduction is quite clear that the guide uses Arduino, and using C is a possible alternative, among other options, not covered in the guide. It mentions several of the options in that same paragraph that you complain about it not mentioning.
- defanor 3y agoIndeed, both are mentioned in the "programming" section, which I have either misread or skimmed over. Edit: The options in the same paragraph are for different languages though (I saw those), but nevertheless it also mentions that they exist in general, including those for C. Well, it only mentions the official SDK for C, but hinting at more options still.
- Perz1val 3y agoI recently got mine out of the stash of "things for future projects" and I wanted to program it using PlatformIO and the RTOS SDK, but that's terribly outdated, with parts of that stack newer and it just doesn't work. Should I use the Arduino framework? That's boring, I did that already with arduino boards. Or maybe I should install the official Espressif toolchain and try the RTOS framework there? It is a bit dated, but I guess if the hardware didn't change, the software doesn't have to either. If anyone wants to give a recommendation, I want to make a system that listens to an endpoint (EC2 atm) and sends wake on lan packets to my devices that join a VPN after booting, so I can access them from anywhere.
- agys 3y agoI go with PlatformIO and Arduino as framework (#include <Arduino.h> on top of the main.cpp file) for all my ESP32 projects… All the library dependencies are managed through the platformio.ini file. Works perfectly!
- Perz1val 3y agoYeah, that's probably what I'll do, but I wanted to try RTOS framework
- wdfx 3y agoI've been building a MIDI device using PlatformIO with ESP-IDF: https://bitbucket.org/doughammond/fourays/src/master/firmware/ https://bitbucket.org/doughammond/fourays/src/master/firmwar... I used this combination because I found USB device support in Arduino framework lacking flexibility.
- vineyardmike 3y agoIf you really want to quickly build, you can try ESPHome. Less learning, but way easier. They also make it possible to insert your own C into that code too.
- 037 3y agoFor the ESP32, an hero is in the process of adding LVGL[1] to ESPHome[2][3]. You can try it out now: https://github.com/esphome/esphome/pull/6363 https://github.com/esphome/esphome/pull/6363 Here's the (very good!) preview documentation: https://deploy-preview-3678--esphome.netlify.app/components/lvgl.html https://deploy-preview-3678--esphome.netlify.app/components/... This is such a game-changer for me that I'll be using the ESP32 over the ESP8266 for any projects involving displays from now on. [1]: https://lvgl.io/ https://lvgl.io/ [2]: https://esphome.io/ https://esphome.io/ [3]: ESPHome on HN yesterday (500+ points): https://news.ycombinator.com/item?id=40138228 https://news.ycombinator.com/item?id=40138228
- zyberzero 3y agoThis is amazing! Thanks for the tip. My ESP32 dev board with a display is in the hands of Fedex right now, so this is perfect timing :)
- nayuki 3y ago"An hero" means something unexpected: https://en.wiktionary.org/wiki/an_hero https://en.wiktionary.org/wiki/an_hero , https://knowyourmeme.com/memes/an-hero https://knowyourmeme.com/memes/an-hero
- gkhartman 3y agoThis is great news! I recently discovered LVGL and was thinking that it would be great to have in a esphome module. I currently have a few of the small i2c OLED displays going, but they are quite limited. Many thanks to those working on it. Can't wait to try the preview.
- deleted 3y ago[deleted]
- antirez 3y agoI spent the latest three or four months doing embedded programming. After using extensively the ESP8266 and ESP32, now I'm quite certain I prefer big times the RP2040 (that is, the Raspberry Pico processor, but you can find it in different non-Raspberry produced development boards). The reasons are easy to summarize: 1. Vastly superior C SDK, and even the MicroPython support appears to have an edge. 2. Fantastic documentation, even if in PDF form, which makes a bit less accessible for us and especially for LLMs training data crawlers. In general LLMs know a great deal more about ESP stuff than the RP2040. 3. Almost every RP2040 can be overclocked to 400Mhz and work stable, and I could say basically every RP2040 can be stable at 350Mhz, so when comparing performances, account for this. 4. Very smart hardware capabilities: state machines for programmable pins (PIOs), great DMA support, hardware interpolators. 5. High quality hardware, and if you don't need the version with wireless, the cost is still quite reasonable. 3/4 euros/dollars per piece. 6. When you need the "W" one, the wireless chip the Pico uses has its own ARM processor, so you continue to have the two RP2040 cores spare for your application. 7. Memory mapped flash with execute in place. You can read from 0x1000000+offset just deferencing a pointer and that's it, you access your flash. 8. More GPIOs available. The big disadvantage of the RP2040: No SPI RAM support. At this point many ESP32 boards have built-in SPI and this makes memory a lot less a scarse resource. To familiarize with the ESP family is useful since they are everywhere and are extremely cheap for what they offer. But still, I would start basically any new project where I have choice with the RP2040.
- dandy23 3y agoIt uses a lot of power for embedded apps though. Not often you need all that performance either.
- antirez 3y agoYou can downclock the Pico as you can overclock it in order to reduce power usage. By default AFAIK it already more or less matches the ESP32 power usage, and downclocking it should be able to reach the one of the ESP8266, likely, but I'm not sure.
- 3y ago
- dr_dshiv 3y agoMy 14 year old has gotten so into arduino this year. ChatGPT was a game changer for him. He is using a pair of ESP32s with cameras to make a “mom detector” so he has more time to switch tabs.
- roughsquare 3y agoWhy not have it switch tabs automatically?
- BrandoElFollito 2y agoI had a "parents detector" in the mid-80s when we got the old TV in our room. Unknown to my parents I did a deviation on the mains of the TV to be able to switch off the TV from my bed when the stuff I put on the way trapped. For those who may have the reference, it was France, Canal+ times when you had instructional broadcasts on Saturday at midnight and you needed to make out what was going on from a scrambled image. Also the fact that you had to multitask like crazy to not be caught.
- gekkekoe 3y ago[dead]
- amelius 3y agoIs the Arduino IDE the best way to program these chips? Is there something more "professional", for Linux? Anyone programming with just CLI tools and without Arduino libs?
- iamds 3y agoVSCode with the platformIO plugin is pretty good
- HankB99 3y agoLast time I looked, I thought that VSCode/PlatformIO supported both the ESP libraries (ESP-IDF) directly as well as the Arduino libraries (which I think are based on ESP-IDF.) My personal preference is to use the Espressif libraries rather than Arduino libraries, but I used to program micro-controllers for a living so I'm more comfortable with that development environment.
- zik 3y agoSure. I use the ESP32 (rather than the older ESP8266 mentioned here) and I program in C and the ESP API [1]. The provided software has a lot of features and is pretty nice to work with. There's also a vscode plugin which makes configuring and programming the device a breeze. [1] https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/index.html https://docs.espressif.com/projects/esp-idf/en/stable/esp32/...
- amelius 3y agoThanks. Aside, that looks a lot more developer-friendly than many other vendor-provided tools/frameworks I've seen in the past. I hope the others follow suit.
- dotnet00 3y agoIt's pretty cool how cheap and capable microcontroller dev boards are these days, I just have a stash of two-three dozen esp8266's, esp32s and rp2040s laying around, convenient to just be able to grab one whenever something I'm tinkering with could use some intelligence.
- sebosp 2y agoWhat's the equivalent to foreman/quickstart but for embedded devices, ie you got a bunch of devices, different architectures, different sensors to different pins, different versions of firmware, some of them off, how do you keep track of them?