Using a sensor on one ESP8622 to activate something on a different ESP8622

Hi there,

I am pretty new to Arduino but especially programming. I would like to get more familiar with IOT and I learn by doing a project and breaking down the code after it works.

For this specific project, I have two Wemos D1 ESP 8266 boards and I want one to send a signal to the other when a trigger is activated. I've spent HOURS scouring the web for an example of a similar project and the only one I could find was the one attached.

The only issue is that it doesn't work. The transmitter cycles through the loop irraticly but the receiver doesn't seem to receive the command even though it says it has connected.

Is there a better way to go about this or does anyone know why this isn't working?

Captain.ino (1.88 KB)

Sailor.ino (1.81 KB)

in your sailor.ino at line 24,

   boolean result = WiFi.softAP(ssid);

does 'result' return 1 if printed on s.monitor ?

Why not simply post the code?

Get one ESP acting as server ONLY. Get one ESP acting as client ONLY.

Only when you understand how that works, add code to each one to perform the other role.