If you don't want to use my setup described here, you can make your own setup using your own distribution.
You can make your own environment for compiling your code or the demo code for the ESP8266.
Step 1.
Download ova image ( lunbuntu 14.04) for VirtualBox or install your preferred Linux distribution.
User is esp8266 and password is espressif
sudo apt-get install git autoconf build-essential gperf bison flex texinfo libtool libncurses5-dev
wget gawk libc6-dev python-serial libexpat1-dev
Step 2.
sudo mkdir /opt/Espressif
Step 3.
sudo chown esp8266 /opt/Espressif/
Step 4.
cd /opt/Espressif
Step 5.
git clone -b lx106 git://github.com/jcmvbkbc/crosstool-NG.git
Step 6.
cd crosstool-NG/
./bootstrap && ./configure --prefix=`pwd` && make && make install
Step 7.
./ct-ng xtensa-lx106-elf
Step 8.
./ct-ng build
Note: It takes about 25 minutes !!!!!!!
Step 9.
Edit the .profile file from /home/esp8266 and add the line
PATH="$HOME/bin:/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin:$PATH"
Step 10.
cd /opt/Espressif
wget -O esp_iot_sdk_v0.9.5_15_01_23.zip https://github.com/esp8266/esp8266-
wiki/raw/master/sdk/esp_iot_sdk_v0.9.5_15_01_23.zip
Note: is the SDK from 23 Jan 2015. Verify if there is a new one.
Step 11.
unzip esp_iot_sdk_v0.9.5_15_01_23.zip
mv esp_iot_sdk_v0.9.5 ESP8266_SDK/
Step 12.
cd /opt/Espressif/ESP8266_SDK
wget -O lib/libc.a https://github.com/esp8266/esp8266-wiki/raw/master/libs/libc.a
wget -O lib/libhal.a https://github.com/esp8266/esp8266-wiki/raw/master/libs/libhal.a
wget -O include.tgz https://github.com/esp8266/esp8266-wiki/raw/master/include.tgz
tar -xvzf include.tgz
rm include.tgz
Step 13.
cd /opt/Espressif
git clone https://github.com/themadinventor/esptool esptool-py
chown -R esp8266 crosstool-NG/
sudo ln -s $PWD/esptool-py/esptool.py crosstool-NG/builds/xtensa-lx106-elf/bin/
Step 14.
The SDK esp_iot_sdk_v0.9.5_15_01_23.zip has a directory named Document with some pdf files about API, AT commands and release notes.
Step 15.
Copy the "at" directory from /opt/Espressif/ESP8266_SDK/examples and compile it
cp -R /opt/Espressif/ESP8266_SDK/examples/at /opt/Espressif/ESP8266_SDK/
cd /opt/Espressif/ESP8266_SDK/at
make clean
make
The result resides in the /opt/Espressif/ESP8266_SDK/bin directory
Flashing the code. Note that the above command is on long line. You can put the command into a file flashEsp, give that file executable rights and use it with ./flashEsp
sudo /opt/Espressif/esptool-py/esptool.py --port /dev/ttyUSB0 write_flash 0x3C000 /opt/Espressif/ESP8266_SDK/bin/blank.bin 0x00000 /opt/Espressif/ESP8266_SDK/bin/eagle.flash.bin 0x40000 /opt/Espressif/ESP8266_SDK/bin/eagle.irom0text.bin
OR
/opt/Espressif/esptool-py/esptool.py -p /dev/ttyUSB0 write_flash 0x40000 ../bin/eagle.irom0text.bin write_flash 0x00000 ../bin/eagle.flash.bin
I hope I didn't missed any step.
Esp8266 blog. Learn how to compile, how to work with the wireless chip esp8266. ESP-01 ESP-03, ESP-07, ESP-12, ESP201 all are here
Thursday, March 5, 2015
Use my ESP8266 environment !!!
User ESP8266
password espressif
Let's see how you can compile our first example of code.
To do this download the virtual box ova from my drive.
Apply this ova file to a Virtual Box.
Start the virtual machine
go to /opt/Espressif/ESP8266_SDK/ where there are two directories with examples:
IoTDemo - a web server controlling some GPIO's
at - build a custom AT command along with all command that are supportded by the at library
go to /opt/Espressif/ESP8266_SDK/IoTDemo/
make clean
make
two files are generated into the /opt/Espressif/ESP8266_SDK/bin directory.
!!!
No boot needed.
Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin.
eagle.flash.bin-------->0x00000
eagle.irom0text.bin---->0x40000
!!!
Use those files and the optional blank image blank.bin or you can use this command
to write the files.
sudo /opt/Espressif/esptool-py/esptool.py --port /dev/ttyUSB0 write_flash 0x3C000 /opt/Espressif/ESP8266_SDK/bin/blank.bin 0x00000 /opt/Espressif/ESP8266_SDK/bin/eagle.flash.bin 0x40000 /opt/Espressif/ESP8266_SDK/bin/
eagle.irom0text.bin
Write the files on ESP-01.
1. Power off the ESP-01
2. Connect GPIO0 to GND
3. Power on the ESP-01
4. Burn firmware
Write the files on ESP201 Dev Board.
1. Power off the ESP-201
2. Keep pressed S2 and power the board
3. Release the S2 switch
4. Burn firmware
Notes:
password espressif
Let's see how you can compile our first example of code.
To do this download the virtual box ova from my drive.
Apply this ova file to a Virtual Box.
Start the virtual machine
go to /opt/Espressif/ESP8266_SDK/ where there are two directories with examples:
IoTDemo - a web server controlling some GPIO's
at - build a custom AT command along with all command that are supportded by the at library
go to /opt/Espressif/ESP8266_SDK/IoTDemo/
make clean
make
two files are generated into the /opt/Espressif/ESP8266_SDK/bin directory.
!!!
No boot needed.
Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin.
eagle.flash.bin-------->0x00000
eagle.irom0text.bin---->0x40000
!!!
to write the files.
sudo /opt/Espressif/esptool-py/esptool.py --port /dev/ttyUSB0 write_flash 0x3C000 /opt/Espressif/ESP8266_SDK/bin/blank.bin 0x00000 /opt/Espressif/ESP8266_SDK/bin/eagle.flash.bin 0x40000 /opt/Espressif/ESP8266_SDK/bin/
eagle.irom0text.bin
Write the files on ESP-01.
1. Power off the ESP-01
2. Connect GPIO0 to GND
3. Power on the ESP-01
4. Burn firmware
Write the files on ESP201 Dev Board.
1. Power off the ESP-201
2. Keep pressed S2 and power the board
3. Release the S2 switch
4. Burn firmware
Notes:
- In /opt/Espressif/ESP8266_SDK/document/ there are tow directories English an Chinese with document about the SDK fucntion, AT command. Spend some time looking into them.
- In the Virtual Box image I've added the moserial application that can be used to see the debug information from ESP.
- Launch moserial with: sudo moserial &
- If Software Updater is bugging you, do not update. You are just fine.
Wednesday, March 4, 2015
ESP8266 Wireless Wifi Module Develop Board 8266 SDK Development Chip
Other interesting board is this board from Electronic Gadget World, a shop on aliexpress.com.
If you can not find this board you can buy other good development boards like:
1. Development board with ESP8266 module and power supply.
2. Battery operated development board
3. Small form factor development board
The parcel contained one ESP201 an SDK Development board and a DHT11 sensor. No cables or power supply. I've ordered two extra ESP201 so I've replaced the faulty one with a good ESP201.
As you can see in the image there are two USBs. The microUSB located on the top right is just for powering the board. The other usb, a type B USB can be used to power the board, and to write firmware to ESP201 flash. The usb to serial on board is a CH340G chip. My win7 didn't complain about it, I was able to write the flash to ESP201.
The only problem is that the transfer was done at 9600 or less (like 5 minute for 200k), after I've modified in the DeviceManager the speed for the port, the transfer rate was increased. But this happened only once, so I gave up using the CH340G chip for now. I've removed the red jumpers and I used my old Prolific USB/serial.
I'll reinstall the drivers for CH340G chip with this one later and I'll see if helps.
Now let's talk about the connections. As you can see the dev board has:
DIP functionality
On the PCB near the DIP switch there are the values :
A schematics on a napkin will look like this one:
And thanks to Scott Snowden and jwbr from http://www.bpower.nl/ there is a complete schematics of the board.
On IO4 is connected the DHT11 sensor. I didn't use it because I have a DHT22 which is more accurate.
How to write flash.
1.Power off the board.
2.Keep S2 pressed and power on the board using the switch located in the right top of the board.
3.Now you can write the flash from the ESP201 board.
Conclusions:
It is a very good board, no issues found. If you want a rapid development board you can buy this one.
And the final config will look like in this picture (2 external relays, 2 external LEDs DHT22). Pretty crowded. Breadboard is just for GND.
UPDATE1: See what to do to have access on the GPIO15 ( Red led from RGB) - HERE
UPDATE2: See what to do for controlling the relay connected on the XPD / GPIO16 - HERE
UPDATE3: A IoT plug based on ESP-01 - HERE. A lawn irrigation IoT based on this board is coming soon.
UPDATE4: Now I have a unix cron functionality on my ESP8266 chips.
UPDATE5: MQTT broker running on ESP8266
If you can not find this board you can buy other good development boards like:
1. Development board with ESP8266 module and power supply.
2. Battery operated development board
3. Small form factor development board
The parcel contained one ESP201 an SDK Development board and a DHT11 sensor. No cables or power supply. I've ordered two extra ESP201 so I've replaced the faulty one with a good ESP201.
As you can see in the image there are two USBs. The microUSB located on the top right is just for powering the board. The other usb, a type B USB can be used to power the board, and to write firmware to ESP201 flash. The usb to serial on board is a CH340G chip. My win7 didn't complain about it, I was able to write the flash to ESP201.
The only problem is that the transfer was done at 9600 or less (like 5 minute for 200k), after I've modified in the DeviceManager the speed for the port, the transfer rate was increased. But this happened only once, so I gave up using the CH340G chip for now. I've removed the red jumpers and I used my old Prolific USB/serial.
I'll reinstall the drivers for CH340G chip with this one later and I'll see if helps.
![]() |
| ESP201 SDK development board |
Now let's talk about the connections. As you can see the dev board has:
- a relay
- a RGB led
- a white led ( almost under the RGB led which is above the buzeer)
- DHT11
- buzzer
- two switched S2 and S3
- a variable rezistor for ADC ( on the left of relay ) connected to ADC pin.
- a 5v to 3v3 convertor
- a main switch in the right upper corner (this switch is just for ESP201 board I guess, I have the impression that the CH340G is still receiving power even the switch is off).
DIP functionality
On the PCB near the DIP switch there are the values :
- R - should be the RED led from the RGB connected to the IO15 pin. Putting the R DIP to ON will light RED if the GPIO15 is HIGH.
- G - GREEN led from RGB led is connected to IO13. Putting the G DIP to ON will light GREEN if the GPIO13 is HIGH.
- B - BLUE led from RGB led is connected to IO12. Putting the B DIP to ON will light BLUE if the GPIO12 is HIGH
- W - WHITE led located almost under RGB led is connected to the IO14 pin. Putting HIGH on GPIO14 and DIP switch on ON will light the WHITE led
- J - relay pin connected to IO16 ( which is always HIGH - I have no idea why . This behavior and the RED led that is not working can be because I have a bad board or the design for all the boards is wrong. Connecting the IO16 to GND (not recommended) will stop the relay, otherwise it will be ON all the time the J DIP pin is ON.
- B - BUZZER connected to IO5 pin throuch B DIP switch. Having GPIO5 HIGH and B on DIP switch ON will prove that the buzzer is working.
- K1 - I assume is connected to S2
- K2 - I assume is connected to S3.
A schematics on a napkin will look like this one:
![]() |
| Napkin schematics :-) |
And thanks to Scott Snowden and jwbr from http://www.bpower.nl/ there is a complete schematics of the board.
![]() |
| Wifi Module Develop Board 8266 schematics |
On IO4 is connected the DHT11 sensor. I didn't use it because I have a DHT22 which is more accurate.
How to write flash.
1.Power off the board.
2.Keep S2 pressed and power on the board using the switch located in the right top of the board.
3.Now you can write the flash from the ESP201 board.
Conclusions:
It is a very good board, no issues found. If you want a rapid development board you can buy this one.
And the final config will look like in this picture (2 external relays, 2 external LEDs DHT22). Pretty crowded. Breadboard is just for GND.
UPDATE1: See what to do to have access on the GPIO15 ( Red led from RGB) - HERE
UPDATE2: See what to do for controlling the relay connected on the XPD / GPIO16 - HERE
UPDATE3: A IoT plug based on ESP-01 - HERE. A lawn irrigation IoT based on this board is coming soon.
UPDATE4: Now I have a unix cron functionality on my ESP8266 chips.
UPDATE5: MQTT broker running on ESP8266
ESP8266 - part two
One of the popular boards with ESP8266 is ESP-01. It is not so friendly with your breadboard ( not at all in fact) but if you have the same DuPont wires is fine.
As you can see the board is small enough and it is the cheapest one you can find on banggood.com or dx.com. Pinout for the board is:
If you look in the first picture you will see that I've connected CH_PD and RST pins to VCC ( I know that it is not looking very good, but it works for now).
UTXD, URXD and one GND will be connected to your USB to Serial adapter and to write some code into the flash GPIO0 will be connected to GND during power up ( but this later in other posts).
After the code is loaded the GPIO0 and GPIO2 can be used to connect a temperature/humidity sensor on GPIO2 for example and an relay on GPIO0. Or a PIR on GPIO0 and an relay for a lamp on GPIO2.
By default the board is coming with a software that allows using AT command to configure it and same basic functionality. Personally I overwrote the manufacture code with my own.
As you can see the board is small enough and it is the cheapest one you can find on banggood.com or dx.com. Pinout for the board is:
If you look in the first picture you will see that I've connected CH_PD and RST pins to VCC ( I know that it is not looking very good, but it works for now).
UTXD, URXD and one GND will be connected to your USB to Serial adapter and to write some code into the flash GPIO0 will be connected to GND during power up ( but this later in other posts).
After the code is loaded the GPIO0 and GPIO2 can be used to connect a temperature/humidity sensor on GPIO2 for example and an relay on GPIO0. Or a PIR on GPIO0 and an relay for a lamp on GPIO2.
By default the board is coming with a software that allows using AT command to configure it and same basic functionality. Personally I overwrote the manufacture code with my own.
Sunday, March 1, 2015
ESP8266 - part one
As I said on the previous post, one device that captured my attention is the ESP8266EX chip that is an wireless SoC and it has GPIO, I2C, ADC (0..1V), SPI, PWM.
It runs at 80MHz and has 32KBytes of instruction RAM, 96KBytes of data RAM and 64KBytes boot ROM.
It has a RISC architecture and the core is a 106micro Diamond Standard core (LX3) made by Tensilica and is produced by Espressif.
Specs from the producer site:
It runs at 80MHz and has 32KBytes of instruction RAM, 96KBytes of data RAM and 64KBytes boot ROM.
It has a RISC architecture and the core is a 106micro Diamond Standard core (LX3) made by Tensilica and is produced by Espressif.
Specs from the producer site:
- 802.11 b/g/n
- Wi-Fi Direct (P2P), soft-AP
- Integrated TCP/IP protocol stack
- Integrated TR switch, balun, LNA, power amplifier and matching network
- Integrated PLLs, regulators, DCXO and power management units
- +19.5dBm output power in 802.11b mode
- Power down leakage current of <10uA
- Integrated low power 32-bit CPU could be used as application processor
- SDIO 1.1/2.0, SPI, UART
- STBC, 1×1 MIMO, 2×1 MIMO
- A-MPDU & A-MSDU aggregation & 0.4ms guard interval
- Wake up and transmit packets in < 2ms
- Standby power consumption of < 1.0mW (DTIM3)
The chip from the above picture is the old version. The new one is ESP8266EX that is now on all boards that I've seen for sales.
ESP8266Ex is connected on most boards to a SPI flash memory like in the following schematic:
Subscribe to:
Posts (Atom)







