Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Silber.Rahmen
#39317 Hello,
my skills:
I can handle the ESP (via NodeMCU) via Arduino-SDK.
I can read and write DIN/DOUT.
I can send my temperature-values via HTTP-Request into the cloud.

But how can two or more ESP modules talk to each other (in the same 'Home'-WLAN)?
What I basically want to do:
In three similar rooms in my house with each 2 or 3 windows I want to check the state of all the windows: Are all windows closed in all rooms?
In each room I want to know if the windows in the other rooms are closed or open.
So each module should be able
* to send the state of its own windows
* to request the state of the other windows
So push and pull should be available for each module.
Each ESP-Module has (2+3+3=) 8 LEDs to show the state of all 8 windows.

Is there a easy way to do that?

Thanks!
User avatar
By WereCatf
#39335 There is an HTTP-server and client (including example sketches) there, you could just use those. Doing it via HTTP would also have the benefit of you being able to use your own desktop web-browser to check them, too. Might at least be worth thinking; there are plenty of ways, both UDP and TCP, but adapting one of the example sketches for a quick-and-dirty solution is a very easy route to take.
User avatar
By eduperez
#39351 When IoT projects become too complex for a simple one-to-one communication, I would suggest using a central MQTT server: each node can send status reports to the central MQTT, and later you can attach as many nodes or applications to the same MQTT server as you need.
User avatar
By Silber.Rahmen
#39391 Hello,
well, yes, a central MQTT server will be probably a very nice solution...but I do not want to use any external servers. Just this 3 modules.

This evening I started trying talking via UDP and static addresses. Well, this works.
But: Is there a easy way to find the other modules in the WLAN if using not static adr. but DHCP?

Thanks!