esp8266 is not even close to being a replacement for rPi. The specs are orders of magnitude worse. 160KB RAM, 1MB flash, 80MHz CPU, no GPU. None of the builtin modules for networking, wifi, etc.
I'm currently working on an agriculture sensing iot platform and going to try to use rpiZero W with the current spectrum sensor from nanolambda. http://www.nanolambda.net . luckily they have the rPi api,sdk already.