ESP8266: Difference between revisions

From Uzebox Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 35: Line 35:




This is the current standard schematic(for standard Uzebox):
This is the schematic for standard Uzebox:


----
----
Line 67: Line 67:
|TX(3.3V)||||RX
|TX(3.3V)||||RX
|}
|}
''In the name of science the author ran an experiment on the ESP8266 rev2 using 5v logic '''AND 5v VCC/CH_PD''' for a day...so don't do it because it's wrong...but it works''
==Upgrading Firmware==
The '8266 can accept new firmware flashed to it that can fix bugs, add AT commands, or even a program to run the device standalone using the onboard MCU. Different versions of the device will come with different versions of the firmware from the factory. Some newer devices may support firmware upgrade over wifi or OTA(Over The Air) while others will require manual pin connections to complete the upgrade. Once an upgrade to an OTA compatible firmware is completed there will be no need for manual intervention in the future. You can connect your device using a USB->Serial adapter(must be '''5 volts''' TTL dont use a 'real' serial port!), FTDI, or an Arduino Uno works nicely and is probably available at your local electronics store. Using some devices might require using an external power supply should it not be able to provide enough current. Arduino UNO does have enough even when powered by USB only.
Once you have connected the device to a serial adapter of some sort and plugged it into your PC, you can open up a terminal emulator of your choice(PuTTY, Arduino monitor,etc). Different versions of the firmware will default to different baud rates in the terminal so it is possible that you will see gibberish displayed from the device. If this is the case you will need to experiment with different speeds until, after a fresh power cycle, it displays some giberish then "OK" to indicate it is operational and you are running the right speed to receive the characters correctly. Common default speeds are 115200, 57600, 9600 etc. You can check your firmware version with "AT+GMR" and experiment with manually using the AT commands.
Once have verified your device is setup and working correctly over a serial connection it is time to get our new firmware we will need to enable OTA updates. This[[File:esp8266flash.zip]] archive contains a working flasher and firmware file that will bring your device to an OTA ready state. Before you can use the program you must put the device into a state that is ready to receive new firmware. This is accomplished by grounding GPIO0 and momentarily grounding RST. Once the device boots back up with GPIO0 still held low, it is awaiting for a firmware file over the serial interface. Simple open the program, select your COM port for the serial device, select the firmware file you want to flash and click program. The process will take about 1 minute to complete, and may indicate an error has occurred at 99% but the firmware will be intact. If everything went well you should be able to do another "AT+GMR" and see that your version is now newer. If everything went really well you should now be able to do "AT+CIUPDATE", after manually using AT commands to setup the network connection. Let's take a quick look at how to do that:
TODO

Revision as of 04:07, 23 January 2015

Overview

This page is intended to be complete guide for everything ESP8266 related on the Uzebox using the Uzenet protocol. The page will cover all current standards and be updated as things change. With this guide you should be able to use most, if not all, of the different available hardware versions of the ESP8266 for Uzebox multiplayer or other internet enhanced applications. Anything not documented should be requested in the forums to enhance this page in the future.


What It Is

The ESP8266 is a low power(with good range), highly integrated Soc(System on a Chip), at extremely low cost, offering internet connectivity over a serial/UART interface. Many different versions are available on the internet for less than 4€/US$5/C$6. Any version will work(currently expected) with a couple caveats for certain model(s) listed. The device is designed for 3.3 volt supply and logic levels and is capable of up to 4 discrete internet connections to any place in the world over TCP or UDP protocols. It is operated using the [ESP8266 AT Commands] which the Uzebox uses to create the desired setup and data transfers which creates the Uzenet protocol. It is available from many different places:

Site Link Notes
AdaFruit [1] more expensive but they are friends to Uzebox
Ebay [2] larger quantities available at discount
Olimex [3] fast shipping, good price and packaging
BangGood [4] slower/free shipping from China, to your door for < $4
ESP8266.com [5] best source for development information, donate to receive modules and support the cause.
Seeed Studio [6] the author is biased against this one

and many more.


Installation

This is the schematic for standard Uzebox:


Uzenetsch8266.png

It is important to use a 3.3v voltage regulator These are the available pinouts for different versions of the chip:


Esp8266pinout1.png


For the correct connection for any model refer to the pinout to find the individual name pins and connect in this manner:

ESP8266 to Uzebox
VCC (3.3v, IMPORTANT!) 3.3v regulator as per schematic
GND(-0v) GND
CH_PD (3.3v, IMPORTANT!) 3.3v regulator/bridge to 3.3VCC
RST(3.3v) PD3(gets grounded to reset)
RX(3.3V) (*direct 5v logic works) TX
TX(3.3V) RX

In the name of science the author ran an experiment on the ESP8266 rev2 using 5v logic AND 5v VCC/CH_PD for a day...so don't do it because it's wrong...but it works


Upgrading Firmware

The '8266 can accept new firmware flashed to it that can fix bugs, add AT commands, or even a program to run the device standalone using the onboard MCU. Different versions of the device will come with different versions of the firmware from the factory. Some newer devices may support firmware upgrade over wifi or OTA(Over The Air) while others will require manual pin connections to complete the upgrade. Once an upgrade to an OTA compatible firmware is completed there will be no need for manual intervention in the future. You can connect your device using a USB->Serial adapter(must be 5 volts TTL dont use a 'real' serial port!), FTDI, or an Arduino Uno works nicely and is probably available at your local electronics store. Using some devices might require using an external power supply should it not be able to provide enough current. Arduino UNO does have enough even when powered by USB only.

Once you have connected the device to a serial adapter of some sort and plugged it into your PC, you can open up a terminal emulator of your choice(PuTTY, Arduino monitor,etc). Different versions of the firmware will default to different baud rates in the terminal so it is possible that you will see gibberish displayed from the device. If this is the case you will need to experiment with different speeds until, after a fresh power cycle, it displays some giberish then "OK" to indicate it is operational and you are running the right speed to receive the characters correctly. Common default speeds are 115200, 57600, 9600 etc. You can check your firmware version with "AT+GMR" and experiment with manually using the AT commands.

Once have verified your device is setup and working correctly over a serial connection it is time to get our new firmware we will need to enable OTA updates. ThisFile:Esp8266flash.zip archive contains a working flasher and firmware file that will bring your device to an OTA ready state. Before you can use the program you must put the device into a state that is ready to receive new firmware. This is accomplished by grounding GPIO0 and momentarily grounding RST. Once the device boots back up with GPIO0 still held low, it is awaiting for a firmware file over the serial interface. Simple open the program, select your COM port for the serial device, select the firmware file you want to flash and click program. The process will take about 1 minute to complete, and may indicate an error has occurred at 99% but the firmware will be intact. If everything went well you should be able to do another "AT+GMR" and see that your version is now newer. If everything went really well you should now be able to do "AT+CIUPDATE", after manually using AT commands to setup the network connection. Let's take a quick look at how to do that:


TODO