Well, I have a few general questions as I have been pretty unsuccessful trying to get the mega to communicate with the ESP 01. I have been successful in getting the ESP 01 in standalone configuration to upload some data to my php page. I used the <ESP8266WiFi.h> and <ESP8266HTTPClient.h> when I flashed the ESP 01. Below was the request made from the ESP 01 that works perfectly.. NOTE: it is bogus data (no variables) just to see if i could post something.
char httpRequest[160] = "http://mywebsite.com/cgi-bin/myphp.php?volts=14&temp=80&humd=80&press=1010";
But in general, I don't think i have a clear understanding of how I should architect this project when i introduce the Mega into the mix.
My goal is to get data from various sensors such as the BME280 and others to the mega, then the ESP 01 should get that data from Serial 2 pin 16 and 17 on the mega and upload it. So here are my questions;
1. Do i have to use AT commands? (for some reason i have struggled to get them to work)
2. Should or do i have to flash the ESP 01 at all? I read somewhere if i flash i lose the AT ability
3. I assume, I will gather the info from the sensors, then WRITE to serial 2 where the ESP 01 will READ that data and post. That sound correct?
I have an UNO with built in wifi that sends data to a PHP perfectly.. so I am puzzled why I can't seem to make this work or why this seems to much more difficult.
I realize this should be easy, but I am convinced I am missing a critical point or concept. There are plenty of examples of the UNO and Esp but not so many of the Mega. And those i have found I could not adapt to my needs.
Thanks for any suggestions, or any links to something close to what I am doing. Preferably not AT commands.
Jim