Close

A tale of two IP addresses

A project log for Smart switch for hubless smart bulbs

A switch to turn on, off, and dim hubless smart bulbs

seanSean 04/12/2019 at 17:590 Comments

It was the best of scripts, it was the worst of scripts. Ok, mostly it was the worst. I don't actually know python so that doesn't help. 

I built some fancy error handling into my script so that if it doesn't find the bulbs right away it keeps trying until it connects before starting the main loop that waits for button presses. I also added some code to reconnect if it can't find the bulbs when trying to send them commands. Yay! No more breaks in the script. 

Except it never connected. It just kept trying and trying and trying. I finally looked up the IP addresses for my bulbs. Imagine my surprise when they were different than they used to be!  That's when I remembered that the utility company recently cut power for a few hours to do repairs. When my router came back online, it reassigned IP addresses. 

Now I know I could easily work around this by setting fixed addresses for my bulbs, but that isn't user friendly to other people who want to use my project. I guess I'll have to double down and figure out how to find bulbs by MAC address instead. 

Bleh.

I'll let you know if it ever works. Meanwhile my new code is awesome. I'm still afraid of my power supply thing that I bought for $3 and I might never actually test it for fear of burning my house down. 

Discussions