I've been playing around with a couple of CHIPs[0] that are cheaper than most Arduinos and come with Bluetooth, WiFi and USB built in, a bunch of memory, and run ARM Debian. They use NAND for storage so you don't need a SD card for the OS, and the forums are pretty active for a pretty recent hardware platform.
Other than still trying to get some SPI stuff integrated I've had no problem doing stuff I wouldn't want to use a Pi on and could not really use an Arduino on. I believe they're of better specs than anything but the latest Pi, maybe that as well.
For $9, I've been very happy with it, but I can't compare it to the ESP as I have a few laying around and haven't used them yet.
The other part probably has to do with language. Being that it's running on linux, you can program with a variety of languages versus just arduino language.
That said one of my favorite side projects last year was eliminating all of the Pis I had doing stuff like this. I used a NodeMCU ($9 Amazon Prime) and the Arduino SDK to replace my Raspberry Pi garage door opener (integrated with Home Assistant). Complete with magnetic door switch and no prior experience, I'd replaced the Pi after about two hours of hacking. Not worrying about `apt-get upgrade` is nice but the real bonus was noticing how much more robust the esp8266 wifi was compared to the Pi. In my garage door use case the difference was night and day.
Between this example and others around the house, I've noticed the Arduino ecosystem and community is actually much better for this kind of stuff. Once you really dig into things like GPIO, PWM, etc on the Pi it's clear they're second class citizens to community efforts surrounding video/HDMI (as one example). It's actually pretty incredible the same $35 board can control a stepper motor for your blinds or decode H.264 at 1080p while running Kodi in your living room!
So far the process has been very refreshing, and as a long-time sysadmin working with these parts is a lot less frustrating than having to deal with distros on a pi.
This turned out to be a mistake. Problems encountered included:
- I don't know C++ all that well (for example, I was returning pointers to memory allocated on the stack). This is mainly an issue because you can't just attach GDB to a microcontroller, so debugging becomes guess-and-check.
- With the Ethernet and SMTP libraries initialized, I had barely enough RAM for the rest of the program, and wound up having to do some contortions to get everything to fit.
- Whenever there was a minor network hiccup the entire thing would freeze for twenty seconds. I had to rework the UI to disable itself before network operations, so it wouldn't freeze in the middle of a beep and screech loudly for the duration.
- GMail doesn't support non-SSL SMTP connections, and the Arduino isn't powerful enough to handle SSL. We had to install an SMTP service on a local server to act as a gateway.
After all this effort I finally got the whole thing to work, and installed it in his house. A year later something stopped working (I don't remember what, I think it was something about the SMTP server) and he asked me to fix it. I decided that it would be easier to redo the whole thing instead of trying to patch this new issue. I built an addon board for a Pi that had the same connector as the original Arduino shield I had built so it was a drop-in replacement (they even both run off the same 5v USB power supply!) The effort required to develop the Pi-based replacement was about a quarter of the original. This included getting rid of the separate SMTP server and adding some extra features like a web UI. To top it all off, the original Arduino Ethernet cost $65, whereas the Raspberry Pi that replaced it cost only $35.
On the other hand, the ESP8266 might start to tip this balance back in the other direction, especially with NodeMCU which provides a Lua environment.