esp8266 ws2812b hostname triggered wifi light

Today I built a small wifi light which rotates in case a certain hostname (my smartphone) is in the local wifi. As these devices tend not to answer to ping or arp requests, and bonjour or mDNS where to slow, I crawl my dhcp server every five to ten seconds. Additionally i decreased the lease time of the dhcp to  improve the switch off response time. As my smartphone usually logs into my wifi instantly when I enter the house it’s usually switches on before the main door has been opened.

The interior of the lamp consists of seventeen ws2812b rgb leds which I controlled in an intermediate stage with the esp2866 opc code on github. As this would have required a constant network packages flow and a device delivering the UDP packages, I later on switched over to control the led animation by the esp8266.

Something I discovered today is that soldering the 2mm grid esp8266 upside down onto a 2.54 grid prototyping circuit board improves handling and speed, as well as the size of the final circuit.  You also can see the pin map information on the final product, which is nice.

After putting some hot glue on the board to prevent shorts and improve lifetime, I took some measurements regarding current consumption: about 0,1Amps at 5V, which should result to 0.5W with a constant rotating light and wifi crawling. This makes the device capable to be run on most USB power providers. The final result looks like this in action:

As the code is very specific and dependent on my local setup, I will not post it on github this time. Just one thing I would have found really helpful to find in the internet while I was struggling with a constantly without information resetting esp8266 would have been this:

Howto grab and parse a HTTP.Auth protected website with the esp8266 as a client:

In conclusion, this was a nice little project I really enjoyed doing in a sleepless night 🙂 And with about 10€ plus the lamp I got as a gift a long time ago, not that expensive.