1

I am attempting to create a wireless sensor network using ESP8266 devices and the Sming framework. Most of the code I have currently got comes from the basic WiFi example. I have been able to establish connections between up to 3 devices and do not foresee any problems connecting more.

I would like to have a sink node to which all the other devices send their data. This sink node could either be one of the ESP8266 devices or for example my smartphone with a WiFi hotspot. Sending a message from one device to a sink node could take multiple hops.

My problem lies with how I am going to have the devices communicate with each other. I am not looking for any specific routing algorithms or anything like that. I would like to know how I can have the ESP8266 devices communicate with each other using the WiFi link they have established. Do I need to use the TcpClient and TcpServer classes from the Sming framework?

When a device connects with another device, I seem to be unable to retrieve the IP address of that other device.

Thijs Riezebeek
  • 1,762
  • 1
  • 15
  • 22

1 Answers1

-1

You could use UDP instead of TCP, it may be simpler. See the example Sming UDP echo code.

When a UDP message is received the onReceive method receives the remote IP address as one of its parrameters.

Cap
  • 99
  • 2
  • 11