ESP8266 Building Hello World Blink LED and Simple Web Server to drive the Relay and check Button status


ESP8266-EVB is small 57×50 mm board with Relay and Button which are connected to Internet via ESP8266 WIFI module.

ESP8266 has inside Xtensa106 processor and RF front end circuit, you do not need separate processor to drive the relay and read the button as ESP8266 can be programmed with custom code.

Here we will explain how to setup your tools and make your first project.

First you need to install your tools. It’s simple, just follow the instructions here:

There are just few small mistakes as some commands will require SUDO before them and some paths are not exactly same, but you have to follow the steps and once you get error to read and correct the problem.

Here is what we do on Ubuntu 14.04 LTE 64-bit:

sudo apt-get install git autoconf build-essential gperf bison flex texinfo libtool libncurses5-dev wget gawk libc6-dev-amd64 python-serial libexpat-dev
sudo mkdir /opt/Espressif
sudo chown $username /opt/Espressif/
sudo cd /opt/Espressif
sudo git clone -b lx106 git:// 
cd crosstool-NG
./bootstrap && ./configure --prefix=`pwd` && make && make install
./ct-ng xtensa-lx106-elf
./ct-ng build
cd /opt/Espressif
mkdir ESP8266_SDK
wget -O
wget -O
mv esp_iot_sdk_v0.9.3 ESP8266_SDK
mv License ESP8266_SDK/esp_iot_sdk_v0.9.3
cd /opt/Espressif/ESP8266_SDK/esp_iot_sdk_v0.9.3
sed -i -e 's/xt-ar/xtensa-lx106-elf-ar/' -e 's/xt-xcc/xtensa-lx106-elf-gcc/' -e 's/xt-objcopy/xtensa-lx106-elf-objcopy/' Makefile
mv examples/IoT_Demo .
cd /opt/Espressif/ESP8266_SDK/esp_iot_sdk_v0.9.3
wget -O lib/libc.a
wget -O lib/libhal.a
wget -O include.tgz
tar -xvzf include.tgz
cd /opt/Espressif
wget -O esptool_0.0.2-1_i386.deb
dpkg -i esptool_0.0.2-1_i386.deb
cd /opt/Espressif
git clone esptool-py
ln -s $PWD/esptool-py/ crosstool-NG/builds/xtensa-lx106-elf/bin/

For less experienced users, we are preparing VirtualBox disk image which to run on Virtual machine on any OS like Linux, MAC OS, Windows, and everything inside is pre-configured and ready to use, hopefully we will upload this image on ESP8266-EVB web page tomorrow as we didn’t manage to complete it today.

Once you have setup the Tools you can download our examples from GitHub:

cd /opt/Espressif
git clone
cd ESP8266-EVB-blinkLED

the project will be compiled and you will see something like this:

AR build/app_app.a
LD build/app.out
FW firmware/0x00000.bin
FW firmware/0x40000.bin

congratulations you made your first code!

now we hae to load it to ESP8266-EVB

you need: ESP8266-EVB, 5V adapter like SY0605E, USB-Serial-Cable-F
connect the USB-SERIAL-CABLE-F to ESP8266-EVB UEXT connector as follows:

  • blue wire to pin#2
  • green wire to pin#3
  • red wire to pin#4

plug the USB cable to your computer USB connector and check which serial port it connects by typing:


your computer should display something like:

Bus 004 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

if you type:

ls /dev/tty*

you will see:

.... /dev/ttyUSB0 ....

If the USB device is with different name you have to update it in the makefile.

After the code is compiled with no errors you can write it to ESP8266 by following these steps:

  1.  first you have to press button and hold it and to apply power 5V, ESP8266 will enter bootloader mode
  2. type ‘sudo make flash’ and wait until code is loaded:
sudo make flash
/opt/Espressif/esptool-py/ --port /dev/ttyUSB0 write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
Erasing flash...
Writing at 0x00007300... (100 %)
Erasing flash...
Writing at 0x00061200... (100 %)

now Green LED must start blinking!

So far so good, you just made blinking LED on ESP8266, now let’s make something more complicated – to run Embedded web server on ESP8266, go to esphttpd project directory:

cd /opt/Espressif/ESP8266/esphttpd

then upload the code

sudo make flash

then upload web pages with:

sudo make htmlflash

Now ESP8266 firmware is uploaded and ESP8266 create Embedded server.

Scan for WIFI which name starts with ESP_XXXXXXX where XXXXXX is the ESP8266 MAC address and connect to this network then open browser at you will see this home page:


if you click on Relay button in the right side you will see new page:


On this page you can switch the on-board relay by clicking on ON and OFF button

If you click on the Button button in the right side you will see new page:


If you click on Start scan the web page will start to refresh each second and display the button status if you click on Stop scan the page will not refresh.

This is very basic demo code which can be used as template for your own projects!

PIC-WEB-BOX demo video



PIC-WEB-BOX is embedded PIC web server using Microchip’s Open Source TCP-IP stack with two buttons, RS232 interface, UEXT connector, two GPIO connectors, Status LED, 2GB Sd card for web storage. The power supply can be in range 9-30VDC and the low consumption makes this board perfect for controlling things over internet or to read sensors etc.

We setup video where you can see how easy is to program it and using the build-in bootloader you can change PIC-WEB-BOX firmware over the net via TFTP.

UART, I2C, SPI interfaces are available and the video demonstrate how you can drive 4.3″ LCD, Relays, measure temperature with thermocouple etc.

SD card with 2GB is build-in for web storage.

PIC-WEB-BOX is with small enclosure.


LPC2378-STK Tutorial: Implementation of PPP connection with TCPNet Stack


Ohmohm tip us this tutorial via Twitter. Its in Russian language but you can use Google translate.

LPC2378-STK in this case act as web server and allow other devices to connect to it via PPP.

Web Server with MOD-IO + MOD-ENC28J60


Doing embedded Web servers with microcontrollers is not new but Andrew Rossignol blogged recently that he made embedded Web Server with MOD-IO and MOD-ENC28J60, the catch is that MOD-IO have ATMega16 microcontrollers with only 16KB Flash and 1K RAM!

You can read more about his implementation on his blog

Good work!

A13-OLinuXino web server with MOD-RGB controlling RGB LED stripe over internet


A13-OLinuXino have enough power to run real apache web server with php5, java script etc like any desktop linux computer.

With MOD-RGB connected to A13-OLinuXino UEXT you can control RGB LED stripe up to 5A per channel over fancy web interface from any device with web browser like your tablet or phone.

For instance you can make cool RGB LED lighting in your home and to control then with your phone, A13-OLinuXino can connect to many different MOD-RGB controllers as they are addressable, so you can connect many LED stripes to A13-OLinuXino web server and to controll them separately.

These are step by step instructions how to duplicate yourself:

Prepare A13-OLinuXino-WIFI for web serving:

Update repository
$apt-get update

Install apache and php
$apt-get install apache2 php5 libapache2-mod-php5

Open browser and type A13 board internal network IP address. For instance . You should get message “It Works”

Extract demo files into apache dir. For example /var/www/RGB

Compile i2c-tool
$gcc i2c-tool

Make executable
$chmod 777 a.out

Change permitions of i2c-bus
$chmod 777 /dev/i2c*

Now open index.html. You should see color picker. Move mouse. Enjoy :)

WEB-IO control of iMX233-OLinuXino-MAXI GPIOs from web


In the previous post I explained how to setup web server on iMX233-OLinuXino-MAXI now will explain how to control iMX233-OLinuXino resources through the web.

Clone WEB-IO from GitHub:

# mkdir web-io

# cd web-io

# git clone

Copy gpio into /etc/rc.d/

# cp -vf web-io/init/gpio /etc/rc.d/

Start the script

# /etc/rc.c/gpio start

Change the permission of i2c-o

# chmod 666 /dev/i2c-0

Copy web folder into /srv/http/

# cp -rvf web-io/web/io /srv/http/

Go to your browser and enter the IP-address of the board:

you will see the GPIOs web page and with mouse click you can change GPIO state

Running Web server with PHP on iMX233-OLinuXino-MAXI


Here are the steps to run your own embedded web server with iMX233-OLinuXino-MAXI.

We assume you use ARCH Linux distribution:

1. Using pacman download the following packages:


# pacman -Sy lighttpd


# pacman -Sy mod_fastcgi


# pacman -Sy php-cgi

2. Edit the lighttpd.conf file

#vi /etc/lighttpd/lighttpd.conf

NOTE: if you can’t find this file reboot the board and try again..

The file should look something like this

# This is a minimal example config
# See /usr/share/doc/lighttpd
# and

server.port = 80
server.username = “http”
server.groupname = “http”
server.document-root = “/srv/http”
server.modules = (
server.errorlog = “/var/log/lighttpd/error.log”
dir-listing.activate = “enable”

fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php-cgi”,
“socket” => “/tmp/php.socket”
index-file.names = ( “index.html” )
mimetype.assign = ( “.html” => “text/html”, “.htm” => “text/html”, “.txt” => “text/plain”, “.jpg” => “image/jpeg”, “.png” => “image/png”, “” => “application/octet-stream” )

Save and exit the editor. You can check the syntax with the command:

# lighttpd -t -f /etc/lighttpd/lighttpd.conf

With this configuration you should have working web-server at port 80 and implemented php

3. Reboot the board.

4. After the restart load the configuration file and start the daemon:

# lighhtpd -f /etc/lighttpd/lighttpd.conf

# /etc/rc.d/lighttpd start

You can see which daemons are started with the command:

# rc.d list

If you want to add this to autostart modify /etc/rc.conf and add lighttpd to DAEMONS array:

DAEMONS=(set-olinuxino-mac !hwclock syslog-ng network netfs crond sshd lighttpd)

5. Test the server

Now just open any browser and type the IP of the OlinuXino board and you should see “Hello” message. The folder containing the index.html is /srv/http. Just put your webpages there and your good to go.

Previous Older Entries


Get every new post delivered to your Inbox.

Join 595 other followers