line

The Lights Project

Debugging WiFi lights and BLE trackers

by Dalibor Lanik

line



In my lights project, I am using several Yeelight Wi-Fi smart bulbs and several BLE trackers as switches to these bulbs. In order to work, all of these must have some kind of connectivity, so it is not hard to imagine that something fails, when one device is powered down, rebooted or simple power failure occurs. I spent a lot of time trying to make them work again - the thing is that these devices work great when all components are working, but when one device fails, it is not a simple matter of turning it back on and it connects and continues working. Often it works, but sometimes it just refuses to connect. That's why this small "manual" on what to do, so you don't have to spend time trying all combinations and pulling your hair out on failure.

YEELIGHT LIGHTS - CONNECTING

Let's start with Yeelights. For Yeelights, the most important thing is Wi-Fi connectivity. Once you connect them, they'll work. There could be problems on devices discovery, so here are a few tips how to connect them.

* Make sure your devices are on the same network. Meaning not just same VLAN, but same SSID and frequency. These devices connect to 2.4Mhz band on your Wi-Fi router, so if your router has dual 2.4Mhz and 5Mhz bands, make sure all involved devices are on the same band. Not that if they're not it will not work! Sometimes it works, but then, sometimes it doesn't. So just to be on the safe side, connect all your bulbs, tablets, phones, etc to the same SSID and same band.

* Also, turn off (if you have it set) MAC address filtering, and

* Make your SSID visible.

* If connection fails, test the connectivity to the servers the bulbs are trying to connect to. The server Yeelights are connecting to is
ot.io.mi.com (China server) or sg.ot.io.mi.com (Singapore server), so make sure your DNS is translating this and try pinging the server from your PC. for DNS problems, try using manual DNS assignment to 8.8.8.8 (Google's DNS).

* Once your bulbs are connected, go to your router and assign them static IP addresses. Some routers call this "IP reservation". That means that your bulbs will always be recognized by their MAC addresses and will always get the same IP address.

YEELIGHT LIGHTS - DEBUGGING

Now, if everything is working - great. but what if a power failure happens? It is very probable (if you have several Yeelight devices) that at least one device will fail. And even if you make it work again, after playing with settings for 30 minutes, the chance is that you will break something else! Trust me! :) So the best way to restore full functionality is to do it in this order:

* Turn off your router
* Turn off all your Yeelights
* Turn on the router and wait like 1 minute
* Turn on all your Yeelights, one at a time
* Wait couple of minutes
* Run Yeelight app to check if all bulbs/light sources are visible
* If not, wait a bit and refresh the list of devices

This will guarantee that you will have your lights system up and running in a couple of minutes. Happened to me like 3-4 times and worked every time.


BLE TRACKERS - DEBUGGING

Now, as I wrote in my other article about using BLE trackers as light switches, these work great, but again - if the connectivity breaks, you will run into problems. I spent like 30 minutes trying to get it to work again after my son messed something up with the tablet. This is the correct procedure:



* Turn off all your BLE trackers (long press until it beeps)
* Run iTracing2. It will already be active in your notification area. There you will have a list of all the BLE devices.
* Untick one by one
* Tick one device
* Press on the device, screen with range circle opens
* Turn on your BLE device (one at a time)
* In couple of seconds, iTracing2 will find your device.
* Do this for remaining devices.

So as you can see, the trick is not to restart the phone/tablet, the app or turn off/on Bluetooth on your device - it is to untick the devices in iTracing2.



CONCLUSION

I hope this helps you and saves you some time if you are using the same setup.

 








line