Skip to main content

Basic D-duino code (OLED, WifiManager)

In a previous blog post I introduced to you the D-duino ESP8266 boards. In this blog post, I’ll show you a small Arduino code which is providing the basic functionality for my next projects.

What’s in the box

I am using the awesome WifiManager library. I will handle the configuration and connection to a WiFi network. If  the ESP is unconfigured or the AP is not reachable, it will start an access point by its own. You can connect to this AP and a caption portal will open. Scan for networks, select one and enter the password. The configuration will be saved in the EEPROM. No need to set the credentials inside of your code.

Over-the-Air update is also implemented. This makes it very easy to update the code without connecting the MCU via USB to the host. It’s also faster than serial uploads.

Last part is of course the OLED display. I am using the ESP8266_SSD1306 library. It has some very nice features like progress bars, several graph commands (lines, shapes etc.), pictures and of text.

Read More

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

ShopWiki

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

New toys – ESP8266 Modules

Yeah, new hardware to tinker with: a ESP-01 and a NodeMCU Board 🙂

Specs

The ESP8266 is a powerful and cheap SoC (System on a Chip) with onboard WiFi (b/g/n) capabilities. It has 16 GPIO pins, UART, i2c, SPI and QSPI for external flash memory.

ESP-01 Module

esp-01
ESP-01 Module

This very cheap module consist of o ESP8266, A PCB-Trace antenna and an external 1MB flash chip. It’s not breaking out every GPIO pins – just 2 (GPIO0 & 2).

This module has 8 pins: VCC & GND for power, RXD & TXD for serial communication, RST for reset (yeah, really :p ), CH_PD for chip enabled/disable and GPIO0 & GPIO3. This chip is intended for small projects or as a Serial-Wifi bridge.

Be aware: The module has no onboard logic-level-converter. So if you hook up this board to more than 3.3v, you will most likely see magic smoke !

You can get these board for ~3-6 AUD$ from eBay.

 

NodeMCU v2

NodeMCU (ESP8266)
NodeMCU v2

This module is a complete development board. It is utilising a ESP-12E which is basically a ESP8266, 4MB flash and an antenna on one small pcb. This pcb is soldered to the devboard which is powered by usb (3.3v step-down-converter), a USB-Bridge for easy programming and 2 buttons (reset and flash). You can use 10GPIO pins for your own projects – every of this pins is able to provide you i2c, 1-Wire and pwm functionality.

Again: The module has no onboard logic-level-converter for the GPIO pins!

It comes preflashed with the NodeMCU firmware (www.nodemcu.com) which enables you to program this module in LUA. It costs about 8-13 AUD$ on eBay.

 

Outlook

As i have some experience with Arduinos, i’ll most likely try to use the Arduino IDE to program this little friends –  (https://github.com/esp8266/Arduino)

My first Project will be a Wifi-Remote-Controller (infrared bridge) for my Daikin AC