Communicate Between 2x Mega Plus 2560 R3 Boards Using 2x ESP-01S ESP8266 Modules

I have plenty of computer, electronics, and programming experience so I figured I could easily use a couple Arduino boards to avoid running thousands of feet of wire between 2 machines. I thought this was developed for children. I feel like this project can not be more basic, but it's had my brain twisted for weeks now.

All I want to do is have one board act as an input device, which then sends the list of active inputs to a 2nd board, which then activates some outputs based on the received inputs. Essentially a wireless PLC.

The hardware I'm using is 2x Keyestudio Mega Plus 2560 R3, and 2x ESP-01S ESP8266 Modules.

Link to Mega Plus 2560 R3 on Amazon

Link to ESP-01S on Amazon

This is not my first Arduino project, but it's my first time trying to use Wifi. I have Arduino IDE setup. I have both boards powered with the ESP-01S modules connected and powered. I've successfully uploaded the example blink sketch to both boards and both modules. All 4 pieces of hardware are successfully blinking.

I am stuck on programming the 2 ESP-01S modules to communicate with each other. I have read/watched 100+ pages/videos on this, most of it is 3-10 years old. Every single page/video explains it differently, mentioning countless flashing steps and countless libraries.

Can someone please guide me towards the most basic way to program these ESP-01S modules? Thank you.

Please post schematics and codes.
What's the distance between transmitter and receiver? What environment is there between them?

1 Like

I'm not posting a schematic, I'd rather spend that time doing more research instead of drawing a picture. This is such a basic setup, you do not need a picture. It's just a Mega board with a ESP-01S connected.

I already stated that all 4 pieces of hardware are running the blink sketch. What code are you asking for?

The distance is about 50 feet max, open air between them, which seems irrelevant.

I just need guidance on the proper library for what I'm trying to do with the hardware that I have, and help flashing the ESP modules if needed. Maybe just using ESP boards without the Megas would be better, but I need about 20 pins for either input or output.

Thanks

Not according to your schematic and code. Those are showing nothing.

What are you even talking about? There is no schematic or code! I did not even get that far... I'm stuck setting up the proper library.

Now I know why there are no answers on this forum. Literally every thread I've read just has people like you asking for more and more and more information with no actual useful info. Not a single thread I've read actually answered the persons question or solved any problem.

Have you ever used an ESP-01S with a Mega Plus 2560? If yes, what libraries did you use? You do not need any info from me to answer those questions.

Thanks.