USD

Feather HUZZAH ESP8266 Guide Datasheet by Adafruit Industries LLC

View All Related Products | Download PDF Datasheet
m e t s V. s n: n n r a m ,0“ u r f a d a
Adafruit Feather HUZZAH ESP8266
Created by lady ada
Last updated on 2019-06-20 08:39:54 PM UTC
* adafruit learning system 00000002059 14 12 13 15 a 15 , IIPSZO V133 HQ"! "51 Imam-xv roman ‘ macs: 1m ‘ZI'dSi W101 3H \‘71 5" I J1, MW .- duuv“
Overview
Feather is the new development board from Adafruit, and like it's namesake it is thin, light, and lets you fly! We
designed Feather to be a new standard for portable microcontroller cores.
This is the Adafruit Feather HUZZAH ESP8266 - our take on an 'all-in-one' ESP8226 WiFi development board with built
in USB and battery charging. Its an ESP8266 WiFi module with all the extras you need, ready to rock! We have other
boards in the Feather family, check'em out here (https://adafru.it/jAQ).
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 4 of 55
At the Feather HUZZAH's heart is an ESP8266 WiFi microcontroller clocked at 80 MHz and at 3.3V logic. This
microcontroller contains a Tensilica chip core as well as a full WiFi stack. You can progam the microcontroller using the
Arduino IDE for an easy-to-run Internet of Things core. We wired up a USB-Serial chip that can upload code at a
blistering 921600 baud for fast development time. It also has auto-reset so no noodling with pins and reset button
pressings.
To make it easy to use for portable projects, we added a connector for any of our 3.7V Lithium polymer batteries and
built in battery charging. You don't need a battery, it will run just fine straight from the micro USB connector. But, if you
do have a battery, you can take it on the go, then plug in the USB to recharge. The Feather will automatically switch
over to USB power when its available.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 5 of 55
Here's some handy specs!
Measures 2.0" x 0.9" x 0.28" (51mm x 23mm x 8mm) without headers soldered in
Light as a (large?) feather - 6 grams
ESP8266 @ 80MHz or 160 MHz with 3.3V logic/power
4MB of FLASH (32 MBit)
3.3V regulator with 500mA peak current output
CP2104 USB-Serial converter onboard with 921600 max baudrate for uploading
Auto-reset support for getting into bootload mode before firmware upload
9 GPIO pins - can also be used as I2C and SPI
1 x analog inputs 1.0V max
Built in 100mA lipoly charger with charging status indicator LED
Pin #0 red LED for general purpose blinking. Pin #2 blue LED for bootloading debug & general purpose blinking
Power/enable pin
4 mounting holes
Reset button
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 6 of 55
}J11.2u:; , LiPulg Ban qyusa charge 7 m 0 On 0 0 pimn ,0 7 nuifiowmo , uwxamro ”WHO 4 O
Comes fully assembled and tested, with a USB interface that lets you quickly use it with the Arduino IDE or NodeMCU
Lua. (It comes preprogrammed with the Lua interpretter) We also toss in some header so you can solder it in and plug
into a solderless breadboard. Lipoly battery and USB cable not included (but we do have lots of options in the shop if
you'd like!)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 7 of 55
* adafruir learning system mg IIUZZAH E9874;— fea ummnmnmg 0.9 mdfiffiylfi ) M Di 3; ZI-dSi mm yUSB charge _ O O Linen; Ban ' FeatherHUZZflH , 92 mm “27 6 ,5 a D. m s h F B , H 4. 013,0 mNHwNHu
Pinouts
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 8 of 55
-.-. IBMINL-IV loam WINS! 1m ZI d5] IMVZ' (II 33 m! 46 2 ‘CL sun opacn%ooom* q IBMINL-IV loam mzusa 1m IdSJIWZ'GIJJi I :4 Lu] [:5 :5 5: b5 5, r! a: n U: Uu -.) 1
Power Pins
GND - this is the common ground for all power and logic
BAT - this is the positive voltage to/from the JST jack for the optional Lipoly battery
USB - this is the positive voltage to/from the micro USB jack if connected
EN - this is the 3.3V regulator's enable pin. It's pulled up, so connect to ground to disable the 3.3V regulator
3V - this is the output from the 3.3V regulator, it can supply 500mA peak (try to keep your current draw under
250mA so you have plenty for the ESP8266's power requirements!)
Logic pins
This is the general purpose I/O pin set for the microcontroller. All logic is 3.3V
Serial pins
RX and TX are the serial control and bootloading pins, and are how you will spend most of your time communicating
with the ESP module
The ESP8266 runs on 3.3V power and logic, and unless otherwise specified, GPIO pins are not 5V safe! The
analog pin is also 1.0V max!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 9 of 55
q m I N C . N u: uz NL’ GNDRDC'
The TX pin is the output
from
the module and is 3.3V logic.
The RX pin is the input
into
the module and is 5V compliant (there is a level shifter on this pin)
These are connected through to the CP2104 USB-to-Serial converter so they should
not
be connected to or used
unless you're super sure you want to because you will also be getting the USB traffic on these!
I2C & SPI pins
You can use the ESP8266 to control I2C and SPI devices, sensors, outputs, etc. While this is done by 'bitbanging', it
works quite well and the ESP8266 is fast enough to match 'Arduino level' speeds.
In theory you can use
any
pins for I2C and SPI but to make it easier for people using existing Arduino code, libraries,
sketches we set up the following:
I2C SDA = GPIO #4 (default)
I2C SCL = GPIO #5 (default)
If you want, you can connect to I2C devices using other 2 pins in the Arduino IDE, by calling Wire.pins(
sda, scl
)
before any other Wire code is called (so, do this at the begining of setup() for example
Likewise, you can use SPI on any pins but if you end up using 'hardware SPI' you will want to use the following:
SPI SCK = GPIO #14 (default)
SPI MOSI = GPIO #13 (default)
SPI MISO = GPIO #12 (default)
GPIO pins
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 10 of 55
, u/Imrm w "3;! mar: us: —‘
This breakout has 9 GPIO: #0, #2, #4, #5, #12, #13, #14, #15, #16 arranged at the top edge of the Feather PCB
All GPIO are 3.3V logic level in and out, and are not 5V compatible. Read the full spec sheet (https://adafru.it/f1E) to
learn more about the GPIO pin limits, but be aware the maximum current drawn per pin is 12mA.
These pins are general purpose and can be used for any sort of input or output. Most also have the ability to turn on an
internal pullup. Many have
special
functionality:
GPIO #0, which does not have an internal pullup, and is also connected a red LED. This pin is used by the ESP8266 to
determine when to boot into the bootloader. If the pin is held low during power-up it will start bootloading! That said,
you can always use it as an output, and blink the red LED - note the LED is reverse wired so setting the pin LOW will
turn the LED on.
GPIO #2, is also used to detect boot-mode. It also is connected to the blue LED that is near the WiFi antenna. It has a
pullup resistor connected to it, and you can use it as any output (like #0) and blink the blue LED.
GPIO #15, is also used to detect boot-mode. It has a pulldown resistor connected to it, make sure this pin isn't pulled
high on startup. You can always just use it as an output
GPIO #16 can be used to wake up out of deep-sleep mode, you'll need to connect it to the RESET pin
Also note that GPIO #12/13/14 are the same as the SCK/MOSI/MISO 'SPI' pins!
Analog Pins
There is also a single analog input pin called A. This pin has a ~1.0V maximum voltage, so if you have an analog
voltage you want to read that is higher, it will have to be divided down to 0 - 1.0V range
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 11 of 55
) sCL sua , Q on o“ p o“ o“ ow L ) 01 5 V in. sun , 93 7 602 " “HIM-IV man 20130150901 1’9"! HS]: ,, Win Id MIMI 1m E ZI'dSi HIM (II JJJ rhwww fifi; ‘nxArx vap "Q in? 3‘ u U u ,3: a
Other control pins
We have a few other pins for controlling the ESP8266
RST - this is the reset pin for the ESP8266, pulled high by default. When pulled down to ground momentarily it
will reset the ESP8266 system. This pin is 3.3V logic only
EN (CH_PD) - This is the enable pin for the ESP8266, pulled high by default. When pulled down to ground
momentarily it will reset the ESP8266 system. This pin is 3.3V logic only
NC Pins
The rest of the pins are labeled NC which means Not Connected - they are not connected to anything and are there as
placeholders only, to maintain physical compatibility with the other boards in the Feather line!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 12 of 55
* adafruit learning system ’rfr'FHF‘I“ H‘ ..E.
Assembly
We ship Feathers fully tested but without headers attached - this gives you the most flexibility on choosing how to use
and configure your Feather
Header Options!
Before you go gung-ho on soldering, there's a few options to consider!
The first option is soldering in plain male headers, this
lets you plug in the Feather into a solderless breadboard
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 13 of 55
Another option is to go with socket female headers. This
won't let you plug the Feather into a breadboard but it
will let you attach featherwings very easily
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 14 of 55
We also have 'slim' versions of the female headers, that
are a little shorter and give a more compact shape
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 15 of 55
Finally, there's the "Stacking Header" option. This one is
sort of the best-of-both-worlds. You get the ability to
plug into a solderless breadboard
and
plug a
featherwing on top. But its a little bulky
Soldering in Plain Headers
Prepare the header strip:
Cut the strip to length if necessary. It will be easier to
solder if you insert it into a breadboard - long pins down
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 16 of 55
Add the breakout board:
Place the breakout board over the pins so that the short
pins poke through the breakout pads
And Solder!
Be sure to solder all pins for reliable electrical contact.
(For tips on soldering, be sure to check out our Guide to
Excellent Soldering
(https://adafru.it/aTk)
).
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 17 of 55
u; was Egg if my;
Solder the other strip as well.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 18 of 55
u." -""+ u...‘ I A ‘
You're done! Check your solder joints visually and
continue onto the next steps
Soldering on Female Header
Tape In Place
For sockets you'll want to tape them in place so when
you flip over the board they don't fall out
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 19 of 55
Flip & Tack Solder
After flipping over, solder one or two points on each
strip, to 'tack' the header in place
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 20 of 55
* smuuws.» ‘ees' rkaiher n8 mwwmse . Mswnnms .. «arm: n. mu Feamer no mr. S‘,‘ mmmcxsem R2 nus—nous” new: c 3.3u
And Solder!
Be sure to solder all pins for reliable electrical contact.
(For tips on soldering, be sure to check out our Guide to
Excellent Soldering
(https://adafru.it/aTk)
).
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 21 of 55
n; w m? um My IL B‘v any» a mu m
You're done! Check your solder joints visually and
continue onto the next steps
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 22 of 55
* adafruit learning system
Power
Management
Battery + USB Power
We wanted to make the Feather HUZZAH easy to power both when connected to a computer as well as via battery.
There's two ways to power a Feather. You can connect with a MicroUSB cable (just plug into the jack) and the Feather
will regulate the 5V USB down to 3.3V. You can also connect a 4.2/3.7V Lithium Polymer (Lipo/Lipoly) or Lithium Ion
(LiIon) battery to the JST jack. This will let the Feather run on a rechargable battery. When the USB power is powered,
it will automatically switch over to USB for power, as well as start charging the battery (if attached) at 100mA. This
happens 'hotswap' style so you can always keep the LiPoly connected as a 'backup' power that will only get used
when USB power is lost.
Don't power the Huzzah ESP8266 with a CanaKit 5V power supply, these power supplies have been
destroying the CP2104 chip.
The JST connector polarity is matched to Adafruit LiPoly batteries. Using wrong polarity batteries can destroy
your Feather
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 23 of 55
l©f"' 1893 0 0 0 1148,8593? 9:9“ 9’ u/l/m' m "51+ 14 nay-z us: Hanna-IV mu macs: 1m lI'dSi IMVl'flI M u rm p I! “z NCNC ' 000b5 20130 O O O 050‘ -.) 1s a 16 km. LSEM nil/m m “1- VI Iver: H51 alum-Iv ml wads: 1m
The above shows the Micro USB jack (left), Lipoly JST jack (top left), as well as the 3.3V regulator and changeover
diode (just to the right of the JST jack) and the Lipoly charging circuitry (right below the regulator).
There's also a CHG LED next to the USB jack, which will light up while the battery is charging. This LED might also
flicker if the battery is not connected.
Power supplies
You have a lot of power supply options here! We bring out the BAT pin, which is tied to the lipoly JST connector, as
well as USB which is the +5V from USB if connected. We also have the 3V pin which has the output from the 3.3V
regulator. We use a 500mA peak low-dropout regulator. While you can get 500mA from it, you can't do it continuously
from 5V as it will overheat the regulator. We use this to power the ESP8266 which can draw spikes of 250+mA
(although its not continuous).
You should be able to budget about 250mA current available from the regulator, which will leave plenty for the WiFi
module.
Measuring Battery
If you're running off of a battery, chances are you wanna know what the voltage is at! That way you can tell when the
battery needs recharging. Lipoly batteries are 'maxed out' at 4.2V and stick around 3.7V for much of the battery life,
then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 24 of 55
"Ill-11119935 "0951+ Id new: us: m ' sauna-1v woman : e 5: mzusa mm ”s (HS! IFINZIGI JJJ , UV‘UL NE W ‘ §cEnfi Elffix'fi'i v v v u v w‘ u u u u L75
tell when you're heading below 3.7V
Since the ESP8266 does not have multiple ADC pins, we didn't want to 'sacrifice' one for Lipoly battery monitoring.
However we do have a tutorial that mentions how to do it, using two resistors. You can check out the wiring diagram
here (use the VBat pin to measure) (https://adafru.it/jCY) and the code here (https://adafru.it/jCZ).
ENable pin
If you'd like to turn off the 3.3V regulator, you can do that with the EN(able) pin. Simply tie this pin to Ground and it will
disable the 3V regulator. The BAT and USB pins will still be powered
Alternative Power Options
The two primary ways for powering a feather are a 3.7/4.2V LiPo battery plugged into the JST port
or
a USB power
cable.
If you need other ways to power the Feather, here's what we recommend:
For permanent installations, a 5V 1A USB wall adapter (https://adafru.it/duP) will let you plug in a USB cable for
reliable power
For mobile use, where you don't want a LiPoly, use a USB battery pack! (https://adafru.it/e2q)
If you have a higher voltage power supply, use a 5V buck converter (https://adafru.it/DHs) and wire it to a USB
cable's 5V and GND input (https://adafru.it/DHu)
Here's what you cannot do:
Do not use alkaline or NiMH batteries and connect to the battery port - this will destroy the LiPoly charger and
there's no way to disable the charger
Do not use 7.4V RC batteries on the battery port - this will destroy the board
The Feather
is not designed for external power supplies
- this is a design decision to make the board compact and low
cost. It is not recommended, but technically possible:
Connect an external 3.3V power supply to the 3V and GND pins. Not recommended, this may cause unexpected
behavior and the EN pin will no longer. Also this doesn't provide power on BAT or USB and some
Feathers/Wings use those pins for high current usages. You may end up damaging your Feather.
Connect an external 5V power supply to the USB and GND pins. Not recommended, this may cause unexpected
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 25 of 55
behavior when plugging in the USB port because you will be back-powering the USB port, which
could
confuse
or damage your computer.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 26 of 55
Do * adafruit learning system
Using NodeMCU
Lua
Each Feather HUZZAH ESP8266 breakout comes pre-programmed with NodeMCU's Lua interpreter. As of this writing,
we ship with NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4 but it may be more recent
Lua is still a work in progress, so we strongly recommend visiting NodeMCU and updating your Lua version to the very
latest as they have the ability to make you the latest continuous build (https://adafru.it/wAq). Then follow their guide on
how to update Lua! (https://adafru.it/wAr)
The Lua interpreter runs on the ESP8266 and you can type in commands and read out the results over serial. In order
to upload code to the ESP8266 and use the serial console, connect any data-capable micro USB cable to the Feather
HUZZAH and the other side to your computer's USB port. Install the required CP2104 USB driver to have the
COM/Serial port appear properly (https://adafru.it/jCs)
Don't forget to visit esp8266.com for the latest and greatest in ESP8266 news, software and
gossip! (https://adafru.it/f1F)
Open up serial console
Next up, on your computer, use a serial console program such as CoolTerm (Mac) or Putty (Windows) or screen (linux).
Teraterm seems to dislike the initial 74400bps data stream from the ESP8266 so you can try it but you'll possibly need
to reset the terminal software.
Connect up to the COM or Serial port used by your cable, at 9600 Baud
Make sure you have turned off any hardware handshake or flow control
Putty isn't good with pasting code in, so you may not be able to copy-n-paste!
Also make sure you have line endings set to CRLF "\r\n"
Use any serial console program you like, we just happen to be used to Putty!
Don't forget to install the USB driver for the CP2104 USB-to-Serial chip!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 27 of 55
fi va Configuram u E CHICQDVY 7 5mm am ommns 1m Wm Pm’v sessmn “’9?“ Speofylhe desnnalmn ynu warm 4:: comma Termina‘ s ‘ ‘ 5 d mum arm as me ‘ M Dome 5600 \ Features Cannecman Iype , Wmdow Rag Ielnet Wogm 55H . Sega $2M“ Load save grams a sum sessmn avluur “mm" Savgd 5mm: Selecmon 50‘0“” [Mann Semngs A Lam , Cunnedmn Mumu Down ' Data ET 5 PF mey COMM Pw 53!” Tana gm :1 22‘s: New cows V15 2 V . SSH SW‘ case window on 9431 Always Neva o anryun deanm T -m V g comes - vmv
Once the terminal software is connected, click the Reset button on the Feather HUZZAH ESP8266 board to reset it and
have it print out the welcome message:
If you don't get this message, first check that the red/blue leds flickered when you press the reset button. If they didnt,
make sure you've got the right baud rate selected in the software (9600)
Hello world!
Ok we can now turn on an LED. There is a red LED on each board, connected to GPIO #0
NodeMCU Lua's pinouts are not the same as the Arduino/gcc pinouts. We print the Arduino pinouts on the
board so watch out!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 28 of 55
So to set the pin #0 LED on and off (which would be pin #3 in Lua) first make it an output:
Turn the LED on with:
And off with:
You can make this a little more automated by running a longer script.
For longer text, pasting can be difficult as the lua interpreter needs a little delay time between characters and also
require CR-LF settings. For that reason you may want to paste each line and then hit return manually.
The Lua documentation for the ESP8266 has GPIO #4 and #5 swapped so if #4/#5 aren't working for you, try
swapping!
Pin Notes PCB/Arduino NodeMCU/Lua
No pullups! 0 3
2 4
3 9
4 1
5 2
9 11
10 12
12 6
13 7
14 5
15 8
16 0
gpio.mode(3, gpio.OUTPUT)
gpio.write(3, gpio.LOW)
gpio.write(3, gpio.HIGH)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 29 of 55
The LED will now be blinking on and off.
Note that since its in a loop, its not possible to get it to stop via the interpreter. To stop it, click the Reset button again!
This code halts the processor during the tmr.delay, a smarter way to blink an LED is to use the timer capability to set off
the LED control (code from here (https://adafru.it/wGA))
Scanning & Connecting to WiFi
We'll continue with a quick demo of scanning for WiFi and connecting.
Once you're back at the Lua prompt, set the ESP8266 into WiFi Client mode with
Then you can run the scanner and have it print out the available AP's
while 1 do
gpio.write(3, gpio.HIGH)
tmr.delay(1000000) -- wait 1,000,000 us = 1 second
gpio.write(3, gpio.LOW)
tmr.delay(1000000) -- wait 1,000,000 us = 1 second
end
-- Pin definition
local pin = 3
local status = gpio.LOW
local duration = 1000 -- 1 second duration for timer
-- Initialising pin
gpio.mode(pin, gpio.OUTPUT)
gpio.write(pin, status)
-- Create an interval
tmr.alarm(0, duration, 1, function ()
if status == gpio.LOW then
status = gpio.HIGH
else
status = gpio.LOW
end
gpio.write(pin, status)
end)
wifi.setmode(wifi.STATION)
-- print ap list
function listap(t)
for k,v in pairs(t) do
print(k.." : "..v)
end
end
wifi.sta.getap(listap)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 30 of 55
or for more detail...
We can connect to the access point with wifi.sta.config and wifi.sta.connect - it will take a second or two to complete
the connection, you can query the module to ask the status with wifi.sta.status() - when you get a 5 it means the
connection is completed and DHCP successful
WebClient example
Once you're got the IP address you can connect to adafruit, for example, and read a webpage and print it out:
You can also have the module do DNS for you, just give it the hostname instead of IP address:
This is just a light overview of testing out your HUZZAH ESP breakout! For much more, check out NodeMCU's
documentation page https://nodemcu.readthedocs.io/ (https://adafru.it/wGB) for the details on what functions are
available to you, as well as http://www.lua.org (https://adafru.it/f1N) to learn more about the Lua scripting language
-- print ap list
function listap(t)
for ssid,v in pairs(t) do
authmode, rssi, bssid, channel = string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)")
print(ssid,authmode,rssi,bssid,channel)
end
end
wifi.sta.getap(listap)
wifi.sta.config("accesspointname","yourpassword")
wifi.sta.connect()
tmr.delay(1000000) -- wait 1,000,000 us = 1 second
print(wifi.sta.status())
print(wifi.sta.getip())
sk=net.createConnection(net.TCP, 0)
sk:on("receive", function(sck, c) print(c) end )
sk:connect(80,"207.58.139.247")
sk:send("GET /testwifi/index.html HTTP/1.1\r\nHost: www.adafruit.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 0)
sk:on("receive", function(sck, c) print(c) end )
sk:connect(80,"www.adafruit.com")
sk:send("GET /testwifi/index.html HTTP/1.1\r\nHost: www.adafruit.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 31 of 55
* adafrult learning system noon E91166” VEM AI-TNIIIKEI - {SH 2.4512 ,_
Using Arduino IDE
While the Feather HUZZAH ESP8266 comes pre-programmed with NodeMCU's Lua interpretter, you don't have to use
it! Instead, you can use the Arduino IDE which may be more familar. This will write directly to the firmware, erasing the
NodeMCU firmware, so if you want to go back to Lua, use the flasher to re-install it (https://adafru.it/f1O)
Don't forget to visit esp8266.com for the latest and greatest in ESP8266 news, software and
gossip! (https://adafru.it/f1F)
In order to upload code to the ESP8266 and use the serial console, connect any data-capable micro USB cable to the
Feather HUZZAH and the other side to your computer's USB port.
Don't forget you will also need to install the SiLabs CP2104 Driver:
https://adafru.it/vrf
https://adafru.it/vrf
On Mac OS 10.13 and higher, in addition to installing, you will have to give the CP2104 kernel driver permission to load.
You can find out if you need to give additional permission by visiting your Security & Privacy settings system
preferences screen after installing and looking for the message that says, 'System software from developer "SiLabs"
was blocked from loading', like in the picture below.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 32 of 55
Security & privacy Q ile'Vauk user change Passwuns C wean-n3 passvmld immedialew c mrgeeporscmn saver beins Firewall Privacy A loin pawn! has been 5:1 w E Shaw : mange whenlhe salami: locked Set Lock Message“ C Disable amnmal'n: Ingin Alan apps Wed lmm: Owsmre 3 @App sum and identified develnpers \ mun. mlmm develnper"—" ms W lmm Inning. W2 Click me luck tn prevail lunher flanges.
To allow the driver to load, click the lock icon, enter your password, and click "Allow" next to the warning message.
After that, you may have to restart your computer before following the steps below and connecting to your Huzzah in
the Arduino app.
https://adafru.it/ymF
https://adafru.it/ymF
Install the Arduino IDE 1.6.8 or greater
Download Arduino IDE from Arduino.cc (1.6.8 or greater) (https://adafru.it/f1P) from Arduino.cc
The latest is usually the best
Install the ESP8266 Board Package
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into
Additional Board Manager URLs
field
in the Arduino v1.6.4+ preferences.
If you are using Mac OS 10.12.6 (Sierra) and you cannot upload with the latest Mac OS VCP driver, please try
the legacy v4 driver below. Note you will need to uninstall the v5 driver using uninstall.sh (in the driver
package)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 33 of 55
I , . Pm skumhnnk Inuflon: luxelslefl/Dacummts(Amulnn name ‘ Edmor language Syilem Ddault (mum rum 0! Arduina) Edkorfonl slk: 10 show when oulnul during 3 (nmnllmnn : unlmd Cmnpflummmgs. in“: : Ll Dlsfliy HM numbers u Enaml cm Foldmg a may um aherllvload U Us: Enema] editcv 6 check in: updates on nan-up 8 updm sketch mes m new extension an we (.vde 7> Jr») C Savewhm verifying or unloading Amway-i1 BeardsMinagtrUle. MIDl/aniuinn.§n6266.wm/stibklwtkauLuuBZGfitam ndexmn @ M07: prefevenus can he «1m mvrcdv m m file Nuns/m“!Ubilrv/Arduinolslnllkmu.m («in only when Ardumo .5 am running) mm “mm!" "puma Ilualule‘ vae AH : m... yuursel/(h xmu us mm w m noun: mam mans mm, EAmn M II!!!“ n mun-m IurII mu m m- mam mm m m mm mum—sm-nan, m a! [an Mun-u), w u mm: mm), mm mm 5m“ (Er-m, 5mm Lip-m. mm m Inshlllrln... —:1- -un: m Esiliflbnmmmhy "my. 2,; n I-uum has mama m m; {lulu Guam mm m mum mnwmssmsqmm. magnum 5(5P12 mm), m m mm: mm}, mum mun» gazes 15y 12;:st m. x 0 mm m mm mm. m mm. 2 m mummy, 5mm- 2921mm 51. W” m min, 5m (sun mm). ism (wmnm «mm, mm 3mm. mm mm
Visit our guide for how to add new boards to the Arduino 1.6.4+ IDE for more info about adding third party
boards (https://adafru.it/f7X).
Next, use the Board manager to install the ESP8266 package.
After the install process, you should see that esp8266 package is marked INSTALLED. Close the Boards Manager
window once the install process has completed.
If you want to use this board with Adafruit IO Arduino - make sure you're on version 2.5.1 or ABOVE.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 34 of 55
Ann: M... Cum ham: m r.- Enwdmgaldud Saul Mum Saul le “mum cmsnmu (mama A Guuk W Module Guuk mans Module memo [KP-1) Moduld mm m HUZZAH mm Shoo um 11) flex-YIN) ) mm...“ warn Fimwlvulpduu mum; , ‘ _ mum,“ ammmvmwmum mum») Mug Lem “Nun!“ ; 3 cm Dummy: “n m“ m man or m: 2_ “ “ A “cm“ [risen-sh: 0mm mm dellYflD) “ISM Sir: “IMGMWSY MID ) Debug pom “W Mn 03 [E941 Mmulg] s n mm mm “v2 w... m- WU m mm: Mom-Ia mmjm WNW“..5M mmmuwnmmmv. m um; Pm WWW-nu mkitmn 53mm,“ wmmungm dummy c. w.) mum @ :spblinkl Alduino 1.5.9 I Fl: Edi Skad- LEE Hap Am Fm cum Archive sum I ”WW Flfikod'ngalhhad ”mum Sci-l Mania: must-mu , Sui: mm: cwsnwl ”Bf 111: F1" Z load: ‘Adinik mzzm [spams- > mu sump U > . . ’ mmdflp, M81: maMsnFPs) Serialmegi cwunmuxy-uow 0 mm ) "plaza 5px;: mm" m MHz » vnm 1:301:10 I Pm ‘ serm.pri- 533°31'11"?!» digitalflrh: I - delavwm): Mgr-mm AldeDEG > mqualwri Bun W delayuno .
Setup ESP8266 Support
When you've restarted, select Adafruit Feather HUZZAH ESP8266 from the Tools->Board dropdown
80 MHz as the CPU frequency
You can keep the Flash Sizeat "4M (3M SPIFFS)
For Upload Speed, select 115200 baud (You can also try faster baud rates, we were able to upload at a blistering
921600 baud but sometimes it fails & you have to retry)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 35 of 55
® espbllnkl Ardulno 1.69 file Em Skekh Tools Hdp Ame Fomm cum A-(lliv: sum. ”9“” n: Encodmg & Reload Guilds and Sonal Manual Chl‘ShmoM Selinl Planer comma 'defule PI“ 2 l Board: "Mafluit HUZZAH 6mm" r ‘ mo mop I) u a ’ plmm ”m Flush 5.1: M (3M SPIFFS) Seual .beg; CPU Flequency "30 MHz" , 1 Upload Speed: "115200" I 0 115200 u vmd Joaptl ( PM 9600 Sena] Mm Gel Board IMO 57600 dlguolm: ” M 756000 delmmm ; nglimmu: Atmd [one u 921600 ngltaJWn: Bum Romantic! ' ’ (Pu Fllqfllle: “30 MHz“ > mm loop “P'Wd 5P¢¢¢ "115130" ' , rut : Pun I Sonal pods l P m 159" I com limmu: W "Y cow Bum Boofloadev COMll Ens: Flash: 'omy Skeldl' Nev/cusmayslszomm“ senal polls en Bo-rd Irma lduv/cuMALs Magnum": "AVRISP Inkll' lle/cu.SOC Bum mlmdu Idw/ouslmomn-lmomlng-m »/ [dev/CUVSLAE USBloUART Id vIc mmlllaZl
The matching COM port for your FTDI or USB-Serial cable
On a mac, you should look for the "SLAB_USBtoUART" port
Blink Test
We'll begin with the simple blink test
Enter this into the sketch window (and save since you'll have to)
void setup() {
pinMode(0, OUTPUT);
}
void loop() {
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
}
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 36 of 55
- - —- _ espm‘mmm :- Eh m: [an Sketch Took Hdp esphhnk Wm mupn < ,nmmdem,="" au‘rw‘n:="" »="" wm="" laapu="" «="" dmcawmuu,="" mam:="" denytsum:="" dmcawmuu,="" m="" ;="" denytsum:="">
Now you can simply upload! The Feather HUZZAH has built in auto-reset that puts it into bootloading mode
automagically
The sketch will start immediately - you'll see the LED blinking. Hooray!
Connecting via WiFi
OK once you've got the LED blinking, lets go straight to the fun part, connecting to a webserver. Create a new sketch
with this code:
/*
* Simple HTTP get webclient test
*/
#include <ESP8266WiFi.h>
const char* ssid = "yourssid";
const char* password = "yourpassword";
const char* host = "wifitest.adafruit.com";
void setup() {
Serial.begin(115200);
delay(100);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 37 of 55
Dont forget to update
const char* ssid = "yourssid";
const char* password = "yourpassword";
to your access point and password, then upload the same way: get into bootload mode, then upload code via IDE
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
int value = 0;
void loop() {
delay(5000);
++value;
Serial.print("connecting to ");
Serial.println(host);
// Use WiFiClient class to create TCP connections
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
// We now create a URI for the request
String url = "/testwifi/index.html";
Serial.print("Requesting URL: ");
Serial.println(url);
// This will send the request to the server
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
delay(500);
// Read all the lines of the reply from server and print them to Serial
while(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}
Serial.println();
Serial.println("closing connection");
}
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 38 of 55
"flammlmmqmn 1 s. m [an Skmn w. Hw {Wm m m. m, mm.“ -.. was», , mm; 4 m“. [unvhH‘W mm.» . Icnnnncnnq m murmur. norm Hm can-mud IF Adm: mmJu commune ca m.adn[m1r.cam Requemuv m: ltenvufi/lndexmunl nun/1.: Inn on race: Frl, 24 pp: mas 2u:|2:54 m Server: Apache Accessfincxulrnllmrfleader: Drlqln, erqnzsmdfllm, Eunmnrr'Iype, Rmpt, Rmprr!) Remus-Concrnl-AllM-chhod:: an, Post. OPTIONS A502::fincxnlrllllmkczedemua]a: true Access-Concrnl-Hax-lqe: 112mm Acummanqu: 17m: x-HMvPaqupted: 13.313741“ Vary: Auctptrinmdlnq cacnrconmn: “rage-U, naicach: Contentrlenam: u cunnecnu close humping: next/hum mu m a can of the ccaunn modulel If yuu can Rad mu, 1:: among :1 c1051.», cumectlun v Amman: mum . llmhadv
Open up the IDE serial console at 115200 baud to see the connection and webpage printout!
That's it, pretty easy!
This page was just to get you started and test out your module. For more information, check out the ESP8266 port
github repository (https://adafru.it/eSH) for much more up-to-date documentation!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 39 of 55
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 40 of 55
* adafruit learning system
Using
MicroPython
Using MicroPython (https://adafru.it/DH1)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 41 of 55
Do * adafruit learning system : L 2 :1 x o s mnrnun mnusmzs mu w: mam“ 217-“ an ma: {sum mm m : \ 5 Mag: 1/: ‘
Downloads
Datasheets & Files
AP2112K-3.3V regulator onboard (https://adafru.it/mdb)
CP2104 USB-to-Serial converter (https://adafru.it/jCr)
EagleCAD PCB Files on GitHub (https://adafru.it/olc)
Fritzing object in Adafruit Fritzing Library (https://adafru.it/c7M)
https://adafru.it/z4d
https://adafru.it/z4d
More info about the ESP8266
ESP8266 specification sheet (https://adafru.it/f1E)
FCC test report (https://adafru.it/f1S) for the module used on this breakout
CE test report for the module used on this breakout (https://adafru.it/f1U)
Huuuuge amount of information on http://www.esp8266.com/ (https://adafru.it/f1F) community forum!
NodeMCU (Lua for ESP8266) webpage (https://adafru.it/f1G) with examples and documentation on the Lua
framework
Arduino IDE support for ESP8266 (https://adafru.it/eSH)
NodeMCU PyFlasher - a cross platform ESP flashing tool (https://adafru.it/Bg4)
Don't forget to visit esp8266.com for the latest and greatest in ESP8266 news, software and
gossip! (https://adafru.it/f1F)
Schematic
Click to enlarge
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 42 of 55
Fabrication Print
Dimensions in inches
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 43 of 55
* adafruit learning system
ESP8266 F.A.Q.
When I connect stuff to some of the pins, the Huzzah stops working. Whats up with that?
The ESP8266 uses some of the pins as 'boot mode' pins so on boot they must be set to certain values:
CH_PD (EN) should be always pulled high (it will disable the entire module if low)
RST should be always pulled high (it will disable the entire module if low)
GPIO 0 sets whether the bootloader is active, it must be pulled HIGH during power up/reset for the user program
to run. If it's pulled LOW, it will activate the bootloader. The built-in red LED on #0 pulls it up
GPIO 2 must be pulled high on power up/reset.
GPIO 15 must be pulled low on power up/reset.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 44 of 55
My Huzzah board keeps crashing and resetting, whats up with that?
The most common reason for crashes is power failure. Make sure you're powering the Huzzah with a good ~5V
power supply, and if you're using a USB-Serial cable, that it's plugged into the mainboard of your computer or
through a powered hub!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 45 of 55
I can't seem to find the Serial port on my computer for the Feather HUZZAH?
Don't forget to install the CP2104 VCP drivers for your computer, they are required!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 46 of 55
I still can't seem to find the Serial port on my computer for the Feather Huzzah!
Many cheap electronics come with charge-only USB cables, which cause headaches later. Make sure you are using
a proper data/sync USB cable. If you find a cable that is charge-only (not data/sync also) throw it out so you don't
have the same problem again.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 47 of 55
So, I’m getting a 'no such file' error compiling for ESP8266 on my Mac
If your error message looks like this:
fork/exec /Users/xxxxxxx/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-
2/bin/xtensa-lx106-elf-g++: no such file or directory
Error compiling.
To fix this problem, do this:
1. Open the Boards Manager in the Arduino IDE
2. Uninstall the ESP8266 support
3. go to your ~LIbrary folder (in the Finder, select "Go::Go to folder:, and enter ~Library ). Find the folder Arduino15.
4. In the Arduino15 folder, go into packages, and delete the folder esp8266
5. Go back to the Arduino IDE, and install ESP8266 board support.
6. Now go back to the Finder, and check that you have the xtensa-lx106-elf-g++ file in the
path
Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++
7. That's it!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 48 of 55
Whenever I start or reset the ESP8226 there's a bunch of "gibberish" on the Serial console
This is the ROM debug messages, it's transmitted at 74880 baud so you rarely see it in proper 'ascii output' - instead
usually it gets corrupted into a bunch of strange characters.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 49 of 55
I'm having difficulties uploading to the HUZZAH with the Arduino IDE
Make sure you're using a good quality USB/Serial cable. Install the official drivers for that cable too! We've also
noticed that PL2303-based cables don't work on Macs for some reason. FTDI or CP210x based chipsets work best
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 50 of 55
I tried that, but I'm still having difficulties uploading with the Arduino IDE
Sometimes, it helps to switch the board type to "Generic ESP8266 Module". Set the Reset Method to "nodemcu"
See this forum post
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 51 of 55
I'm stuck in bootloader mode and can't upload
You say your led is stuck on dim and you get an error trying to upload? And you're sure your serial cable is
connected and working correctly? Well, here's a potential fix: Connect the GPIO0 pin to GND through a 220 ohm
resistor. Leave it connected while you upload. You may have to try it a couple of times, but it should eventually
upload and get the HUZZAH unstuck from bootload mode! You can then remove the resistor connection, and your
HUZZAH will be happy ever after!
(Note: you may also have to tie RST and EN (CH_PD) together to get this to work. Remove the connection once you
have the module programmed).
Thanks to forum user misslevania for the tip!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 52 of 55
I can't get Lua to respond to my commands
Make sure your terminal software is sending correct line endings! The default PuTTY settings may be wrong when
trying to talk to Lua on an ESP8266. Lua expects CRLF "\r\n" line endings, and apparently PuTTY defaults to just LF
"\n"!
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 53 of 55
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-huzzah-esp8266 Page 54 of 55
© Adafruit Industries Last Updated: 2019-06-20 08:39:54 PM UTC Page 55 of 55

Products related to this Datasheet

ESP8266 FEATHER HUZZAH FIXED HDR
Available Quantity: 268
Unit Price: 18.95
ESP8266 FEATHER HUZZAH STACK HDR
Available Quantity: 88
Unit Price: 19.95
MICROSOFT AZURE IOT STARTER KIT
Available Quantity: 0
Unit Price: 46.95
MICROSOFT HACKSTER.IO VIRTUAL IO
Available Quantity: 0
Unit Price: 0