So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Jooooolian
#74070 What I am trying to do is have two modules on independent WiFi networks talk to each other. For example, some input on module 1 could activate a LED on module 2 and vice versa.

I have researched this and all I can seem to find are two alternatives that I don't want: 1) Connect two modules locally using server/client. (Local communication is not applicable here)

2) Control a module from anywhere (I need the input to come from another esp8266, not from a website.)

Any help would be greatly appreciated as I have failed to find how to do it myself. Thanks!
User avatar
By btidey
#74087 If you have control of at least one of the local network routers then you can use a server client model across the internet by using port forwarding.

ESP-A as server accepts requests on say port 80. Router for ESP-A port forwards incoming port 80 traffic to the local ESP-A IP.

ESP-B as client sends request to the WAN IP:80 of network A

This is helped if you set up a dynamic dns name (like freedns) to refer to the WAN IP

For full 2 way communication you can stick with a 1 server / client model (and poll for requests in 1 direction) or you could set up server /client in the reverse direction if you port forward network B

The alternative is to use some public cloud based solution where both ESPs talk to the cloud.
User avatar
By martin_g
#74092 Quick and dirty, just a proof of concept?

Use two ESPs, an MQTT library and let them publish and subscribe to one or two distinct topics on test.mosquitto.org. This provides no security and it has no guaranteed QoS, but it will work even from local networks behind a NAT router.