The Invincible A personal archive of software, founder life, travel, and the occasional detour.
Randoms

Smart Home – ESP8266 module with NodeMCU

ESP8266 wifi module is going to be our endpoint where we will be controlling through our Homebridge device. For the moment, we will be simply controlling a 5V relay which will control the power of any electrical device ( ex: Lights, TV, Wall outlets etc )

NodeMCU is a firmware that allows you to program the ESP8266 modules with LUA script. And you’ll find it very similar to the way you program an Arduino. With just a few lines of code you can establish a WiFi connection, control the ESP8266 GPIOs, turning your ESP8266 into a web server and a lot more. In our case, we will only be needing two URL endpoints to switch on / off the relays. Which we can call from our homebridge device.

First things first, unless your module is having pre installed firmware, we need to write the nodeMCU firmware to it before we start. Thanks to the open source community, this is fairly simple. you just need the right tools.

 

I’ve bought the device with loaded firmware. you can follow these few steps to get your device up and running.

https://github.com/nodemcu/nodemcu-devkit/wiki/Getting-Started-on-OSX

If everything worked well, you should now be able to run lua scripts inside your module!

We will be using ESPlorer for that.

Related

More posts like this

Not Using AI Is a Choice, No more excuses

Frontier AI companies like OpenAI and Anthropic are competing hard, while open source models are catching up fast. This competition is driving costs down. The price per 1M tokens keeps dropping, which means you can do a lot more for a lot less. So the old excuse of 'I don't have the budget to use AI in my business' is quickly disappearing.

Read more
Day 5 of 31: Connections and Caffeine

The first Monday of the new year always feels like a reset button. For our service company, yesterday marked the official restart, and as expected, it was a busy one. The day was filled with catch-ups, follow-ups, and lots of reconnecting with clients who had patiently waited for us to get back into full swing.

Read more
Day 4 of 31: When the Day Slips Off Track

Some Sundays move at their own slow pace, and yesterday was one of them. I went into the weekend feeling excited to refactor a piece of code that’s been bothering me for weeks. But by Sunday evening, the work was still unfinished and instead of accepting that, I spent way too much time complaining to

Read more