Monday, December 24, 2018

Node Red and ESP32

I'm still pretty new to python and node red... I'm experimenting with upython on ESP32 and node red on raspberry pi. I'm more of a hacker than a programmer... I find examples that I can modify to do what I want. Several good examples here... 

https://discourse.nodered.org/t/examples-of-colour-change-button-and-switch/3650

There is a new feature on github called gists... a way to share bits of code that are not so easy to share via a web page such this blog which is hosted on google blogger. You can copy the code in the window below and then import it into node red.



The code is for the bottom bit below as the top portion is avalable from the link above. The top one was the example I found and the bottom one was after modifications for my use. The original only changed the look and label. I've added the capability to send custom topic and payload to turn on a relay controlled by an ESP32 running upython. It acts as a client and the raspberry pi acts a the broker using the mosquito protocol. Node red is a package running on the raspberry pi which provides a graphical interface to create flows like the ones below to direct information to and from client devices on your local network.






Friday, March 30, 2018

Alexa Home Automation

I spent the last couple of weeks getting up to speed on some of the home automation tools that are available off the shelf and home brew versions as well. Many of the components can be used with the Alexa and similar devices. I picked up a couple of the Echo Dot 2nd generation devices and have some of the remote control devices that work with it on the way.  I can see where this thing might be a bit addictive as well as being capable of some pretty sophisticated uses.

I picked up one of these ESP32 boards and it's what got me on the home automation bandwagon. I didn't really know much about it when I bought it but in researching some of its capabilities I learned that it and its predecessor the ESP8266 can be used as a remote device to be controlled by an Alexa. The 32 board is still pretty bleeding edge but has a ton of capability. It has both WiFi and Bluetooth connectivity and a great deal of  information about them is available on the web.

It was a fairly easy undertaking to set up the ESP32 device as a webserver on my home wifi network that can control via a web page... 8 relays that can control lights or other low current devices.


Control by Alexa is not so well supported on the ESP32 but there are many examples using the ESP8266. I have a couple of them on the way.

I also have some Sonoff devices on the way as well that work with the Alexa or with a phone app right off the shelf.

I will be posting more on this undertaking as these parts arrive and get put online.

Stay tuned 😀

Sunday, March 18, 2018

ESP32 and You

I recently bought one of the ESP32 development boards without really knowing what it was but it looked like it had potential. The first disappointment is in the package itself... it is not breadboard friendly and it seems no one has really attempted to address this with a breakout board that would make it more user friendly.

Finding good examples too is a bit of a tester... lots of smoke and mirrors and not a lot of user friendly help online. There are lots of high end undertakings out there, Luanode, Python, Fauxmo, AsyncTCP, NodeMC, even a few attempts to create a stand alone Alexa type device on ESP32. It's all a bit mind boggling for an old arduino hacker like me. Part of the problem is that this board is an upgrade of the ESP8266 and most of the tutorials try to show how integrate them both into their project. They are different enough that this only seems to make it all the more difficult for the beginner.

To be fair they are both relatively new and are both targeted more to developers that to ordinary hackers like myself. To me one of the most interesting uses of this device is as a remote device that can be controlled by an Alexa... and this will be the focus of this site.

I've spent the past couple of days looking for examples of projects that use the board in this way. I found one with promise but seemed to have lost track of it. In it the board was connected to several relays and  programmed to be found by an Alexa device. The Alexa would learn what devies were connected to it and what voice commands would be used to turn these things on and off. You could also group thing together such and all the lights in a particular room could be turned on or off with one command or you could control them individually. Try as I might I've not been able to find that particular application again.

So I invite you to join me in this undertaking to try and solve this mystery. I'm still waiting on a few components to experiment with and probably the easiest thing is to just use off the shelf stuff that is already available to do what I have in mind. 

Ironically I had no Alexa and didnt even know that they could be used to control remote devices. I do have one on the way and a few of the Sonoff devices to get the ball rolling. I also have a couple of the ESP32 devices on hand and an 8 relay device on the way.

So stay tuned and we'll see how it goes.