0

I am working on wifi based LED project which involves various ESP to be connected to router. Basically grouping of ESP has to be done. The android app sends HTTP command to IP address which is given by router to the ESPs, the IP are not static and expires after some time. Now my question is how can mobile app can get the IP of all the ESP connected to router?

Does using HTTP protocol complicates the process? Shall I switch to multicast UDP? or use UnPn Protocol for scanning (Sounds complicated though).

Please help!

18
  • HTTP is a 1:1 connection. If you want 1:many you need a different protocol. Multicast UDP is possibly the best way to go - then the ESPs subscribe to the multicast address and you don't care what their IPs are.
    – Majenko
    Commented Nov 27, 2016 at 11:13
  • So how exactly UDP works? The packets sent to multiple ESPs at once reaches at the same time? For example I am sending value of RED led 254 to 6 ESP, all 6 ESP will glow to RED at once?
    – MICRO
    Commented Nov 27, 2016 at 11:25
  • 1
    en.wikipedia.org/wiki/IP_multicast
    – Majenko
    Commented Nov 27, 2016 at 11:26
  • 1
    This may also help: esp8266.com/viewtopic.php?f=29&t=2464 - it's wonderful what you find on Google...
    – Majenko
    Commented Nov 27, 2016 at 11:32
  • 1
    Not from me. nc (NetCat) may be available in homebrew, or it may not. You'll have to look for yourself. Or ask Google, which contrary to popular belief, isn't my name.
    – Majenko
    Commented Nov 27, 2016 at 11:49

3 Answers 3

1

The best protocol for these kind of applications is MQTT.

Read more here

1
  • MQTT has delay. I need instant response within milliseconds
    – MICRO
    Commented Nov 27, 2016 at 15:58
1

You can go with UDP Multicast.

1

Yes, Multicast is the only option.

1
  • Can you back up your answer with some explanations please?
    – Nick Gammon
    Commented Nov 27, 2016 at 22:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.