I am developing a Wifi based Led light (Got Inspired from Philips hue, Lifx). I have little knowledge about web server, clients, Web protocols. I will be using ESP8266 as Controller cum WiFi module.

There are two ways to control Led light over WiFi.

  1. Locally
  2. Remotely

Android/iOS app will be handling all the control part.

Which protocols can I use to control Led light, locally? HTTP or Websockets?

Note :- The speed is critical, android/iOS app can send around 50-60 values per second.

Also, which protocol should I go with if Led light is controlled Remotely.? So far, MQTT seems reliable. Any suggestion?

Kindly help!

  • why not use a single protocol for both local and remote - far simpler code - MQTT should suffice Commented Jul 11, 2016 at 23:19
  • What if internet is not working, in that case as well, Local transmission of data will not happen, because MQTT works over Internet. I should have the option of controlling it locally.
    – MICRO
    Commented Jul 12, 2016 at 6:48
  • MQTT works over a network, doesn't have to be "the internet" if you have a local MQTT server Commented Jul 12, 2016 at 6:48
  • But I see what you mean. My setup is more flexible because all my IOT servers are within my LAN - still externally accessible, but all under my control and I have a router that loops back requests for external IP from within the LAN ... so, it just works with one single domain, I don't have to do anything different for external vs internal access Commented Jul 12, 2016 at 6:52

1 Answer 1



Seriously though, ESP8266 is limited in resources, AND you want to send 50-60 updates a second, just UDP will be the most lightweight, and you won't run out of connections (5 I think on ESP), because UDP has no connection state.

This is what was used here to control a RGB strip: https://github.com/cnlohr/esp8266ws2812i2s , it just listens for UDP packets on port 7777, and each packet contains rgb values, one byte for R,G,B, etc.

MQTT is nice, but it doesn't work well for 60hz updates, I Tried :D It resulted in un-smooth animation, and frames out of order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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