Home Automation: Using the Raspberry Pi to control the lights in your home over Wi-Fi


Raspberry Pi + Wi-Fi Bulb = Automated House


The problem

Ever since I can remember, I have always wanted to control the lights in my home from a central location and in an automated manner, namely from a computer. But there were just too many obstacles which have prevented me from achieving this… until now. The biggest problem was the need for pairs of wires to run from each light to the computer. That meant a lot of wires (which translates to a lot of money, but also to a big, messy block of wire endings at the computer) and it also meant digging/drilling/cutting into the walls to hide the wires from sight.

Problem: Cables and Money

It was the only possible solution because the current had to run from each light to the device that switches them on and off, so there was no way to avoid this big mess. Also, there was another problem. You want to be able to control the lights spontaneously and quickly whenever you need to, which means that the controlling computer has to be up and running all the time, which is a waste of power (and money) and permanent noise in the room where the command center is established, which is usually a room in which you want peace and quiet or maybe even to sleep in. Finally, let’s not forget that in spite of the strong desire to automate my lights, I never wanted to spend a fortune on it. So for many years an elegant and affordable solution has eluded me… until the Christmas of 2013.


Raspberry Pi

Fortunately the technology related to home automation has progressed enormously in the last few years and new pieces of hardware have been developed which provide easy solutions to the above problems. The first important piece of the puzzle has emerged at the beginning of the year 2012, when the Raspberry Pi computer was officially released.

Raspberry Pi

The Raspberry Pi is a small, noiseless computer, which has a very low power consumption (typically 1-2 Watts) and is very lightweight. It takes up little space in the room and most importantly it is cheap (the official price is 25$ for model A and 35$ for model B). In other words it is the perfect choice for a computer to control the lights in your home. Some may argue that it is not very easy to use because it runs Linux (not Windows), but the truth is that Linux is really easy once you get the hang of it and it is very reliable, making it a good choice for home automation projects.


Wireless bulb sockets

The other very important component of this home automation solution is the ability to control the lights in a wireless manner, preferably both from home and from far away. Wireless sockets for light bulbs have appeared on the international market not so long ago. These are bulb sockets (E27, E26, E14, B22, etc.) which you screw into the existing socket and then you install your light bulb into these sockets. They contain radio receivers and you can use a remote to switch the socket on and off, putting your light bulb in an on or off state.

Wireless Socket

The good thing about these sockets is that you can keep your existing light bulbs. The not so good thing is that they will be a bit bulky and ugly unless you have a large lamp to conceal them. Also, I’ve never seen wireless bulb sockets so far which can be controlled with anything but simple radio signal transmitters, meaning that you can only send commands to them from your home. If you want to turn them on and off from far away, you need to reverse engineer their protocol and use a radio transmitter on your Raspberry Pi to send them the same signals that their remote is sending. Time consuming and cumbersome. Unless, of course, there are wireless bulb sockets out there which have an open specification which lets you know what signals to send, but I’ve never seen one until now. Finally, all that these wireless sockets can do is to turn the lights on and off, which is great in itself, but if you have higher aspirations, like dimming the lights or changing their color, then the sockets are not a good enough solution.


Wireless LED bulbs

Luckily there’s another technological development that has progressed rapidly in the last few years: wireless LED bulbs. These are light bulbs which can be controlled through radio signals directly (no special socket required). Most of them support dimming and changing the light color, which is a beautiful thing to do.

Wireless Bulb with Remote

The ones that we’ve seen until now were quite similar to the wireless sockets in the sense that the way you could control them was through a wireless remote. Unfortunately this meant that if you wanted to control them from a central computer (which also gives you the ability to control them from outside your home), you also had no choice but to reverse engineer their protocol and send the appropriate signals from a radio transmitter attached to the computer, which is hard to do. The fact that these bulbs produce light using LEDs is a good thing because they are very energy efficient and last for many years, but until recently it was also their major drawback because they just weren’t bright enough and could be used only for ambient lighting.


Smart Wi-Fi LED bulbs

Three brands of wireless LED bulbs stand out today from the rest: Philips HUE, LifX and MiLight / LimitlessLED / EasyBulb. There are two main characteristics that separate these three from the usual wireless LED bulbs: they are bright enough for comfortable everyday use and they can be controlled over Wi-Fi (not just with a remote that sends radio signals).

Smart Wi-Fi LED bulbs

Unfortunately none of them is perfect, each of them has smaller or bigger weaknesses, but they are good enough to be used in home automation projects. Philips HUE was the first to show itself to the public. Unfortunately, because it was the only such product on the market for some time, it’s price is ridiculously high, so high that I would not buy it unless I had money to throw away. But it is also the one that has the most versatile smart phone app. LifX was the second to emerge. It is bright (over 1000 Lumens) and promises a very versatile and comfortable smart phone app (for Android and iPhone). It’s price is much less compared to HUE, but it’s still high (89$ for a bulb). The biggest problem of LifX, however, is that you have to order it well in advance and wait months until you get your bulb.



And so we arrive to the wireless LED bulb which I prefer to use in my home automation projects. In different parts of the world it has different names: MiLight, LimitlessLED and EasyBulb. Unlike HUE or LifX, this bulb has quite a fair price (somewhere around 25-40$ for a bulb depending on where and when you buy it) and it is available today, not months from now, something that the manufacturers take pride in. It has been developed over the last couple of years and it is still being improved. MiLight is a bit less luminous compared to HUE and LifX, with the most recent RGBW bulb producing 800-850 Lumens at full brightness, but I’ve tested it myself and it is surprisingly bright (in spite of the specs), fit for everyday lighting. Its colors are very nice, saturated and vivid and the brightness can be set in fine steps.

Here is the presentation video for MiLight bulbs, to give you an idea of how it looks and what can be done with it:

The way I encountered MiLight was through the kindness and benevolence of Santa. A very special person, who knows that I’m a big fan of home automation, has whispered to him that some WiFi LED bulbs would make me happy. And they did, when Santa put 3 9W RGBW Milight bulbs, a wireless remote and a V3 wireless bridge under the Christmas tree this year (2013). Actually, I’m more excited about these MiLight bulbs than Santa or myself would have ever imagined because they look so nice and they are surprisingly bright. Also, they are very easy to communicate with, which finally allowed me to turn my dream of automating the lights in my home into reality. Getting such a wonderful present for Christmas came as an overwhelming surprise. After a few days of experimenting and reading about them I realized that, when coupled with a Raspberry Pi, the MiLight system can be turned into an affordable and elegant light automation solution.


MiLight technical details

So let’s take a look at the technical details. The MiLight system consists of 3 main parts:

The MiLight system

The new 9W RGBW wireless LED bulb contains 15 white LED chips and 9 RGB LED chips. While the white ones give a strong and pleasant warm white light that can be used for everyday lighting, the RGB LEDs are perfect for setting the mood in the room. Inside the bulb, which is quite heavy, by the way, there is also a 2.4 GHz radio wave receiver, which is waiting for commands from the wireless remote or from the wireless bridge. Available socket types are E27, E26 (Edison screw), E14 (through adapter) and B22 (bayonet mount). The new 9W RGBW LED bulb is said to last over 50.000 hours (about 25 years of regular usage), consumes about 10W at full brightness and  about 0.3W when turned off (but listening to commands), making it a good long term money saver. Of course, it can also be turned off from the regular wall switch, in which case it does not consume any power but it also won’t respond to wireless commands. It has a very pleasant warm white tone and also 255 distinct other color shades. A “party mode” is also available, in which the bulb will automatically cycle through the colors. I personally find the 9W RGBW lights to be the best, but MiLight also has simple 6W white and RGB bulbs for sale.

The wireless remote or the wireless bridge are needed to control the bulbs. One of them is sufficient, but it’s more comfortable if you have both. The wireless remote is the simpler, conventional way of sending radio signals to the bulbs, but it’s also the quickest one because you can simply pick up the remote and press it’s buttons. The Wi-Fi bridge is needed if you wish to control the bulbs from a smart phone, from a computer or from some  other Wi-Fi enabled device. It also provides the ability to play with the lights from far away (from outside home). The Android and iPhone apps are available as free downloads. They aren’t extremely optimized for user comfort, but still they are relatively fun to use and cover all the basic functions (on/off, brightness, colors, disco mode, etc.). Both the wireless remote and the smart phone apps (which by the way don’t seem to be available for (some) tablets) can command a maximum of 4 bulb groups (zones). Each group can contain hundreds of bulbs and all groups can be controlled by several remotes or wireless bridges. But if you need more than 4 zones in your home, then you’ll have to get more than one remote or wireless bridge.


Why MiLight?

So why would we use exactly MiLight with the Raspberry Pi to automate the lighting in our home? Well, first there are the obvious reasons: it’s affordable, bright enough, the colors look great, lasts very long and it’s energy efficient. Also, it can be controlled over Wi-Fi from home and from far away. But there is one very important thing that makes the MiLight wireless bridge very suitable to use in more advanced home automation projects: it is very easy to communicate with and it has an open API, in the sense that the commands which it uses to control the bulbs are publicly available on the LimitlessLED website’s developer section. This is why it’s easy to send commands from a Raspberry Pi to the wireless bridge and control the bulbs through it. The Pi simply has to send the known UDP command messages to the bridge, which will translate them into radio signals understood by the bulbs. No need to guess or reverse engineer the protocol, it’s all documented. No need to transmit radio signals from the Pi directly, the wireless bridge does that for us if we send messages to it through UDP.



Raspberry Pi, MiLight wireless bulb and MiLight wireless bridge

Our lighting automation system will consist of the following components:

This means that the cost of the system starts from a minimum of around 140-150$, depending on where you manage to get the components from and what you use exactly, but also on how many and what kind of LED bulbs you attach to the system.


How it works

After getting the Raspberry Pi up and running (there are many guides out there about how to do this, but it is very simple, works mostly out of the box), you can log into it either directly (if you attach a monitor and a keyboard to it) or via SSH if you use it in headless mode. The great thing about connecting to it via SSH is that you can do it locally, in your home network, but also from outside networks, through any SSH client. On Windows machines I use the putty SSH client and on Android devices I use Juice SSH, both of them being simple and working great. To communicate with the MiLight wireless bridge, we will need to run some software on the Raspberry Pi which sends UDP messages to the it. I have created such a simple command line Linux program, simply called the “MiLight/LimitlessLED/EasyBulb RGBW v3.0/v4.0 Command Line Utility”.

The binaries can be downloaded from here.

wget http://iqjar.com/download/jar/milight/milight_binaries.zip

The C++ source files are also available for download here, in case you wish to tweak them.

wget http://iqjar.com/download/jar/milight/milight_sources.zip

Yes, it’s all completely free!


The MiLight/LimitlessLED/EasyBulb RGBW v3.0/v4.0 Command Line Utility

MiLight Linux command line utility

This lightweight command line Linux program can be used to send commands to the MiLight RGBW light bulbs, one at a time, through the MiLight wireless bridge v3.0/v4.0  (not compatible with earlier versions of the bridge). The program consists of two files:

    • milight – the executable
    • milight.conf – the configuration file

The configuration file simply contains three lines of text. The first line is the address (IP) of your MiLight bridge in your local area network. It is assigned through DHCP by default but it can be set to a fixed local IP address. You can find and set this IP address using your router’s configuration page. By default it is assumed to be, but it is likely that your router will assign a different IP address to the MiLight bridge. The second line is the port number on which the communication occurs with the MiLight wireless bridge. By default it is 8899, but it can be changed through the MiLight bridge‘s configuration page (at by default). The third line can be used to output the command that was sent to the wireless bridge. When the third line contains the text “VERBOSE”, the utility will write the sent command, the destination IP address and the destination port number to the standard output.

If you ever forget the arguments with which you can call the milight command line utility, just call it without any parameters and it will tell you how to use it:


The optional ZONE argument specifies which bulb zone the command refers to. If this argument is omitted, the command is considered to refer to all zones. Possible values:
ALL/0 – All zones
1 – Zone 1
2 – Zone 2
3 – Zone 3
4 – Zone 4

The COMMAND argument specifies the command to be sent to the given bulb zone. Some commands require a parameter (see below). Accepted commands:
ON – Turn the bulbs in the given zone on.
OFF – Turn the bulbs in the given zone off.
WHITE/W – Set the color of the bulbs in the given zone to white.
DISCO/D [+/-] – If no parameter is specified, turn disco mode on. The ‘+‘ optional parameter increases the disco speed. The ‘‘ optional parameter decreases the disco speed.
BRIGHTNESS/B VALUE – Set the brightness of the bulbs in the given zone.
The VALUE mandatory parameter specifies the brightness and must be an integer number in the range 1-19.
COLOR/C VALUE – Set the color of the bulbs in the given zone. The VALUE mandatory parameter specifies the color and must be an integer number in the range 0-255.

For example, if you wish to turn on all lights, call:

./milight on

If you wish to turn off all the lights, call:

./milight off

If you wish to set the brightness of the lights in zone 2 to minimum, call:

./milight 2 b 1

If you wish to set the color of the lights in zone 2 to some kind of blue, call:

./milight 2 c 5


Why combine MiLight with Raspberry Pi?

You might be wondering why it is a good idea to use a Raspberry Pi to control your MiLight bulbs when it’s quite easy and fun to use them even without a Raspberry Pi, and they can be controlled in a wireless manner anyway, from home or from away, using the wireless remote or a smart phone. Well, the command line utility presented above is very basic and might not impress much at first sight, but once you get it working, it opens a world of endless possibilities. To mention just a few:

    • It can be used to transmit various predefined sequences of commands to the bulbs.
    • It can be called from a fancy web page which will allow you to control your lights over the web (you’ll need a web server on the Pi for this, perhaps Apache or Tomcat? See this article if you need a basic guide).
    • It can be used to turn lights on or off based on a schedule (at given hours of the day).
    • It can send commands to the LED bulbs in response to events triggered by sensors (such as motion, temperature, etc).
    • You can call the command line utility when you receive an e-mail and blink your lights to notify you.
    • You can turn the lights on automatically when somebody enters the room or when the sun goes down.
    • You can attach a microphone to the Raspberry Pi and issue voice commands to control your lights in the most comfortable way ever.

The possibilities are endless. With a little bit of knowledge and imagination, you can have the most modern lighting system that exists today, with MiLight LED bulbs controlled by a Raspberry Pi. Have fun 🙂


Final word

I realize that this article sounds a bit like advertisement for the Raspberry Pi and for the MiLight LED bulbs. Even though this was not my original intention, I don’t mind that it turned out this way… they both are great devices which help us live a more interesting life. I like to believe that both were created with innovation in mind and the purpose was much more than just to sell a product. I like to believe that both were invented to help us unleash our own creativity and to create more advanced devices. Both of them have reasonable prices and appeal to the mind of the technology oriented people. So, yes, I do like them very much and I like to advertise them, even though there’s nothing in it for me, except the thought that through my article other people will get to know and enjoy these technological wonders, just like I do 🙂 .

Special thanks to NailGlaze for making me acquainted with MiLight and for the most wonderful Christmas present I could ever imagine!



Home Automation: Using the Raspberry Pi to control the lights in your home over Wi-Fi — 171 Comments

  1. interesting project, any chance tpo have similar approach with radio controlled more than wi-fi? not with integrated bulbs but adding a radio recever component in the whall box used for normal light switches?

    • Yes, I can see that too happening: radio controlled wall switches, wall plugs or even bulbs. But it’s probably more work than the MiLight system.

  2. Hi iqjar,

    first i like to thank u for providing us with such great opensource code 🙂

    since i am not this good at c++ maybe u can help me out/Implement a Feature.

    I like to write the last choosen color value in a text file to read it the next time i change the color and fade to that color. Because i don’t like the hard switch. Also it would be nice to have the fade speed read from the config file.

    If you could help me out i would be happy 🙂
    Thanks again for your work.

    ps: could i also use a simple terminal command like “nc” to send udp pakets? So maybe i can write a script myself 🙂

    • Hi there!

      I’m happy that you enjoy the utility 🙂
      I’m afraid I cannot write the code for you, at least not any time soon, because free time is very scarce for me these days. But I can give you a few ideas. Write a function which writes the color value to an output file. The easiest way is probably to open the output file
      FILE* f = fopen("MyFileName", "wt");
      and to write the color to it
      fprintf ("%d", color);
      then close the file

      You read the value back in a similar way:
      FILE* f = fopen ("MyFileName", "rt");
      int color = 0;
      fscanf (f, "%d", &color);

      Read the documentation for these functions to handle the possible errors. For example fopen() returns NULL if it can’t access the file, so you’ll have to watch out for that.

      to fade from one color to another, you can probably call the setting of the color for every color between the too:

      int diff = (color1 < color 2) ? 1 : -1; for (int i = color1; i != color2; i+=diff) { //Call code to set the bulb color to i }

  3. I have a strange but reproducible problem with this code: it works but after using it (even just a single time), my bulb switches off after about 30 seconds. I can switch it back on, but it will keep on switching off by itself. After unlinking the bulb and resetting the wifi controller things go back to normal. Firmware 4.02.10T.jcy01

    • That really is awkward. I never ran into this issue with my bulbs. Is your MiLight wireless bridge version V3 and are your bulbs the 9W RGBW bulbs? Do they only start switching off after 30 sec if you use this code or it happens also after you operate them from your phone?

    • Working fine for me.

      Same firmware as you, but I got mine from Easybulb.

      What version is your Wifi box? Mine is V3. If you have V4 (which is the one LimitlessLED is shipping now) there might be some issues. Can you check your wifi box version?

  4. I have the 9W RGBW, I am not sure which bridge I have (where does it show the version?). I only get this problem when I use the code, not when I use my phone. And even stranger, it only happens with zone 4, zone 1 and 2 work fine, I cannot test zone 3 as baby boy is sleeping, and I am not sure if it is due to the zone or the bulb (the light bulb in zone 4 is hard to access, so I’m not so keen on a swap test to decide). Is there anything in your code that treats zone 4 differently from zone 1?

    • I’ve tested all zones today. While zones 1 and 2 respond to command just well, zones 3 and 4 don’t respond at all. I’ll check the code soon…

      • I took a brief look at the code, but could not find any problem. I’ll have to investigate more. In the meantime, you can download some updated sources and binaries from here:

        This version outputs to the standard output the UDP command that is sent to the MiLight bridge if you set the third line of the milight.conf config file to VERBOSE. This way you can compare the sent commands to the ones specified by the official MiLight documentation, found here:

        So far what I’ve seen is that the command line utility sends the right commands, so perhaps the documentation is wrong?

        • OK, I’ve figured it out! The reason why zones 3 and 4 were not working with the command line utility is that the bulbs in zone 3 and 4 were only assigned to the manual remote, not to the Wi-Fi bridge. I have assigned the bulbs to zones 3 and 4 using the Android app and now all zones work perfectly, without any bug 🙂

  5. Hi Daniel!

    You can determine the version of the bridge by looking at the label. If you have the black label, then it’s V3, if you have the blue label, then it’s the old version. Well, I have only tested zones 1 and 2 because I’m only using 2 bulbs for testing so far… so there could be a bug related to zones 3 and/or 4… Theoretically the code treats all zones the same way, but there could be a bug hiding in the code somewhere. I can’t promise to take a look at the code or to try zones 3 and 4 very soon because I’m very busy with other things these days, but I’ll try to figure it out in a week or two. If you find anything in the meantime, please let me know.

  6. Amazing tutorial. Thanks for this.

    Does the white on RGBW bulbs just have one hue?

    I would love to be able to go from bright white to yellow in the evenings, but it doesn’t seem possible.

    Practically I see this working by activating both the white light and the colored RGB lights at once. That way you should be able to get a lot of hues.

  7. Hi there: I am working on the exactly same thing, but using the FS20 protocol and embedded Java, to control sensors and actuators (specially for heating and lights). Feel free to check it out at http://www.paulo-lima.org/hans

    The overall solution is cheaper then your, I guess … but I will look into integrating “MiLight” into Hans …

    I am planning to use your article about “controlling GPIO from a web browser” to setup a web interface for “Hans”. At the moment I can only control it via emails, or via a console application.

  8. have a look for the sunwait script from Dan Risacher. I compiled it for the raspberry now I can switch my milights at sun-up en sun-down.
    00 16 * 1 * sunwait sun down 53.9305771N 4.9534996E ; /etc/cron.d/groep1aan.sh

    • This might sound obvious, but did you try downloading the sources, then issuing the “make” command?
      What do you mean by “can’t seem to get it running”? It simply does not start? Any error in the system logs?

  9. Hi iq,

    Yeah the obvious bits I tried 😉 this is was the output:

    g++ -c -o obj/commands.o src/commands.cpp
    Assembler messages:
    Fatal error: can’t create obj/commands.o: No such file or directory
    make: *** [obj/commands.o] Error 1

    after I created the ‘obj/’-dir it ran. Sorry to bother lol, it was a bit late 😉

    • Yeah 🙂 When I saw the error message, I immediately thought that you’re missing the dir “obj”. Perhaps I should have included its creation in the make script… No bother, enjoy! 🙂

  10. Yeah pretty obvious huh 😛

    Anyway, thanks for this great piece of coding.

    Other question: It seems to me that it only ‘finds’ the conf file in the current dir the milight is run. Is there a simple way to put this centrally? Would it work to copy it to /etc/ for example?

  11. Yes, currently it’s looking for the conf file next to the executable. If you want to modify this to an absolute path, open src/udpsender.cpp and find the line: “const char* ConfigFileName = “milight.conf”;”, then modify the relative path “milight.conf” to an absolute one, like “/etc/milight.conf” or whatever you prefer. Finally rebuild the executable by issuing the “make” command 🙂

  12. Hi!

    Also thanks a lot from me for the nice milight program. I’ve written a small bash script for smooth coloure change much better the the Disco mode.
    But,…there’s one strange thing: MILIGHT can be started from command line as well within a bash script. But why is it not possible to start a bash script including the milight commands from another bash script:
    ./slow-lamp.sh &

    slow-lamp.sh contains the milight commands and works well, but not if started from a the above shown mini bash script. Both are in the same directoty.

    Any idea?



  13. Hi,

    I have a limitlessled set with wifi brige. From my Android device the lights are working. ( 8899
    Now I installed on my Raspberry with weget the milight_binaries.zip.
    Then unzip milight binaries.zip
    I can see now a folder wich containes 3 files, readme, config and binarys.
    In file config I changed the ip adress and the port to
    Then cd /milight_binaries und comand ./milight on.
    Thena get the fault -bash: ./milight: Permission denied

    coul somone please bring me on the right track???

    best regards

    • Correction:
      made same thing with milight_sources.
      had to make a new dir obj/-d and than it worked with make.
      But now I have a fault :Failed to send command to LED bulb


      • Kind of hard to tell what the problem is… most likely you’re sending to the wrong IP address or port. Check the list of devices in your router and make sure that the IP address of your MiLight bridge matches that in the config file.If this does not help, try adding some debug strings into udpsender.cpp and rebuild the app. That might help narrow it down.

    • Check the program’s permissions (ls -l) and make sure that the user trying to run it has the rights to run it. Or just try to run it as root (with sudo).

  14. Hello,
    I am a beginner and have no luck to get it going.
    Raspberry pi and Limitlessled RGW and brige from Jan.14

    Installed milight_sources.zip using wget.
    Then unzip milight_sources.zip
    Then cd milight_sources
    Then make
    Then change ip in milight.conf to (this is the ip of the brige )and port to 8899.
    Then ./milight on

    Unfortunatly the lights are not going on but also no fault showing.

    [email protected] ~ $ cd milight_sources
    [email protected] ~/milight_sources $ ./milight on
    [email protected] ~/milight_sources $

    setings in src/upsender.cpp
    const char* DefaultAddress = “”;
    const int DefaultPort = 8899;
    const char* ConfigFileName = “milight.conf”;

    Can somone please help.

    Best regards

  15. I had the same problem yesterday. It turned out that the router decided to assign a different IP to the MiLight bridge. I found the new, correct IP in the router’s settings (usually at and updated the milight.conf configuration file, after which it worked just fine 🙂

  16. Beware, the following settings are just default fallback values:
    setings in src/upsender.cpp
    const char* DefaultAddress = “″;
    const int DefaultPort = 8899;
    const char* ConfigFileName = “milight.conf”;

    The real settings are in the milight.conf file next to the milight executable.

    • Hello,
      I checked the ip in the router, that the ip of the brige is correct, Also can
      ping the ip of the brige from raspberry, With the Android app “milight”,
      I can turn the lights on and of. Only with the command ./milight on , nothing happens.
      Someone please give step by step instruction after I donloaded the milight_sources.zip with wget to the raspberry???

      • Hi Thomas!

        Why don’t you try downloading the binaries instead of the sources? I remember that you had some permissions problem with that. Just change the permissions and try it.

        1.Download the binaries using wget and unzip, like you did, let’s say to the folder /soft/milight
        2. cd /soft/milight
        3. sudo chown thomas milight
        4. ./milight on

        It should be this simple…

        If you get some error, please paste the exact error here, maybe I can help. If simply nothing happens, then I’ll try to modify the program to test for more errors and output error messages accordingly, but that might take a bit of time, as I’m quite busy these days.

  17. Thank you for your help and time.
    I unziped the milight_binaries to Desktop/Thomas/milight
    Then cd Desktop/Thomas/milight

    Then sudo chown thomas milight, not working.
    must I put sudo chown pi milight, if yes, still not working.

    [email protected] ~ $ cd Desktop/Thomas/milight
    [email protected] ~/Desktop/Thomas/milight $ sudo chown pi milight
    chown: cannot access `milight’: No such file or directory
    [email protected] ~/Desktop/Thomas/milight $
    [email protected] ~/Desktop/Thomas/milight $ ls -l
    total 4
    drwsrwsr-x 2 pi pi 4096 Feb 3 00:25 milight_binaries
    [email protected] ~/Desktop/Thomas/milight $ ./milight om
    -bash: ./milight: No such file or directory
    [email protected] ~/Desktop/Thomas/milight $
    [email protected] ~/Desktop/Thomas/milight $ ls -l
    total 4

    Do not know whats wrong


    • Hi,
      Downloaded milight_binaries.zip with wget
      unzip milight_binaries.zip
      changed ip in milight.conf to 8899
      gave right to milght to 755
      cd milight_binaries
      ./milight on

      lights still no going on.
      [email protected] ~/milight_binaries $ ./milight on
      [email protected] ~/milight_binaries $

      with remotecontroll and Milight app it works ok.

      Where is the problem??

  18. Hi Thomas!

    1. I’ve added some updated source files and binary files. Download them from the same location, the same way you did until now. I’ve added some additional code to output the possible errors encountered during sending the UDP commands. After you download the files, open the Readme and make sure that the version inside it is 1.03 (means you really have the updated files). after that edit milight.conf with your IP address, your port number and on the last line change the “NOT_VERBOSE” text to “VERBOSE”. This will tell the program that you want to see the details about the errors. After that try to run it as usual, see if you get any error messages.

    2. If the above still does not work, then maybe you should try sending the commands not just to a specific IP, but to broadcast the messages to all the devices in the LAN (I know, you checked your IP, but to me your problem description still sound like you’ve entered the wrong IP into the milight.conf file…). So replace the IP that you have in the milight.conf file with the broadcast IP. The official LimitlessLED dev page states: “you can UDP broadcast to or if you want all wifi bridges to receive the command on the LAN”. This never worked for me, but maybe it works for you.

    3. If it does not work, perhaps you need to try some other broadcast IP address. Run the command “cat /etc/network/interfaces” and you should see a broadcast IP there. Try with that one.

    Let me know how it goes.

    • Thanks a lot for your effort,
      Curently I am on the wat to Mexico and want be abel to test.
      I let you know in 10 days.
      Best regards

  19. Hi,

    downloded version 1.3
    Installed as before.
    Made sure again the correct ip.adress is in .conf file I checked the ip in the router with the mac adress of the brige.
    ping is ok.
    Still not working no error messages.
    Tryed to change ip adress to or no luck

    If I give you my ip adress and open port 21 for you, could you go online and see whats going on??


    • Hi Thomas!

      I’m sorry to hear it’s still not working. What puzzles me is that you get no error message, nothing. But now, that you’ve activated the verbosity, it does display messages like “Sent UDP command XXX to IP:Port”, right? So at least we know that the verbosity is working…

      I wish I could help you figure out what is wrong by checking your machine, but I honestly have no idea what the problem could be. For everybody else it works. Is there any special configuration on your Raspberry Pi? When was the operating system image put on it? When did you run apt-get update and apt-get upgrade last time? When did you update the firmware of your Pi last time?

      If you have the possibility to try it on another Raspberry Pi (maybe at a friend?), that might help understand if the problem is in your Pi or not. Otherwise I think the only way we can get to the bottom of this is by somehow sniffing the UDP packets being sent form your Pi to the router. That’s something I’ve never actually done, so I won’t be able to help with, but others have done it and you’ll probably find forums where you can get help.

      Anyway, the next logical step is to determine if your Pi is actually sending those UDP packages to the router or not. There might be easier ways to find that out, if you know any network experts, they might be able to help with that.

      If you manage to find out anything useful, please get back to me, I’m very curious what can be wrong.


      • I have another idea. Try to find out how you can send UDP packages from Linux from command line. Then run the milight program, see what command it’s trying to send (with verbosity on) and then try to send the same command from command line. This way we’re attacking the problem from the other side, trying to eliminate the possibility that the bug is in the milight program.

  20. Hi,
    I updated mi rpi with latest firmware.

    still nothig happens with ./milight

    However with comands [email protected] ~ $
    echo -e -n \x35\x00\x55 | nc -u -q 0 8899

    echo -e -n \x39\x00\x55 | nc -u -q 0 8899

    the lights go on and off, so the ip adress is correct wich I put in the .conf file.

    My be the aplication is not for me.
    I use wifi to and from the rpi
    I use Limitlessleds the ones wich can only be within white cold and warm.

    • Hi Thomas!

      Wait a second! You’re not using the RGBW 9W Limitless LED bulbs, but simply the white ones? Well, that explains why it does not work 🙂 This application is only meant to work with the 9W RGBW ones. But the god news is that you should be able to make it work with your own lights if you change the commands in the appropriate source file to send the right codes and compile the application. One of the source files clearly shows the codes being sent. Just update those, build the app and you’re good to go. I guess the hard part will be figuring out which codes you need to use. If you need help with rebuilding or something, let me know!


  21. Hi Andras,
    thanks for your info.

    Now I installed the sources.zip, change in the commands.cpp the code for on and off, recompiled it and now the light go on and off with the command
    ./milight on ./milight off
    Thank you all for your help.

    I need now only to figure out how to set the correct code for Zone 1-4 etc….. google should help me………..

    Thanks again, I will com back if I need more help.
    Best regards

  22. Hi,
    can turn on/off all 4 zones induvidually as well on/off all together.
    Great code from you.
    Is ther a “ready made” bash script, to turn on and off the lights a a certain time with crontab -e (copy-paste)??

    Times for on/off to be defined in crontab.

    As you see I am a beginner, but learning……….


  23. Hi,
    [email protected] ~/Thomas/milight_sources $ ./milight on
    [email protected] ~/Thomas/milight_sources $ ./milight off
    This is to turn on / off the light, and it works.

    This is the content of the new file “ein” a created: (has perm 755)
    The file “ein” is in /bin

    /home/pi/Thomas/milight_sources/milight on

    in sudo crontab -e made the folowing entry:
    * * * * */bin/ein ( trigger is every minute)

    Unfurtunatly it`s not working.


  24. Aren’t you missing a space character after the last * sign? “* * * * * /bin/ein”

    What if you try running some other non-milight related script from inside /bin/ein? Does that work?

    If you run /bin/ein as root (sudo /bin/ein) manually, does that work?

  25. Change in upsender ccp the ip from to
    Made command “make” in Thomas/miligth_sources.
    Now everything is working.
    Light go on with cron, with ./milight off, go off
    Will make new script to turn off also with cron.

    Thanks again for your help.
    Best regards

  26. Well, I suppose that you checked and the milight.conf is there, next to the milight program. I guess that the milight program is looking for the config file in the current directory, not in its own directory, which is a problem that I should fix when I’ll have a bit of time. Until then you can probably work around the problem by changing the current directory in your /bin/ein script to the milight directory:

    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight on

    Hope this helps 🙂

    • Any movement on fixing the need for the configuration file to be located in the current directory as opposed to the directory where the program is?

      • Hi Ryan!

        I’m afraid not. If there was a request about this in the past, I must admit that I completely forgot. Unfortunately I don’t have time for such projects these days and God only knows when I will. But if you know how to program in C++, I encourage you to try changing it yourself, I can help by answering questions if needed. The main idea is this: if you open the source file udpsender.cpp, you’ll see that at the very beginning of it, in the readConfig function, it simply tries to open the configuration file by referring it through its name only (no path specified). In this case the current directory is assumed by the OS. What you need to do is find a Linux C++ function which returns the path of the currently running application and pre-pend that to the config file name.

      • Yes. Finally done. I’ve fixed the problem with locating the config file. Now the milight app is looking for the config file next to itself, regardless where the current directory of the OS is pointing to. you will of course have to download the latest version of the milight app. Have fun! 🙂

    • I’ve fixed the problem with locating the config file. Now the milight app is looking for the config file next to itself, regardless where the current directory of the OS is pointing to. Have fun! 🙂

  27. Hi,
    yes this works ok like you wrote it.

    Everything is almost under controll,great toy.

    New question:

    The commmand ./milight 1 b 19 ( to set the brightness to full is not working)

    What and where do I hae to change,so the command works with the whith lamps?


    • Hi Thomas!

      I’m glad it works 🙂 Unfortunately I don’t know for sure how you can control the brightness of white bulbs. Is there any specification anywhere on the net about how many steps you can use to control their brightness, what commands need to be sent and what values are accepted? If you can find these out, theoretically you can change the command in the same place where you changed it for on/off and also in one of the other source files you have to change the interpreting of the program arguments so that it accepts your range of values instead of 1 <= value <= 19.

  28. This is what I found for the white bulps (limitlessled.com/dev)

    FULL BRIGHTNESS ALL 0x35 100ms followed by: 0xB5
    FULL BRIGHTNESS GROUP 1 0x38 100ms followed by: 0xB8
    FULL BRIGHTNESS GROUP 2 0x3D 100ms followed by: 0xBD
    FULL BRIGHTNESS GROUP 3 0x37 100ms followed by: 0xB7
    FULL BRIGHTNESS GROUP 4 0x32 100ms followed by: 0xB2

    I think it can be dimmed in 10 steps.

    But I have no cloue what to to with this.


  29. Hi Thomas!

    If you open the source file commands.cpp, you’ll find a function in it called sendBrightnessCommand(). Inside it you will see a declaration of an array with 19 elements, which contains the 19 hexadecimal codes which work for the RGBW bulbs (their brightness can be controlled in 19 steps). The only thing that you need to change is this array (the number of codes in it and the actual codes in it). The problem is that the information you found is not enough. those are just the codes for max brightness. We need all codes, or at least the code for the minimum brightness, code for maximum brightness and the number of steps between them. From that info we could “guess” all the codes.

  30. Yeah, I just took a look at their updated page… many examples and not much order among them… but I could not find the codes and number of steps for white bulbs, only the codes for full brightness. So I guess the only thing left to do is to experiment and find them out. You know the codes for full brightness. Keep in mind that those are numbers in the hexadecimal system, you can convert them to “normal” decimal numbers and back using a calculator. From there, you’ll probably have to start sending smaller numbers for the brightness value and hope that they cause the brightness to decrease. Keep going down until you find the lowest limit. Actually, it might not be quite that simple. With my RGBW bulbs I found that as I decrease the number, the brightness sometimes goes down, other times it remains the same, and after a while it goes back up again. But there are only 256 possibilities in total, so you can go through them all and check which ones work for you. It’s a bit of a pain, but it feels great when you find out the codes. Then you can share them with the world, so the next person does not have to suffer through it 😉 I don’t have any white bulbs, only RGBW ones, so I can’t help with this, only in theory. Let me know how it turns out!

  31. This is what I got from limitlessled;


    Group ON for the group you want to set the brightness for. You send the group ON command

    100ms before sending the 4E 1B 55)
    Byte1: 0x4E (decimal: 78)
    Byte2: 0×02 to 0x1B (decimal range: 2 to 27) full brightness 0x1B (decimal 27)
    Byte3: Always 0×55 (decimal: 85)

    Friend RGBW_Brightness10percent As Integer = &H2

    Friend RGBW_Brightness14percent As Integer = &H3

    Friend RGBW_Brightness17percent As Integer = &H4

    Friend RGBW_Brightness21percent As Integer = &H5

    Friend RGBW_Brightness24percent As Integer = &H6

    Friend RGBW_Brightness28percent As Integer = &H7

    Friend RGBW_Brightness32percent As Integer = &H8

    Friend RGBW_Brightness35percent As Integer = &H9

    Friend RGBW_Brightness39percent As Integer = &HA

    Friend RGBW_Brightness42percent As Integer = &HB

    Friend RGBW_Brightness46percent As Integer = &HC

    Friend RGBW_Brightness50percent As Integer = &HD

    Friend RGBW_Brightness53percent As Integer = &HE

    Friend RGBW_Brightness57percent As Integer = &HF

    Friend RGBW_Brightness60percent As Integer = &H10

    Friend RGBW_Brightness64percent As Integer = &H11

    Friend RGBW_Brightness68percent As Integer = &H12

    Friend RGBW_Brightness71percent As Integer = &H13

    Friend RGBW_Brightness75percent As Integer = &H14

    Friend RGBW_Brightness78percent As Integer = &H15

    Friend RGBW_Brightness82percent As Integer = &H16

    Friend RGBW_Brightness86percent As Integer = &H17

    Friend RGBW_Brightness89percent As Integer = &H18

    Friend RGBW_Brightness93percent As Integer = &H19

    Friend RGBW_Brightness96percent As Integer = &H1A

    Friend RGBW_Brightness100percent As Integer = &H1B

    So the range is from 2-27.When I type ./milight on, all lights go on
    Brightness I set to full via the remote, Then I type ./milight 0 b 2
    but nothing happens. Your range is from 2-19 , so is not limitlessled code from 2-19 the same and only from 20-27 different?? or additional??

    If I use; echo -e -n \x4E\x1B0\x55 | nc -u -q 0 8899 nothing happens,
    but with : echo -e -n \x35\x00\x55 | nc -u -q 0 8899 the lights go on.


    • You probably can’t use my RGBW brightness codes at all. You have to replace my array with 19 code elements with your own array, which will contain 25 (27-2) elements. Each element will be one of the codes that you posted here.

  32. Hi dear helper,

    below codes work for my white bulps, testet with UDP Sender. (android app)
    hex comand 350055 turns all on only 3500 also works
    hex comand 390055turns all off only 3900 also works

    All other comand below work in the same way

    The question now is how to integreat this codes to the software.


    MiLight White
    35 00 55 – All On
    39 00 55 – All Off
    3C 00 55 – Brightness Up
    34 00 55 – Brightness Down (There are ten steps between min and max)
    3E 00 55 – Warmer
    3F 00 55 – Cooler (There are ten steps between warmest and coolest)
    38 00 55 – Zone 1 On
    3B 00 55 – Zone 1 Off
    3D 00 55 – Zone 2 On
    33 00 55 – Zone 2 Off
    37 00 55 – Zone 3 On
    3A 00 55 – Zone 3 Off
    32 00 55 – Zone 4 On
    36 00 55 – Zone 4 Off
    B5 00 55 – All On Full (Send >=100ms after All On)
    B8 00 55 – Zone 1 Full (Send >=100ms after Zone 1 On)
    BD 00 55 – Zone 2 Full (Send >=100ms after Zone 2 On)
    B7 00 55 – Zone 3 Full (Send >=100ms after Zone 3 On)
    B2 00 55 – Zone 4 Full (Send >=100ms after Zone 4 On)
    B9 00 55 – All Nightlight (Send >=100ms after All Off)
    BB 00 55 – Zone 1 Nightlight (Send >=100ms after Zone 1 Off)
    B3 00 55 – Zone 2 Nightlight (Send >=100ms after Zone 2 Off)
    BA 00 55 – Zone 3 Nightlight (Send >=100ms after Zone 3 Off)
    B6 00 55 – Zone 4 Nightlight (Send >=100ms after Zone 4 Off)

    MiLight RGB
    22 00 55 – Lamps On
    21 00 55 – Lamps Off
    23 00 55 – Brightness Up
    24 00 55 – Brightness Down (There are nine steps between min and max)
    27 00 55 – Mode Up
    28 00 55 – Mode Down (There are 20 modes. The lowest is constant white)
    25 00 55 – Speed Up (Fast)
    26 00 55 – Speed Down (Slow)
    20 xx 55 – Set Colour to xx (value shown on MiLightRGB plugin converted to hexadecimal)

    Edit 15/03/2013 – Added additional MiLight White commands. Thanks to Hamish at LimitlessLED.

    • Hi Thomas!

      You need to modify the commands.cpp, taking out of it the RGBW codes and putting the white bulb codes instead, then compile it and test it. I would do it myself, it’s probably no more than a few hours of coding/testing, but one problem is that I don’t have white bulbs to test with and the even bigger problem is that I don’t have the time 🙂 Take a good long look at the commands.cpp source file. The existing commands for RGBW should lead you on to what needs to be changed. Start by replacing the more basic commands first.

  33. Really great job! I would like to know if it is possible to combine the milight lamps e.g. with the boblight control sw… would be a great effect :))

    • Hi Roy!

      I don’t know what a boblight is, I’m afraid 🙂 Milight bulbs react to radio waves sent at 2.4 GHz frequency. So if that boblight controller works at the same frequency, you might have a shot, but even so the chances are scarce, since it needs to send the right codes, which are understood by the light. You won’t know for sure until you try it, but I’m guessing it won’t work.

  34. Hi,

    since days in my free time I am trying, also with google….. no luck.

    I changed the value 0x02 to 0xB5 and compiled. This sould change with command
    ./milight 0 b 1 all lights to hi ?????

    What is sendCommand (0x4E, codes[brightness – 1]);

    bool sendBrightnessCommand (int zone, int brightness)
    char codes[19] = {0xB5, 0x03, 0x04, 0x05, 0x08, 0x09, 0x0A, 0x0B, 0x0D,$
    0x0F, 0x10, 0x12, 0x13, 0x14, 0x15, 0x17, 0x18, 0x1B};
    bool result1 = sendOnCommand (zone);
    usleep (100000);
    bool result2 = UDPSender::sendCommand (0x4E, codes[brightness – 1]);
    return (result1 && result2);

    The best would be to have a byt 0 and 1 in the .conf file, 0=RGBW and 1= white bulps.

    If you send me your adress I send you a withe bulp for thesting for free.:-)

    Thanks again and regards


  35. Hi Thomas!

    Thank you for the offer to send me a white bulb, but I can’t accept it 🙂 It would take at least 3-4 weeks for it to get from the US to Romania anyway… Instead I can offer this: when I’ll have a bit of time, I’ll try to put those codes into place and then send you the result, so you can try testing yourself. The only problem with this is that I can’t promise that it will happen any time soon. I’ve got a complicated situation at work right now and also in my personal life and I’m arriving home near midnight every day…

    Anyway, getting to the point, in the function that you pasted here, you see a declaration of an array called “codes” with 19 elements. This means that for RGBW there are 19 distinct steps for changing the brightness. YOur white bulbs have 26 distinct steps instead, so the first thing you need to do is change the size of the array from [19] to [26]. After that you need to get rid of the current codes in the array (0x02, 0x03, …, 0x1B) and replace them with your own 26 codes: 0x02, 0x03, …, 0x1B, as in the list of codes you wrote earlier. Other than that, the first byte of the command seems, which is 0x4E for RGBW, has to be changed to 0x35 for white, so you have to change the line “sendCommand (0x4E, codes[brightness – 1]);” to “sendCommand (0x35, codes[brightness – 1]);”

    Let me try to explain further: the line “sendCommand (0x4E, codes[brightness – 1]);” has two main parameters. The first value (0x4E for RGBW, 0x35 for white) tells the bulb that what you are trying to change is the brightness. The second value is taken from the array of brightness codes that we have just discussed and it tells the bulb the actual brightness value that you wish to apply.

    So to summerize, your sendBrightnessCommand function should look like this:
    bool sendBrightnessCommand (int zone, int brightness)
    char codes[26] = {0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B};

    bool result1 = sendOnCommand (zone);
    usleep (100000);
    bool result2 = UDPSender::sendCommand (0x35, codes[brightness – 1]);

    return (result1 && result2);

    In theory this should work, in practice, only you can test it 🙂

    Good luck, let me know how it goes!

  36. Hi,

    I did exactly what you wrote,compiled. ( cnaged in a diferent file also from 1-19< to 1-26.

    Made some progress, but still not working correctly.

    when I but instead of 0xE4 0x35 and do ./milight 0 b 1-26, the lights turn on but regardless off 0 b 1 or 2 or 26 the dimm level is allways the same.

    According to the code 35 is all lights on.

    Then I changed the code from 0x35 to 0x3C which is brightness up.

    Now everytime a do ./milight 0-4 b 1-26 the light go up one dimm level, all or per zone.

    Meanig that wehn I enter 6 or 7 times ./miligt 0-4 b 1-27 the zones or all go to max.brightness.

    If I understan it correct, behind the 0x02-0x1B (26) there is a different dimm level, meanig, from ./milight 0 b 2 to ./milight 0 b 3 the level sould go up one step.

    The question is now, where do I find the correct value behind 0x02-0x1B
    or how is it defined and where do I change it.

    Best regards to Romania from Switzerland.


    • Hi Thomas!

      Oh, I thought you were from the US… I don’t know why… best regards to Switzerland too 😉

      What you wrote is all correct. The hexadecimal values 0x02 to 0x1B represent brightness values and I saw them here: http://www.limitlessled.com/dev/

      According to the same web page, 0x35 is the code which is used to set the brightness of white bulbs by specifying an exact brightness value (globally for all zones). If you change this to 0x3C, it’s normal that it will increase the brightness by one increment regardless of what you specify as parameter, because 0x3C is the code for increasing brightness by one increment, not for setting it to an exact value.

      It’s hard to imagine what the problem could be… in theory you’re doing the right things. Maybe try to substitute 0x35 with the code which sets brightness for the first zone, then try setting the brightness of the first zone to different value, see if that works…

  37. Hi,
    I am away for 10 days so I only can test my raspberry over the internet with milight app ( and my wife on the phone to see what it does):-)

    What I found out from Limitlessled:
    Mail from them:
    Sorry my mistake for not reading closely, I thought you were talking about RGBW

    DualWhite only as up/down or full.
    Friend LimitlessLED_Command_WHITE_BRIGHTNESS_UP As Byte() = New Byte() {&H3C, &H0, &H55}
    Friend LimitlessLED_Command_WHITE_BRIGHTNESS_DOWN As Byte() = New Byte() {&H34, &H0, &H55}
    Friend LimitlessLED_Command_WHITE_GROUP_1_ALL_ON As Byte() = New Byte() {&H38, &H0, &H55}

    Only RGBW has increments.

    Friend RGBW_Brightness10percent As Integer = &H2
    Friend RGBW_Brightness14percent As Integer = &H3
    Friend RGBW_Brightness17percent As Integer = &H4
    Friend RGBW_Brightness21percent As Integer = &H5
    Friend RGBW_Brightness24percent As Integer = &H6
    Friend RGBW_Brightness28percent As Integer = &H7
    Friend RGBW_Brightness32percent As Integer = &H8
    Friend RGBW_Brightness35percent As Integer = &H9
    Friend RGBW_Brightness39percent As Integer = &HA
    Friend RGBW_Brightness42percent As Integer = &HB
    Friend RGBW_Brightness46percent As Integer = &HC
    Friend RGBW_Brightness50percent As Integer = &HD
    Friend RGBW_Brightness53percent As Integer = &HE
    Friend RGBW_Brightness57percent As Integer = &HF
    Friend RGBW_Brightness60percent As Integer = &H10
    Friend RGBW_Brightness64percent As Integer = &H11
    Friend RGBW_Brightness68percent As Integer = &H12
    Friend RGBW_Brightness71percent As Integer = &H13
    Friend RGBW_Brightness75percent As Integer = &H14
    Friend RGBW_Brightness78percent As Integer = &H15
    Friend RGBW_Brightness82percent As Integer = &H16
    Friend RGBW_Brightness86percent As Integer = &H17
    Friend RGBW_Brightness89percent As Integer = &H18
    Friend RGBW_Brightness93percent As Integer = &H19
    Friend RGBW_Brightness96percent As Integer = &H1A
    Friend RGBW_Brightness100percent As Integer = &H1B

    So this will not work with your software.

    I will now make a bash script to overcome this issue. I will send it for your info as soon its working in a test mode.

    Best regards

  38. Hi,
    below for your info find script the does a test function as follow:
    Zone 1 go on for 0.8 then off, Zone 2 go on for 0.8 then off, (until Zone 4)
    After sleep 2 all 4 zones go on for 0.1 followed by the 10 x dimm up, until the reach full.
    Then sleep 0.1 all on, sleep 0.1 then 10x dimm down until lowest.
    Then sleep 0.5, then turn off 4-3-2-1.

    This a can run with crontab -e and it runs very well for test purposes.

    This works now perfectly for my needs, with this commands I can do what ever I want.
    This is the first time a made a project like this, as you know I am not a programmer……and there are probably other way to to this.

    Thanks again for your kind help.


    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 on
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 off
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 2 on
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 2 off
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 3 on
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 3 off
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 4 on
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 4 off
    cd /home/pi/Thomas/milight_sources/
    sleep 2
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight on
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight 1 b 1
    /home/pi/Thomas/milight_sources/milight 2 b 1
    /home/pi/Thomas/milight_sources/milight 3 b 1
    /home/pi/Thomas/milight_sources/milight 4 b 1
    sleep 0.1
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight on
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.1
    echo -n -e x34x00x55 | nc -u -q 1 8899
    sleep 0.5
    /home/pi/Thomas/milight_sources/milight 4 off
    sleep 0.8
    /home/pi/Thomas/milight_sources/milight 3 off
    sleep 0.8
    /home/pi/Thomas/milight_sources/milight 2 off
    sleep 0.8
    /home/pi/Thomas/milight_sources/milight 1 off
    sleep 0.8
    cd /home/pi/Thomas/milight_sources/
    /home/pi/Thomas/milight_sources/milight off

    • Hi Thomas!

      I received your messages, unfortunately I don’t have the brain power to understand them right now 🙂 I’ll try to take a look in a day or two!

  39. Hi Thomas!

    OK, I have finally read and understood your recent comments.
    First of all I’m sorry to hear that white bulbs don’t offer the possibility to set their brightness directly. But it’s good to know that you managed to do the dimming using the up/down commands. Thanks for the bash script! As I don’t have white bulbs, I won’t be using it, but perhaps some of my readers will 🙂

    Also, congratulations for having the perseverance to pull it off. It took a long time and I imagine that you’ve spent quite some hours on this project. Beware, though, the feeling of success is addictive. Pretty soon you’ll be working on hobby projects like this all the time 🙂

    If you’ll need my help with the lights in the future in some different aspect, let me know 😉


  40. Hi,
    For easy integration with my openelec system I took the liberty to convert your sources to python. For anyone who is interested, you can find the code here: http://pastebin.com/bctT8qBS

    Please note that the only diff with the original program is that the zone command is mandatory.

    Thanks for your original program and the nice article!

  41. I am very new to all of this and I am learning slowly. I bought a 9w RGBW bulb and a wireless controller. I have the IOS app up and running and that was a process syncing the bulb. I am now ready to use my pi and get a more personalized home automation. I have downloaded the milight_binaries file and I see three files.

    First question how do I find my IP address to put in my conf file?
    Second question where do I find the Port number?

    Next, I have got the ssh running on my windows 9 pc and I can look through files on my pi. I get to the directory of milight_binaries and try to ./milight and it either wont work or say permission denied. so I looked into it and found that sudo command but that still does nothing.

    Please any help would be much appreciated!! Thanks in advanced

    • Welcome aboard the WiFi LED bulb crew 🙂
      The IP address that goes into the conf file is the IP address that your router assigns to the MiLight bridge. You have to go into your router’s config page (usually at and find the connected devices and tryto figure out or guess which one is the MiLight bridge. Put that into the milight conf file, save it and try running ./milight again. If you got the IP right, it should work. The port number can be left as it is unless you changed it in your milight wireless bridge (but I guess you did not).
      If your router allows it, it might be a good idea to assign a permanent (fix) IP to your milight bridge, otherwise it will change from time to time and you’ll have to rewrite the conf file every time to make it work again.

      • Thank you so much! I did all of that found the connected devices page. However, It still keeps saying permission declined. Is there some settings I need to change on my pi? I tried all of the ip addresses listed as well.

      • Thank you very much for the help! Ok I did everything like you said. I have tried every ip address in that list and they all come up with that permission denied? Is there anything else you can recommend?

        • Hi! You’re welcome 🙂

          Please tell me what step you are trying to execute exactly when you get the “permission denied” message? Are you trying to run the milight executable (./milight)? If so, then please check the access rights of the executable (run “ls -l” in that directory). Make sure that the user you’re logged in with has execution rights. What if you try with sudo? Does it work then? This permission denied has nothing to do with the IP. You have another problem there. Let’s try to figure it out. You can post here the result of “ls -l” and specify which user you’re logged in with. Maybe I can spot the problem. Until then just try it with sudo, that should get rid of the permissions problem.

          • I am trying execute the ./milight yes!

            This is what I have been doing. I have tried sudo and it doesn’t seem to work…

            [email protected] ~/Desktop $ cd milight_binaries
            [email protected] ~/Desktop/milight_binaries $ ls-la
            -bash: ls-la: command not found
            [email protected] ~/Desktop/milight_binaries $ ls -la
            total 44
            drwxr-xr-x 2 pi pi 4096 Feb 23 23:57 .
            drwxr-xr-x 4 pi pi 4096 May 15 01:55 ..
            -rw-r–r– 1 pi pi 27779 Feb 23 23:53 milight
            -rw-r–r– 1 pi pi 25 May 16 01:34 milight.conf
            -rw-r–r– 1 pi pi 1883 Feb 23 23:57 Readme
            [email protected] ~/Desktop/milight_binaries $ sudo bash
            [email protected]:/home/pi/Desktop/milight_binaries# ./milight
            bash: ./milight: Permission denied
            [email protected]:/home/pi/Desktop/milight_binaries#

    • Hmm, I think I missed the obvious when I first read your pasted message 🙂 Look at the access rights of the milight executable: -rw-r-r-. Even the root has only read and write access (r and w) but not execute rights (x). Fix it like this: “sudo chmod 770 milight”. Let me know if it helped 😉

      • IT WORKS! thanks so much 🙂 sorry for being so troublesome but my ip address is not showing up on my connected devices. Do all ip addresses always show up? I have a Belkin router.

        • You’re welcome 🙂
          I don’t really have any experience with routers, except with the 2 or 3 that I owned along the years. I’d say everything should show up, but God only knows how some routers are designed…

  42. Ok perfect I figured it out finally! What am I doing wrong when inputting commands?

    [email protected] ~/Desktop/milight_binaries $ ./milight
    MiLight/LimitlessLED/EasyBulb RGBW v3.0/v4.0 Command Line Utility
    Version 1.03 (02/23/2014)
    ———->>>>> http://iqjar.com <<<<<———-

    Works with the MiLight wireless bridge v3.0/v4.0 and with the MiLight RGBW LED bulbs.

    For technical details visit: http://www.limitlessled.com/dev/

    Usage: ./milight [ZONE] COMMAND [PARAMETER]

    The optional ZONE argument specifies which bulb zone the command refers to.
    If this argument is omitted, the command is considered to refer to all zones.
    Possible values:
    ALL/0 – All zones
    1 – Zone 1
    2 – Zone 2
    3 – Zone 3
    4 – Zone 4

    The COMMAND argument specifies the command to be sent to the given bulb zone.
    Some commands require a parameter (see below).
    Accepted commands:
    ON – Turn the bulbs in the given zone on.
    OFF – Turn the bulbs in the given zone off.
    WHITE/W – Set the color of the bulbs in the given zone to white.
    DISCO/D [+/-] – If no parameter is specified, turn disco mode on.
    The '+' optional parameter increases the disco speed.
    The '-' optional parameter decreases the disco speed.
    BRIGHTNESS/B VALUE – Set the brightness of the bulbs in the given zone.
    The VALUE mandatory parameter specifies the brightness
    and must be an integer number in the range 1-19.
    COLOR/C VALUE – Set the color of the bulbs in the given zone.
    The VALUE mandatory parameter specifies the color
    and must be an integer number in the range 0-255.

    [email protected] ~/Desktop/milight_binaries $ OFF
    -bash: OFF: command not found
    [email protected] ~/Desktop/milight_binaries $ off
    -bash: off: command not found
    [email protected] ~/Desktop/milight_binaries $ 1
    -bash: 1: command not found
    [email protected] ~/Desktop/milight_binaries $ ALL/0
    -bash: ALL/0: No such file or directory
    [email protected] ~/Desktop/milight_binaries $ milgiht 1
    -bash: milgiht: command not found
    [email protected] ~/Desktop/milight_binaries $

  43. Hi corbin! Didn’t this work before? I seem to recall having you said that it worked… Or does it work in some cases and you get permission denied in other cases?

      • Hmm, I think there might be a misunderstanding here. The milight app does not work like mysql (for example). The workflow is not to open the app, keep it running and issue commands, instead the app runs separately for a brief moment for each command.

        Incorrect sequence of commands:
        milight <-- here you start milight on <-- here you assume that milight is still running (incorrect!) off Correct sequence of commands: milight on <-- milight starts, executes the on command and terminates milight off <-- milight starts, executes the off command and terminates So if you can run milight without any parameter, that's a sign that you have the correct access rights. but if you can't run it with the on/off parameter, then there's something wrong while it's trying to execute the command. Perhaps it cannot send UPD commands, fails to open socket or something. Try enabling the verbose debug mode (see previous comments left for other readers).

        • Set the third line in the milight.conf to VERBOSE and let me know what kind of errors you get when running “./milight on”.

  44. This is so cool!

    Already having a ton of fun playing with it.

    Does anyone have a good web frontend for scheduling tasks that can be used in conjunction with this? (I want to automate from web interface based on dates, times etc!)

  45. Hello, I am very impressed on this, how simple the command line milight program works. I have a question about that, is it possible to READ the status of the milight bulb and/or wifi controller?

    As in, if bulb on or off, what mode it could be in, and what brightness and colour its at?
    Thank you

    • Hello William!

      No, unfortunately the communication between the radio transmitter (which is either the wireless bridge or the remote control) and the bulbs is one way. You can only send commands to the bulbs, it is not possible to read their status. It’s a pitty, I would have like this feature too, but it seems they have not included it.


    • Hello! Make sure that the milight executable file has the right permissions set. Try this, for example: “sudo chmod 775 milight” (run this in the directory of the milight executable).

  46. Thank you for the answer but I already tried it … 775 770 777 … nothing work … is the distribution of linux mater ? … and 32 or 64 bit ?

    (sorry for my bad english )

  47. I realized that the milight controller does not work offline, i.e. when the router blocks internet access for it. Does it mean that the device cannot be used in a wireless network not connected to the internet? Can anyone confirm this?
    At least the Android app says that the device is offline after I configured my wireless network via the app…

  48. IQJAR, thanks for writing the software. After a couple of evenings and some patience, cron is now controlling my lights.

    A question for you and Thomas regarding the white bulbs (as I have 2x RGB and 1x White): any help on how to control that one too?

    Nothing fancy, just on/off. Controlling it from tasker works (using 0x350055 and 0x390055), so I’m trying to figure out how to get this inside the script.

    • Hi ferdi!

      If you have the instructions codes for your own bulbs (as used by tasker), just replace the codes in the appropriate source file and rebuild the application. Let me know if you need more detailed help.

      • I see that more than one person is trying to use my app with not RGBW bulbs. Perhaps it would be benefficial to modify my app to read the codes from some kind of config.txt and everybody could put their own codes there. I might do it one day, when I’ll have the time, but I can’t promise anything soon.

  49. Well, the white ones have their uses too. Though I must say that if I were to do it all over again, I would prolly skip the white ones and buy RGB instead. I started with white because they were cheaper but quickly ordered two colored ones.

    As for editing and recompiling. How to make sure that I won’t be losing what I have now (which is a set of working scripts which I’ve spent a lot of time on)? Can I recompile with new lines, whilst keeping everything I have?

  50. Well, the white ones have their uses too. Though I must say that if I were to do it all over again, I would prolly skip the white ones and buy RGB instead. I started with white because they were cheaper but quickly ordered two colored ones.

    As for editing and recompiling. How to make sure that I won’t be losing what I have now (which is a set of working scripts which I’ve spent a lot of time on)? Can I recompile with new lines, whilst keeping everything I have?

  51. Hello,

    I want to know if the Milight bridge could be eliminated and then communicate with the bulbs directly from the Raspberry Pi?

    I feel its complicated with the limited number of zones (four) in the Milight bridge which limit the requirements in certain scenarios. Would like to hear your opinion about it.

    Thanks. Btw your article is amazing. I really liked the way you carried it.

  52. Hello…

    Is there any way to replace the Mi-Light wifi bridge with raspberry pi?

    I have seen lot f issues with connecting the MiLight wifi bridge to the home wireless network. I think it would probably allow to control more devices.

  53. Thank you very much for posting this. I have it successfully working on my mac in terminal. I am currently using two WiFi boxes and 8 zones. It looks like this code is only meant to control one WiFi box and 4 zones. How could I compile a second program for the second box?

    I’d like ./mlight to control zones 1-4
    ./mlight2 to control zones 5-8

    I imagine this is pretty easy but I can’t figure it out. Thanks!

    • Hi Chris!
      I’m happy this helped you 🙂 I was just thinking about the exact same thing that you’re asking a few weeks ago: how I would use this utility if I got another WiFi bridge.
      The better and more complicated solution would be to modify the code to accept one more argument which would tell it which WiFi bridge you wish to control. It would have to be programmed to accept and understand one more input parameter from command line. Perhaps I’ll do this one day, but definitely not any time soon (because I don’t have time for this now). Or somebody else might do it in the meantime.
      However there is a workaround until then. Create 2 directories and copy the milight executable inside each. Edit the milight.conf inside each directory with the IP address of each WiFi bridge. For example:

      /soft/milight/01/milight – executable 1
      /soft/milight/01/milight.conf – conf file 1
      /soft/milight/02/milight – executable 2
      /soft/milight/02/milight.conf – conf file 2

      edit conf file 1 to contain the IP address of the first WiFi box (eg. and the second conf file to contain the IP address of the second WiFi box (eg.

      Now you can control the two Wifi boxes separately by calling the milight app from the 01 or from the 02 directory 🙂

      • Thanks for the reply, that makes sense. If I make two directories, structured the way you have asked, in my root directory the executable looks for the milight.conf files in the root directory every time. Is there an easy way around this?

        Chris-MacBook-Pro:~ Chris$ ./milight/01/milight on
        Unable to open milight.conf for reading!
        Using default address ( and port (8899).

        • Hey there! I’ve fixed the problem you’re describing with the conf files a while ago. Download the latest files (again) and give it another try. Let me knwo if you still have problems.

  54. Thank you for the nice piece of software!
    I modified your source to handle ‘night mode’ and use 20 brightness values from 2 to 27. Also made a fade in and fade out function for smoother turning.
    The specification says the night mode not implemented in the RGBW bulbs but fortunately it’s not true, actually they work in night mode (this is a minimum amount of white light, much smaller than you can achieve with the minimum brightness setting).

    Best regards,


    Drop me an email if you interested in the changed source files.

  55. I own some dual white bulbs as well as RGB ones. For anyone to whom it my be useful, here


    is a port of the original code for use with the dual whites.
    In src/command.cpp lines 66, 83 and 88 you may wish to try lowering the usleep value. The smaller value you can get away there the better. I can get away with smaller values but that might be because I’ve done the mod described here http://servernetworktech.com/2014/09/limitlessled-wifi-bridge-4-0-conversion-raspberry-pi/ to my bridge.

  56. Apologies, the permissions of the base folder in that archive ended up being 0 for group and world. It means it works fine if you run it as the user who unpacked it, but it won’t work if called from a cgi if Apache is typically running as user www-data or similar.
    After unpacking, in the directory where it was unpacked, type command chmod 755 milight_sources_dw

  57. Well this is really strange and unexpected. A mistake in my code led to a very useful discovery. You can get around the problem of there not being any zone specific codes for brightness up/down and colour temperature up/down on the dual whites. By sending the zone specific “on” command, pausing 100ms, then sending the generic brightness up/down or temperature up/down command, only the “in zone” bulbs respond.

    The only way it can be is that when bulbs detect an “on” command, if it’s not the “all zones” or their zone’s own “on” command they lock out and don’t respond to brt and/or temp up/down commands for a time out period.

    I’ve implemented this in an updated version of the code.


    Have removed the warning about zone having no effect, as for me anyway, zone selectivity is working now for all commands.

    • You’ll have to find my physical location first 😉
      Yeah, I have kind of suspected lately that they have no security… but do we really need to care about it? What’s the worst that can happen? The lights turn on or off “accidentally”? And what is the probability of somebody playing with exactly our bulbs? Where I live… 0%. 🙂

  58. Hi iqjar! Thank you so much for writing this tutorial. I have followed the directions and my raspberry pi is now controlling the lights! It is pretty awesome. I do have a question for you, or anyone else willing to answer it.

    In this tutorial, you mentioned that this program could potentially be called from a website. I am trying to do exactly that. I have already made my pi a fully functional LAMP server. This is where my question comes in. What are the next steps I need to take to be able to control the lights from the website? Any help would be greatly appreciated.

    Thanks again for this tutorial! I learned a lot doing it!

    • Hi Max! I’m happy you like it 🙂 Well, the question is what kind of website you have exactly. What you need to do is somehow call the milight program when a button is pushed on your web interface or something like that. The details of that are, of course, completely dependent on the technology that you use.

  59. Pingback: Wireless MiLight automation with Raspberry Pi + IFTTT + Evernote + Geeknote | JailBrokenLeg – Mutterings of a lame *nix geek.

  60. Hi to all…

    Thx iqhar for excelent tutorial but…

    I’am beginner to the linux and I have question…
    If it is possible to run voicecommand 3.0 script with Your aplication to control bulbs by voice? If Yes…maybe You make short tutorial how to do that??


  61. Hi iqjar

    I am new to linux and raspberry but I’m reading that with Your scripts there is possibility to control Milight bulbs with voice. I have question…Haw to do that?

    Thank You for an answer

  62. Hi iqjar!

    Sorry I didn’t respond after posting that question for ever ago! I figured everything out on my own, after some very extensive googling, I resolved the problem. What was happening is the website didn’t have permissions to run the script I had created locally. I put the milight binaries into the cgi-bin folder on my apache server, and set the permissions of that folder and everything in to to 754 and was able to successfully call the script (which calls the binaries) and it works flawlessly. Thank you for this incredible tutorial! You are truly a genius.

  63. Hello.
    I have the old wifi box.
    I can’t change any color (RGB Strip).
    I can access to milight wifi box ,I can see only upgrade.
    I use only on iPhone app.
    How can I upgrade the wifi box?

    • Rami, if you want answers you’ll have to formulate a more exact question, I can’t even understand what your problem is…
      What does “old” mean? What version?
      What do you mean by “I can see only upgrade”?
      You can’t upgrade milight wireless bridges, as far as I know.

  64. Hi,

    First of all I’d like to thank you for your contribution to the community. I love the Milight packages and the simple way to install it.

    I have a question, which I hope you can help me out with.

    This page states support of “MiLight RGBW light bulbs”.

    I order some Milight stuff:
    1. RGB Led Strip dimmer
    2. RGBW Led Bulb
    3. Single colour Led Strip dimmer

    I have now used your tool to control (1) and (2). Will it also be able to operate (3)?

    It is a bit hard for me to replace the current non-milight dimmer. Therefore it would be great to know if you think this will work anyway.

    On a Milight remote this won’t work, because it seems that the controllers are typically used for a RGB(W) or White/Dual White setup (and I want to combine them).

    • Hi Tomson! Welcome to the Milight fan club 🙂 It’s hard to tell wether 3. will work or not and I’ve never tried such a thing, but my guess is that it won’t work.

  65. Thanks for everything so far!

    Are there any limitations as to how active animations can be? For example, Is it possible to have 2-4 zones actively fading brightness and hue differently (on a custom animation)?

    My goal is to create a multi-zone chase pattern animation. Do any concerns come to mind?


    • Hello Josh!

      Well, it’s hard to give you an exact answer, since I haven’t tried this myself. But I think it should work. I can’t think of anything that should prevent you from creating that multi-zone chase pattern. Let me know how it goes, I’m curious.

  66. Great stuff and it all has worked great for me here in Canada. I would like to ask if it would be possible to control individual milights in the same group? I have 10 pot lights in my main games room and would like to be able to change each of them separately.

    Thanks again for the great info Kev

  67. I have all done 🙂 so my lights are going on and off and so stuff ^^
    now i have a arduino with a sound sensor.. how can i use this 2 together?
    Wenn the sound is over 500 than turn the lights on like ./milight on ?
    Can you help me? i dont understand how to talk to each others togehter

  68. Hello, first of all great work!

    I have an application where I want to control a single RGBW led strip over my own UI through a website. I noticed that mlight is selling wifi-rgbw controller (http://shop.easybulb.com/controller-only-for-easybulb-plus-rgbw-strip-led-light/). Do you think that they are using the same protocol/format for the communications so that your code would work straight?

    The problem for me is that most of the wifi led controllers use closed protocols and I’m using embedded boards (pi, arduino) with wifi to control also other devices. Having 2 Wifi receivers is not a problem as long as I could control all devices through a single UI. There seems to be an open HTTP API for the lights but I would prefer local control.

    • Hello Sepsu!

      Yes, I am using several LED strip controllers from them. they work just the same as the milight bulbs. Just be careful what you buy: RGB or RGBW led strip controllers. If your LED strip does not have a dedicated white channel, then you need the RGB, not the RGBW!

      • Hello,

        Thanks for the quick reply! Yeah, I’m using RGBW so it will be fine. I will try to port your code to arduino/nodemcu, I have already websockets in use so sending packages shouldn’t be a problem now that I know the format. Thanks again, this helped a lot! I will let you know if I manage with that.

  69. Hello,

    Thank you very much for this tutorial!
    I have soem problems with this. I use a milight lamp + wifi bridge + raspberry pi connected throught Ethernet.

    The wifi bridge works great when I am using the official Android App.
    But I don’t manage to control it with your program. I well configured the configuration file with the right IP (which is reachable, as I can see with a ping command).

    Do you have any idea to help me handling it?

    Thank you very much!

    • Try putting it into verbose mode via the config file, maybe you can see some error message. I know you say that you use the right IP but in my experience in 99% of the cases when it does not work, the problem is that you’re using the wrong IP address, so you might want to double check that.

  70. Thanks man i made a small setup here and have 3 milight working nice with cron jobs on raspberry pi.

    Fantatisc thanks a lot for the program.

  71. Dear all..
    Is there no simple wiki like:
    Sudo apt-get install
    then this
    thsn that
    and a simple working example in a script file??


  72. Hi.
    Thank you for this great job.

    I’ve bought a
    wifi controller

    Milight GU10 RGBWW

    and the remote

    Everythings work with remote an Android App.
    I’ve tried the milight_binaries but nothing happens.

    Here is what I get ( is the correct Ip address):
    ./milight on
    Sent UDP command 0x42 0x0 0x55 to

    I don’t know (and I can’t find) the wifi controller version.
    Does the binaries work with the controller and lamp I’ve bought?

    • I don’t know if these lights are compatible with the milight binaries. The binary is supposed to work with RGBW lights, I don’t know about RGBWW. Also make sure you’re suing the correct IP address in the milight binary’s config file.

  73. Hi, I’m currently working on a fix for IBox(V6). Just asking to make sure that I’m not missing anything(kinda new to programming).
    Downloaded the sources and found the “commands.cpp” aswell as “udpsender.cpp”. My plan is to simply change the length and code that the program sends.
    -change the codes in to commands
    -change the order and length of “char command[3] = {code, param, 0x55};” in udpsender
    -change the length x in of “int bytesSent = sendto (udpSocket, command, x,” in udpsender to match the length of command.
    -Changing the verbose output aswell.

    Anything that I’m missing? Or is there a way to call the send function with custom commands from the terminal? Like …..send(0x31, 0x00, ……….)?

  74. This is great! Nobody else out there has really put this together like you have! Any chance anybody out there has made the adjustments for the v6 controller? I have the code and am able to send the UDP to the controller, but unfortunately the code has changed for the v6 and functions don’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.