Updating ANAVI Miracle Controller with esptool

ANAVI Miracle Controller is an ESP8266-powered, open source, Wi-Fi dev board to control two 5 V or two 12 V LED strips. To get all new features it is highly recommended to run the latest stable version of the free and open source firmware for ANAVI Miracle Controller. We have already explained how to do it with Arduino IDE. However, there is an easier way to flash the latest version with esptool!

ANAVI Miracle Controller connected with USB to UART cable to a personal computer

Esptool is a free and open source ESP8266 and ESP32 serial bootloader command-line utility. The source code is available at GitHub under GPLv2 license. It is written in Python therefore it is universal and runs on Microsoft Windows, Mac OS and any GNU/Linux distribution (Ubuntu, Debian, Linux Mint, Fedora, CentOS, OpenSUSE, etc). We have already cover it for our other projects in a previous blog post. Today we will focus on ANAVI Miracle Controller although in general the steps are the same.

Installation

As of today, esptool works fine with Python 2.7 or Python 3. Python 2 has been deprecated since January 1, 2020 therefore it is recommended to use esptool with Python 3.

The easiest way to install the latest stable version of esptool is from pypi via pip. The pre-requirements are to have Python and pip installed. Open a terminal and execute the following command:

pip install esptool

Using write_flash argument esptool flashes pre-compiled binary to devices with ESP8266 or ESP32. Here are the exact steps:

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 anavi-miracle-controller-sw-100-20200527.bin

NOTE: As of the moment the latest stable version is anavi-miracle-controller-sw-100-20200527.bin. Over the time other version may be released so please make sure you are using the latest and replace the file name accordingly in the command above!

Pretty much the same approach can be used to flash the pre-compiled firmware to any of our dev boards with ESP8266, like ANAVI Fume ExtractorANAVI ThermometerANAVI Gas Detector, etc. Apart from flashing firmware to ESP8266 and ESP32 devices, esptool has a lot of other advanced features which I encourage you to explore. Have a look at the video tutorial and run esptool.py -h to learn more.

Last but not least, huge thanks to the contributors of the open source firmware of ANAVI Miracle Controller: Per CederqvistCODeRUS and Daniel Landau. Community always must be priority for any open source project and it is great to see more people involved with ANAVI Miracle Controller!

You may also like

Flashing Firmware on ANAVI Miracle Controller with Arduino IDE

ANAVI Miracle Controller is a new entirely open source development board for addressable (digital) LED strips like NeoPixels, WS2812B, WS2811, etc. The major advantages are that you can control two LED strips simultaneously, add a mini OLED display and I2C sensor modules as peripherals. Recently we launched a crowdfunding campaign for it at Crowd Supply.

ANAVI Miracle Controller

ANAVI Miracle Controller is a development board and it is easy to flash a custom firmware on it. The process is very similar as for our other open source project like ANAVI Thermometer, ANAVI Gas Detector and ANAVI Light Controller.

This tutorial explains the exact steps how to compile and upload the default open source Arduino sketch for ANAVI Miracle Controller using Arduino IDE.

Required Hardware

  • ANAVI Miracle Controller
  • USB to UART debug cable
  • Addressable LED strip
  • Appropriate power supply at 5V or 12V depending on the type of LED strips
  • Personal computer with MS Widows, Mac OS or GNU/Linux distribution
  • Optionally a mini OLED display and other peripherals can be attached
ANAVI Miracle Developer kit

Download Source Code from GitHub

The default firmware of ANAVI Miracle Controller is an open source Arduino sketch. It relies on several popular open source Arduino libraries, including FastLED for controlling addressable LED strips. Clone or download the source code from GitHub.

Connecting UART to USB

Each ANAVI Miracle Controller kit includes a USB to UART debug cable with CP2102. Depending on the operating system on your PC you might be required to install additional drives. It works out of the box on GNU/Linux distributions. As open source enthusiasts we are using it on Ubuntu. Plug the USB in your computer and connect the 3 wires as follows:

ANAVI Miracle ControllerUSB to UART Debug Cable
RXTX
TXRX
GNDGND
Connecting USB to UART cable to ANAVI Miracle Controller

Download Arduino IDE

Download and install Arduino IDE on your personal computer. It is free and open source software available for MS Windows, Mac OS and GNU/Linux distributions.

Launch Arduino IDE. From File > Open load an Arduino sketch. It can be the default firmware or any other compatible with ANAVI Miracle Controller Arduino sketch.

Configure ESP8266 in Arduino IDE

Go to File > Preferences. Select Settings and in the field Additional Boards Manager URLs add: http://arduino.esp8266.com/stable/package_esp8266com_index.json

From Arduino IDE select Tools > Board: Generic ESP8266 Module. Set the flash size to 4M (1M SPIFFS). The upload speed is 115200. Adjust the exact port of USB to serial debug cable connected to your computer.

Install Libraries

Select Tools > Manage Libraries. The Arduino library manager will appear. Install all required libraries and their exact versions. Over the time, with the development of the default firmware, new libraries might be added. Please have a look at the README file to get the up to date list of all Arduino libraries on which the the default firmware depends on.

Compile & Upload

In Arduino IDE click Verify/Compile. If there are any errors, please double check that you have installed all required libraries and their exact versions. If the source code compiles successfully, please proceed to to the next step for flashing the firmware.

Set the jumper to 5V or 12V depending on the type of addressable LED strip and power supply. Mismatch of the voltage may lead to severe hardware failure.

In Arduino IDE click Upload. Set the jumper on ANAVI Miracle Controller to 5V or 12V depending on your power supply and type of LED strips. The power supply voltage must match the required voltage by the LED strips, for example 5V for NeoPixels and the WS2812B included in all kits. Press and hold the RESET button on ANAVI Miracle Controller. Without releasing the RESET button, plug the power supply in the barrel jack of ANAVI Miracle Controller.

Do NOT release the RESET button until you see in Arduino IDE that the upload is 100% completed!

ANAVI Miracle Controller with 2 WS2812B LED strips connected to a laptop using USB to UART cable

You may also like