3

I need to communicate Arduino module with my Phone through ESP8266 wifi module

They all link to the local LAN network and didn't know the IP address of each other, so I plan to send UDP broadcast message from my phone, but ESP8266 module seems doesn't receive the message

The ESP8266 library I use is from here: https://github.com/itead/ITEADLIB_Arduino_WeeESP8266

and use the function registerUDP() and recv()

Can somebody help me?

mpromonet
  • 11,326
  • 43
  • 62
  • 91
user2170949
  • 31
  • 1
  • 2

1 Answers1

4

I don't have enough reputation to leave a comment so I will make an answer.

I have a feeling that your registerUDP() need to specify an IP address and I guess you are supplying your DHCP assigned IP address. Where as the UDP broadcast is sent using a multicast or broadcast IP.

You can modify the initiator code to send UDP packet to all IP within the same subnet (e.g. 192.168.1.1 to 192.168.1.254) and see if it works.

some user
  • 876
  • 1
  • 12
  • 26
  • Hi~ Thank you! It works when I sending the broadcast message using 192.168.1.255. And the another question is: Is it possible to send by 255.255.255.255? – user2170949 Jun 04 '15 at 15:55
  • broadcast addresses support often depends on the router and the device. And wireless support for broadcast on router maybe even worse. But if it works for you and that is your deployment scenario, I guess it is fine. – some user Jun 04 '15 at 17:11