ESP8266 (ESP-01/01S) Microcontrollers

Flash ESP8266 firmware using USB ESP01 Programmer Adapter (Windows 10)


  • USB ESP01 Programmer Adapter (Hardware)
This image has an empty alt attribute; its file name is image-2.png
  • CP201x driver (Windows)
  • ESP-01 MCU (4Mbit / 512 Kb flash size)
  • Expressif Flash Tool (flash_download_tool.exe and version 3.9.0)
  • Expressif Firmware
    • NONOS SDK 2.1
    • Version 1.6.2

Mount the EPS01 module (Blue board, Flash 4MBit / 512 Kb) on the header of USB ESP01 Programmer Adapter

Download the Espressif’s Flash Download Tool (zip compress)

Extract the compressed file from your download folder

Download the ESP8266 Firmware for 4MBit( 512 Kb) and SDK V2.0 (AT Bin V1.6.2)

512KB and SDK V2.0 firmware

Setup the Expressif’s Flash Tool (flash_download_tool.exe) version 3.9.0

Flash memory address of different SPI flash size
blank.bin 0x7E000
boot.bin 0x00000
Based 512Kb flash size memory address
COMCOM3 (a Port value from Device Manager)

Verify firmware was sucessfuly flash

Putty (Serial Terminal Software)

COM3 port was configured on PC, change it accordingly to your COMXX on your PC

AT+GMR command to check the SDK version installed.

Type AT+GMR then follow by CTRL+M CTRL+J


Expressif Quick Start Guide



WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications. (Source:

Here is a list to summarize the preceding information:

  • Wasm is a new language that officially became the fourth language of the web, after HyperText Markup Language (HTML), Cascading Style Sheets (CSS), and JavaScript. Source:
  • Wasm is a binary format. It does not aim to be human-readable.
  • Wasm is so low-level that it brings performance improvements compared to high-level languages such as JavaScript.
  • Go code can be compiled in the Wasm binary format.
Internet Of Things Microcontrollers MQTT

MQ Telemetry Transport (MQTT)


MQTT is a Client Server publish/subscribe messaging transport protocol. It is light weight, open, simple, and designed so as to be easy to implement. These characteristics make it ideal for use in many situations, including constrained environments such as for communication in Machine to Machine (M2M) and Internet of Things (IoT) contexts where a small code footprint is required and/or network bandwidth is at a premium.


The MQTT protocol aims for these goals:

  • Efficiency: the clients are usually very small and don’t have many resources.
  • Lightweight: the message header are small to optimize network bandwidth.
  • Reliable Delivery: it is important for devices to make sure the message was delivered.
  • Bi-directional: both client and server can send messages.
  • Data agnostic: it doesn’t matter the format of the message being sent.
  • Session: many IoT devices connect over unreliable networks, so it’s important to reduce the time to reconnect the client.
  • Security: it is easy to encrypt messages using TLS.


The MQTT is a publish-subscribe protocol. That is a client sends a message (or publish it) without knowing directly who is going to receive the message, if anyone. The same way, another client can receive messages (or subscribe) without knowing which device has sent it.


In this way, to send or to receive messages, the publishers and subscribers only need to know the broker address. Another advantage is that a broker can deliver a message for a client that is not online at the time it was published.

Go Client

Let’s create a simple application in Go to send and receive messages using MQTT.

ESP8266 (ESP-01/01S) Microcontrollers

Setup WiFi SSID and Password with Arduino IDE

// Import required libraries
#include <ESP8266WiFi.h>

// Wifi parameters
const char* ssid = "HackerWifi6";
const char* password = "sklim01@@";

void setup() {
  // put your setup code here, to run once:
  // Start Serial
  // Connect to WiFi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
  Serial.println("WiFi connected");
  // Print the IP address

void loop() {
  // put your main code here, to run repeatedly:

ESP8266 (ESP-01/01S) Microcontrollers

Using USB ESP01 Programmer Adapter with Arduino IDE

Assumption of Arduino IDE has been already configured for ESP8266 modules installed

USB ESP 01/01s Programmer Adapter (Hardware)

  • USB Type A interface
  • One 2x4P 2.54mm female header
  • One 2x4P 2.54mm male header
  • On board Reset button for ESP01

Download the USB to Serial Drivers for your OS platform. Select specific the Serial Chip drivers files match the USB programmer adapter – CP201x)

Install the USB to Serial software drivers as per default setting

Check the Windows Device Manager, Ports for COM integer value

Setup Port and Speed (baud rate) on the Arduino IDE from Tool menu

USB to UART / USB to TTL Serial (Hardware)

Arduino Uno R3 / Maker Uno X (Hardware)

ESP8266 (ESP-01/01S) Microcontrollers

Setup Arduino IDE (Windows/MacOS – Intel)

Download the Arduino IDE software and Setup the software

Install the ESP8266 modules under the Additional Boards in Boards Manager

 Open boards manager and search for esp and install it

Microcontrollers TinyGO


TinyGo – Go compiler for small places

Support boards/targets

You can compile TinyGo programs for microcontrollers, WebAssembly and Linux.

The following microcontroller boards of my stock are currently supported:

  • Arduino Mega 1280
  • Arduino Uno
  • BBC micro:bit
  • Digispark
  • ESP32
  • ESP8266
  • Raspberry Pi Pico


Arduino UNO and Maker UNO Microcontrollers TinyGO

Hello World (TinyGo)

package main

import (

func main() {
   led:= machine.LED
   led.Configure(machine.PinConfig{Mode: machine.PinOutput})
   for {
      timeSleep(time.Millisecond * 300)
      time.Sleep(time.Millisecond * 300)

Visual Studio Code (IDE) for TinyGO

Install the Go extension using the VSC’s Extensions

Install all dependencies

By hitting Ctrl + Shift + P and entering the following command

Go: install

Select all dependencies by checking the box on the left side and click OK. Wait till the log message appears as follows: All tools were successfully installed. You are ready to Go :).

Install TinyGo extentions

Configure TinyGo extension

TinyGo target set to Arduino

Sometimes a popup similar to the one in the following screenshot will appear. Do not click on Update tools; just close it.

Checking the Environment

tinygo info arduino

Write the Hello World code (Go lang)

package main

import (

func main() {
   led:= machine.LED
   led.Configure(machine.PinConfig{Mode: machine.PinOutput})
   for {
      timeSleep(time.Millisecond * 300)
      time.Sleep(time.Millisecond * 300)

Flashing the program

tinygo flash –target=arduino main.go


LED blink at Digital pin 13

Arduino UNO and Maker UNO TinyGO

Install TinyGo (MacOs, Intel)

You must have Go v1.14+ already installed on your machine in order to install TinyGo

brew tap tinygo-org/tools
brew install tinygo

$ tinygo version
tinygo version 0.15.0 darwin/amd64 (using go version go1.15 and LLVM version 10.0.1)

brew tap osx-cross/avr
brew install avr-gcc
brew install avrdude