Skip to main content

Use a ESP8266 to control your A/C via MQTT

We had some very (very!) hot days here in Sydney, up to 40 DegC over several days. After a day in the office, you open the door to your apartment and… 50 DegC 🙁 I looked for a solution to cool down home right after i left the office – with my phone – using MQTT 😉

Hardware

I am using three components for my project. The MCU, an adapter board and the IR-LED

NodeMCU

  • ESP8266
  • 4Mbyte ROM
  • On-board USB/UART

Grove Base Shield for NodeMCU

  • 5 Digital connectors
  • 2 I2C sockets
  • 1 Analog connectors (A0)
  • Power indicator LED

Shop | Wiki

Grove – Infrared Emitter

  • Voltage: 3.3-5V
  • Distance:10m

Shop | Wiki

 

Software

 

The Basics

The project is based on the Arduino core for ESP8266 and uses several additional libraries. I am using the platform.io IDE for development. The advantages are the fully integrated build and deployment process (via USB or over WiFi), the library manager and the code completion and linting. You can download my complete platform.io project here.

You’ll also need an MQTT server like RabbitMQ to send commands and receive the status. If you are familiar with Docker, you should read my previous post Dockerize RabbitMQ to get a server up and running in no time. If not: There are several binary pages on the RabbitMQ Website.

Read More

Install rtl-sdr on a C.H.I.P

Check your hardware

First you should make sure that your rtl-sdr stick is properly connected to your c.h.i.p and that your power source is suitable to drive the chip plus the rtl-sdr. Some of them are consuming more than 500mA (which is out of spec for USB2.0) which can cause the system crashing if under load.

Connect your rtl-sdr to the c.h.i.p, login and run lsusb -t. You should see an output like the one on the screenshot below. The last two lines are the rtl-sdr stick.

Read More

Setup a C.H.I.P in Headless mode (no screen)

So you got your C.H.I.P but unfortunately you can’t connect to a Display and you don’t have a keyboard available? This guide should help you to get started. You will connect the C.H.I.P to your wi-fi, update the software and install a vnc server to use the gui.

Initial connection

Connect you C.H.I.P via USB to your Computer.

Open your favourite terminal program and connect to the comport with 115200 baud. For windows you can use putty. On OSX i suggest using cu.

On OSX i am using this command sudo cu -l /dev/cu.usbmodem1423 -s 115200

If you’re connected and you don’t see any login screen just hit enter once

Login with the default credentials (chip/chip)

Read More