Arduino mega and nodemcu esp2866-esp12e connect together for wifi

There are a few ways to solve your issues.

  1. the AT command set.
  2. program the ESP8266 as independent web server, and read the data from the Mega using Serial or I2C communications.
  3. get an I2C ADC port expander like the ADS1115 and connect everything to the ESP8266 (that way you have the five analog ports you want: four on the ADS1115, one on the ESP8266 - but mind the ESP8266s ADC range is 0-1V), freeing up your Mega for another project.