SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
Master Degree in Engineering in Computer Science
Dipartimento di Ingegneria Informatica Automatica e Gestionale "Antonio Ruberti"
University of Rome - “La Sapienza”
Individual Project of Pervasive Systems
Biagio Botticelli 1212666
A.Y. 2015/16
Adafruit Huzzah ESP8266
Wi-Fi Board
Contents
1. Introduction to ESP8266 family
2. Adafruit Huzzah ESP8266 WiFi Board
3. Programming ESP8266
4. Example of Application
ESP-01
Adafruit Huzzah ESP8266
2
Introduction to ESP8266
The ESP8266 is a System-on-a-Chip (SoC) with a full 2,4 GHz WiFi front-end
and with integrated TCP/IP protocol stack with DNS support.
First version ESP-01 (begin 2014): it allows micro-controllers to connect to a
Wi-Fi network and make simple TCP/IP connections using Hayes-style
commands.
After few time…
• Multiple hardware versions;
• Official SDK (October 2014);
• Custom Firmwares;
3
Intro HuzzahESP8266 Programming Example
ESP8266 Family
Adafruit
Huzzah
ESP8266
4
Intro HuzzahESP8266 Programming Example
ESP8266: Hardware
• 32-bit CPU running at 80 MHz
• 64 KB of boot ROM
• 64 KB of instruction RAM
• 96 KB of data RAM
• External Flash Memory: 512 KB to up 4 MB
• 2,4 GHz Wi-Fi 802.11 b/g/n
• WEP, WPA/WPA2 Authentication or Open Networks
• 16 GPIO pins
• SPI, I2C
• I2S interfaces with DMA (sharing pins with GPIO)
• UART on dedicated pins + 1 transmit-only UART on GPIO2
• 1 10-bit ADC
• 3 PWM
5
Intro HuzzahESP8266 Programming Example
Why Adafruit Huzzah ESP8266?
WARNING! The ESP8266 operates at 3,3 V!
Most of the first versions do not have an
onboard voltage regulator…
Not breadboard friendly…
The Adafruit Huzzah ESP8266 is one of the
last versions of the module that make
easier to work with.
• Integrated high-current capable 500 mA /
3,3 V regulator;
• Breadboard friendly.
6
Intro HuzzahESP8266 Programming Example
Why Adafruit Huzzah ESP8266?
Small Dimension: 25x38x5 mm
Very low cost board!
7
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
Power Pins
• V+: input/output 5V voltage;
• VBat: input voltage from Battery;
• GND: ground;
• 3V: output 3,3V voltage;
Serial Pins
• TX: output from the module (3.3 V);
• RX: input into the module (5 V);
8
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
GPIO Pins
There are 9 GPIO pins:
#0, #2, #4, #5, #12, #13, #14, #15, #16.
GPIO pins are 3,3 V logic level in/out
and can be used for any sort of input
or output signal.
9
Many have special functionality:
• #0: used to determine when to boot into the bootloader.
If the pin is held LOW during power-up it will start boot-loading.
• #2: also used to detect boot-mode.
• #15: also used to detect boot-mode.
• #16: used to wake up from sleep mode. To awake, connect it to the RESET pin.
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
Analog Pin
• A: analog input.
Other Control Pins
• LDO: enable pin;
Easy way to cut power OFF:
when connected to GND, it will
turn off the 3,3 V regulator.
• RST: reset pin (5 V);
When connected to GND, it will
momentarily reset the ESP8266.
• EN (CH_PD): reset pin (3,3 V only).
When connected to GND it will
momentarily reset the ESP8266.
10
Intro HuzzahESP8266 Programming Example
Programming ESP8266
In order to make them work properly, remember to install the correct driver!
USB-to-Serial
To establish a communication with Adafruit ESP8266, we need an USB to
Serial converter which will provide the connectivity between USB port of our
PC/Laptop and Serial UART interface of the board.
USB-to-TTL Cable FTDI Cable FTDI Breakout
SparkFun
FTDI Basic 5V
11
Intro HuzzahESP8266 Programming Example
Programming ESP8266
Firmwares
Different options for firmware are available: each one allows to program the
chip in a different way.
1. AT+ Command Processor (default for ESP8266)
2. Custom Firmware (using Arduino IDE to upload);
3. Node MCU Lua (default for Adafruit Huzzah ESP8266);
4. esp-open-SDK (direct programming on ESP8266);
5. Firmware by Espruino community (Javascript);
6. Firmware by MicroPython community (Python);
Only one firmware at a time could be loaded in ESP8266!
12
Intro HuzzahESP8266 Programming Example
Firmware: Installation
To load the firmware in the chip, it’s needed to use:
• Flashing Tool: esptool, a Python-based cross-platform ESP8266 flashing tool;
• Image of Firmware: any image of firmware to install.
Requirement: the programmer must be able to use esptool.
In order to make esptool working, pySerial must be present in the system.
Supposing that esptool and pySerial are correctly installed and the firmware image is
available, it’s possible to begin the installation of the firmware on the module.
The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work!
The command for the installation of the firmware using esptool is:
sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image
• /dev/tty.device_name: name assigned by the OS to the ESP8266 device;
• /path_to_firmware_image: location of the image of the firmware.
13
Intro HuzzahESP8266 Programming Example
AT+ Commands
Maybe the quickest way to get started with the ESP8266!
It allows ESP8266 to process AT+ Commands received over Serial UART interface.
Pros:
• useful for beginners: the user does not need not be familiar with any programming language
or framework to use it; he can simply send a series of commands to achieve his goal.
Cons:
• USB-to-Serial Connection: the module must be always connected to the computer.
• Low-Level Programming: AT+ Commands operate at very low level.
There are different ways of sending serial
messages over the computer's USB.
The most used are:
• Serial Terminal Softwares:
• PuTty for Windows;
• CoolTerm for Windows/MacOS/Unix;
• Arduino IDE's Serial Monitor.
14
Intro HuzzahESP8266 Programming Example
AT+ Commands Set
15
Intro HuzzahESP8266 Programming Example
AT+ Commands Set
16
Intro HuzzahESP8266 Programming Example
NodeMCU Lua
NodeMCU Lua is the most popular alternative firmware to AT+ Commands!
NodeMCU runs an interpreter able to execute commands in the Lua scripting language.
• Memory Storage: store the
code in flash memory and
instruct the module to run
the application every time it
restarts!
ESPlorer: NodeMCU tool
17
Pro:
• Good for developers: environment that allows to run commands for controlling
both board's WiFi interface and GPIO functionalities.
Cons:
• Lua Language: not very
spread with lack of
official documentation;
Intro HuzzahESP8266 Programming Example
Arduino IDE
Whereas the Adafruit Huzzah Board is pre-programmed with the  NodeMCU
firmware, it’s possible to replace it with a custom firmware using the Arduino IDE.
WARNING! This method erases the previous firmware from the ESP8266's flash!
(To come back to initial configuration of the board, there would be executed the steps described before)
Maybe it’s the easiest way to design a custom firmware for the ESP8266 module!
It would be the best choice for those
users which want to use the latest
versions of ESP8266 that allows to use it
as a regular micro-controller.
18
Intro HuzzahESP8266 Programming Example
Arduino IDE
The Arduino IDE will not initially recognize the ESP8266!
ESP8266 in the Arduino IDE
• Open Preferences window of the Arduino IDE;
• Enter in the Additional Boards Manager URLs field the URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
• Go in the Boards Manager and install the last release for esp8266 module by the
ESP8266 Web Community;
• Restart the Arduino IDE;
• After restarting the Arduino IDE, we can find a specific menu of the different
models of ESP8266 boards.
• Selecting the model of the board, the IDE will automatically set the correct
parameters in order to make feasible the USB-to-Serial communication.
If all the previous configuration steps are been made correctly, we
are now ready to write our custom firmware with the Arduino IDE.
19
Intro HuzzahESP8266 Programming Example
Example
Steps:
1. Build the hardware circuit on which the application is based;
2. Develop the custom firmware with the Arduino IDE, that makes the ESP8266
board the core of the project;
3. Use Blynk app for iOS/Android to implement the remote control;
Idea: Create an application for the remote
control of the temperature/humidity in the
room with the possibility to turn on/off the
light by using the smartphone.
20
Intro HuzzahESP8266 Programming Example
Example: Hardware
21
Intro HuzzahESP8266 Programming Example
Example: Blynk Front-End
22
Blynk: IoT Control User Interface for ESP8266 module
Intro HuzzahESP8266 Programming Example
User Interface:
• Switch for the Remote Control of
the light;
• Gauge for the representation of the
Temperature of the room;
• Gauge for the representation of the
Humidity of the room;
Example: Arduino IDE
23
Intro HuzzahESP8266 Programming Example
Example: Arduino IDE
24
Intro HuzzahESP8266 Programming Example
ESP8266
25
Questions
&
Discussion
Useful Links
Useful Links:
• ESP8266 Datasheet
• ESP8266 Community Forum
• AT+ Instruction Set
• NodeMCU Web Site
• NodeMCU Flasher
• SparkFun
26
Homepage of the course: Pervasive Systems 2016
These slides are available on Slideshare
Email Address: botticelli.1212666@studenti.uniroma1.it
GitHub: biagiobotticelli/ESP8266
LinkedIn: Biagio Botticelli
• Arduino/Genuino IDE
• Arduino Core for ESP8266
• esp-open-SDK
• esptool Flashing Tool
• Blynk
ESP8266
27
Thank You !

Más contenido relacionado

La actualidad más candente

Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Alwin Arrasyid
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123Victor Sue
 
Gesture Control Robot
Gesture Control RobotGesture Control Robot
Gesture Control Robotnikhilsaini25
 
Automated Plant Watering System
Automated Plant Watering SystemAutomated Plant Watering System
Automated Plant Watering SystemSoumyadeep Kal
 
IOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoIOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoGopikrishnateja Goli
 
Motor driver IC L293D
Motor driver IC L293DMotor driver IC L293D
Motor driver IC L293DAmit kumar
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
ESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started GuideESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started Guidehandson28
 
iot industry automation
iot industry automationiot industry automation
iot industry automationmansi sharma
 
Drink and Drive Alcohol Detection
Drink and Drive Alcohol DetectionDrink and Drive Alcohol Detection
Drink and Drive Alcohol DetectionNandha_Gopal
 

La actualidad más candente (20)

IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]
 
L298 Motor Driver
L298 Motor DriverL298 Motor Driver
L298 Motor Driver
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123
 
Gesture Control Robot
Gesture Control RobotGesture Control Robot
Gesture Control Robot
 
Arduino
ArduinoArduino
Arduino
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 
Automated Plant Watering System
Automated Plant Watering SystemAutomated Plant Watering System
Automated Plant Watering System
 
Ardui no
Ardui no Ardui no
Ardui no
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
IOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoIOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduino
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Internet of Things Using Arduino
Internet of Things Using ArduinoInternet of Things Using Arduino
Internet of Things Using Arduino
 
Project report on arduino based parking lot system
Project report on arduino based parking lot systemProject report on arduino based parking lot system
Project report on arduino based parking lot system
 
Motor driver IC L293D
Motor driver IC L293DMotor driver IC L293D
Motor driver IC L293D
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
ESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started GuideESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started Guide
 
iot industry automation
iot industry automationiot industry automation
iot industry automation
 
Drink and Drive Alcohol Detection
Drink and Drive Alcohol DetectionDrink and Drive Alcohol Detection
Drink and Drive Alcohol Detection
 

Similar a Adafruit Huzzah Esp8266 WiFi Board

Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Suraj Kumar Jana
 
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioHome automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioTran Minh Nhut
 
Electronics ESP processors
Electronics ESP processorsElectronics ESP processors
Electronics ESP processorsLeopoldo Armesto
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummiesPavlos Isaris
 
Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Parshwadeep Lahane
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerArun Kumar
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266Elaf A.Saeed
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3hari prasad
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitSulamita Garcia
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019Jong-Hyun Kim
 
[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2Công Hoàng Văn
 

Similar a Adafruit Huzzah Esp8266 WiFi Board (20)

Remote tanklevelmonitor
Remote tanklevelmonitorRemote tanklevelmonitor
Remote tanklevelmonitor
 
Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)
 
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioHome automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
 
Electronics ESP processors
Electronics ESP processorsElectronics ESP processors
Electronics ESP processors
 
Esp8266 Workshop
Esp8266 WorkshopEsp8266 Workshop
Esp8266 Workshop
 
ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummies
 
Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontroller
 
Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
 
[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 

Más de Biagio Botticelli

IoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksIoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksBiagio Botticelli
 
Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Biagio Botticelli
 
System and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingSystem and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingBiagio Botticelli
 
Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Biagio Botticelli
 
IoT Honeypots: State of the Art
IoT Honeypots: State of the ArtIoT Honeypots: State of the Art
IoT Honeypots: State of the ArtBiagio Botticelli
 
State of the Art: IoT Honeypots
State of the Art: IoT HoneypotsState of the Art: IoT Honeypots
State of the Art: IoT HoneypotsBiagio Botticelli
 
Anonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsAnonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsBiagio Botticelli
 
Anonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsAnonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsBiagio Botticelli
 
Blockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBlockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBiagio Botticelli
 
Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Biagio Botticelli
 

Más de Biagio Botticelli (10)

IoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksIoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random Walks
 
Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...
 
System and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingSystem and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration Testing
 
Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1
 
IoT Honeypots: State of the Art
IoT Honeypots: State of the ArtIoT Honeypots: State of the Art
IoT Honeypots: State of the Art
 
State of the Art: IoT Honeypots
State of the Art: IoT HoneypotsState of the Art: IoT Honeypots
State of the Art: IoT Honeypots
 
Anonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsAnonymity in the web based on routing protocols
Anonymity in the web based on routing protocols
 
Anonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsAnonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing Protocols
 
Blockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBlockchain for IoT - Smart Home
Blockchain for IoT - Smart Home
 
Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking
 

Último

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxBipin Adhikari
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 

Último (20)

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptx
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 

Adafruit Huzzah Esp8266 WiFi Board

  • 1. Master Degree in Engineering in Computer Science Dipartimento di Ingegneria Informatica Automatica e Gestionale "Antonio Ruberti" University of Rome - “La Sapienza” Individual Project of Pervasive Systems Biagio Botticelli 1212666 A.Y. 2015/16 Adafruit Huzzah ESP8266 Wi-Fi Board
  • 2. Contents 1. Introduction to ESP8266 family 2. Adafruit Huzzah ESP8266 WiFi Board 3. Programming ESP8266 4. Example of Application ESP-01 Adafruit Huzzah ESP8266 2
  • 3. Introduction to ESP8266 The ESP8266 is a System-on-a-Chip (SoC) with a full 2,4 GHz WiFi front-end and with integrated TCP/IP protocol stack with DNS support. First version ESP-01 (begin 2014): it allows micro-controllers to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes-style commands. After few time… • Multiple hardware versions; • Official SDK (October 2014); • Custom Firmwares; 3 Intro HuzzahESP8266 Programming Example
  • 5. ESP8266: Hardware • 32-bit CPU running at 80 MHz • 64 KB of boot ROM • 64 KB of instruction RAM • 96 KB of data RAM • External Flash Memory: 512 KB to up 4 MB • 2,4 GHz Wi-Fi 802.11 b/g/n • WEP, WPA/WPA2 Authentication or Open Networks • 16 GPIO pins • SPI, I2C • I2S interfaces with DMA (sharing pins with GPIO) • UART on dedicated pins + 1 transmit-only UART on GPIO2 • 1 10-bit ADC • 3 PWM 5 Intro HuzzahESP8266 Programming Example
  • 6. Why Adafruit Huzzah ESP8266? WARNING! The ESP8266 operates at 3,3 V! Most of the first versions do not have an onboard voltage regulator… Not breadboard friendly… The Adafruit Huzzah ESP8266 is one of the last versions of the module that make easier to work with. • Integrated high-current capable 500 mA / 3,3 V regulator; • Breadboard friendly. 6 Intro HuzzahESP8266 Programming Example
  • 7. Why Adafruit Huzzah ESP8266? Small Dimension: 25x38x5 mm Very low cost board! 7 Intro HuzzahESP8266 Programming Example
  • 8. Adafruit Huzzah ESP8266 Power Pins • V+: input/output 5V voltage; • VBat: input voltage from Battery; • GND: ground; • 3V: output 3,3V voltage; Serial Pins • TX: output from the module (3.3 V); • RX: input into the module (5 V); 8 Intro HuzzahESP8266 Programming Example
  • 9. Adafruit Huzzah ESP8266 GPIO Pins There are 9 GPIO pins: #0, #2, #4, #5, #12, #13, #14, #15, #16. GPIO pins are 3,3 V logic level in/out and can be used for any sort of input or output signal. 9 Many have special functionality: • #0: used to determine when to boot into the bootloader. If the pin is held LOW during power-up it will start boot-loading. • #2: also used to detect boot-mode. • #15: also used to detect boot-mode. • #16: used to wake up from sleep mode. To awake, connect it to the RESET pin. Intro HuzzahESP8266 Programming Example
  • 10. Adafruit Huzzah ESP8266 Analog Pin • A: analog input. Other Control Pins • LDO: enable pin; Easy way to cut power OFF: when connected to GND, it will turn off the 3,3 V regulator. • RST: reset pin (5 V); When connected to GND, it will momentarily reset the ESP8266. • EN (CH_PD): reset pin (3,3 V only). When connected to GND it will momentarily reset the ESP8266. 10 Intro HuzzahESP8266 Programming Example
  • 11. Programming ESP8266 In order to make them work properly, remember to install the correct driver! USB-to-Serial To establish a communication with Adafruit ESP8266, we need an USB to Serial converter which will provide the connectivity between USB port of our PC/Laptop and Serial UART interface of the board. USB-to-TTL Cable FTDI Cable FTDI Breakout SparkFun FTDI Basic 5V 11 Intro HuzzahESP8266 Programming Example
  • 12. Programming ESP8266 Firmwares Different options for firmware are available: each one allows to program the chip in a different way. 1. AT+ Command Processor (default for ESP8266) 2. Custom Firmware (using Arduino IDE to upload); 3. Node MCU Lua (default for Adafruit Huzzah ESP8266); 4. esp-open-SDK (direct programming on ESP8266); 5. Firmware by Espruino community (Javascript); 6. Firmware by MicroPython community (Python); Only one firmware at a time could be loaded in ESP8266! 12 Intro HuzzahESP8266 Programming Example
  • 13. Firmware: Installation To load the firmware in the chip, it’s needed to use: • Flashing Tool: esptool, a Python-based cross-platform ESP8266 flashing tool; • Image of Firmware: any image of firmware to install. Requirement: the programmer must be able to use esptool. In order to make esptool working, pySerial must be present in the system. Supposing that esptool and pySerial are correctly installed and the firmware image is available, it’s possible to begin the installation of the firmware on the module. The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work! The command for the installation of the firmware using esptool is: sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image • /dev/tty.device_name: name assigned by the OS to the ESP8266 device; • /path_to_firmware_image: location of the image of the firmware. 13 Intro HuzzahESP8266 Programming Example
  • 14. AT+ Commands Maybe the quickest way to get started with the ESP8266! It allows ESP8266 to process AT+ Commands received over Serial UART interface. Pros: • useful for beginners: the user does not need not be familiar with any programming language or framework to use it; he can simply send a series of commands to achieve his goal. Cons: • USB-to-Serial Connection: the module must be always connected to the computer. • Low-Level Programming: AT+ Commands operate at very low level. There are different ways of sending serial messages over the computer's USB. The most used are: • Serial Terminal Softwares: • PuTty for Windows; • CoolTerm for Windows/MacOS/Unix; • Arduino IDE's Serial Monitor. 14 Intro HuzzahESP8266 Programming Example
  • 15. AT+ Commands Set 15 Intro HuzzahESP8266 Programming Example
  • 16. AT+ Commands Set 16 Intro HuzzahESP8266 Programming Example
  • 17. NodeMCU Lua NodeMCU Lua is the most popular alternative firmware to AT+ Commands! NodeMCU runs an interpreter able to execute commands in the Lua scripting language. • Memory Storage: store the code in flash memory and instruct the module to run the application every time it restarts! ESPlorer: NodeMCU tool 17 Pro: • Good for developers: environment that allows to run commands for controlling both board's WiFi interface and GPIO functionalities. Cons: • Lua Language: not very spread with lack of official documentation; Intro HuzzahESP8266 Programming Example
  • 18. Arduino IDE Whereas the Adafruit Huzzah Board is pre-programmed with the  NodeMCU firmware, it’s possible to replace it with a custom firmware using the Arduino IDE. WARNING! This method erases the previous firmware from the ESP8266's flash! (To come back to initial configuration of the board, there would be executed the steps described before) Maybe it’s the easiest way to design a custom firmware for the ESP8266 module! It would be the best choice for those users which want to use the latest versions of ESP8266 that allows to use it as a regular micro-controller. 18 Intro HuzzahESP8266 Programming Example
  • 19. Arduino IDE The Arduino IDE will not initially recognize the ESP8266! ESP8266 in the Arduino IDE • Open Preferences window of the Arduino IDE; • Enter in the Additional Boards Manager URLs field the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json • Go in the Boards Manager and install the last release for esp8266 module by the ESP8266 Web Community; • Restart the Arduino IDE; • After restarting the Arduino IDE, we can find a specific menu of the different models of ESP8266 boards. • Selecting the model of the board, the IDE will automatically set the correct parameters in order to make feasible the USB-to-Serial communication. If all the previous configuration steps are been made correctly, we are now ready to write our custom firmware with the Arduino IDE. 19 Intro HuzzahESP8266 Programming Example
  • 20. Example Steps: 1. Build the hardware circuit on which the application is based; 2. Develop the custom firmware with the Arduino IDE, that makes the ESP8266 board the core of the project; 3. Use Blynk app for iOS/Android to implement the remote control; Idea: Create an application for the remote control of the temperature/humidity in the room with the possibility to turn on/off the light by using the smartphone. 20 Intro HuzzahESP8266 Programming Example
  • 22. Example: Blynk Front-End 22 Blynk: IoT Control User Interface for ESP8266 module Intro HuzzahESP8266 Programming Example User Interface: • Switch for the Remote Control of the light; • Gauge for the representation of the Temperature of the room; • Gauge for the representation of the Humidity of the room;
  • 23. Example: Arduino IDE 23 Intro HuzzahESP8266 Programming Example
  • 24. Example: Arduino IDE 24 Intro HuzzahESP8266 Programming Example
  • 26. Useful Links Useful Links: • ESP8266 Datasheet • ESP8266 Community Forum • AT+ Instruction Set • NodeMCU Web Site • NodeMCU Flasher • SparkFun 26 Homepage of the course: Pervasive Systems 2016 These slides are available on Slideshare Email Address: botticelli.1212666@studenti.uniroma1.it GitHub: biagiobotticelli/ESP8266 LinkedIn: Biagio Botticelli • Arduino/Genuino IDE • Arduino Core for ESP8266 • esp-open-SDK • esptool Flashing Tool • Blynk

Notas del editor

  1. My presentation will follow four basic steps: The first step is an introduction to the ESP module family; The second one is a description of the features of the Adafruit Huzzah, that is a particular version of the module that Ioannis give it to me to work with; The third is an introduction on how it’s possible to program the chip ESP12 of the board with the different firmwares that are been introduced; The last step is the description of one of the possible application that could be developed by using this module. As example, I decided to develop an application using the software Blynk (that will be presented in one of the next lectures by my colleague Davide Meacci) that allows the remote control of a room by my iPhone checking the temperature and humidity, and giving me the possibility to turn on off the light.
  2. The ESP8266 System-on-a-Chip produced by Espressif is an 80 MHz chip with a full WiFi front-end (both as client and access point) and with an integrated TCP/IP protocol stack with DNS support. The first version of the module, the ESP-01 was introduced in early 2014: this small chip allows micro-controllers (such as Arduino) to connect to Wi-Fi and make simple TCP/IP connections using Hayes-style commands. We will see in the next slides some examples of AT+ Commands… Now, multiple versions of the module are being made available because after few time, the extremely low price and the potentialities of the chip had attracted many developers to built more usable hardware versions together with a more advanced software environment. In late October 2014, Espressif has released a Software Development Kit (SDK). This innovation allows the module to be programmed without the use of an additional micro-controller.
  3. In this slide we can see a summary table of the ESP family. As we can see, many versions are being introduced (from the initial ESP01 to the last ESP-14)… For this project, I worked with an Adafruit Huzzah ESP8266 Development Board that has an ESP-12 version of the chip. Let’s see some hardware features of the module…
  4. ESP8266 employs a 32-bit CPU running at 80 MHz. It has 64 KB boot ROM, 64 KB instruction RAM and 96 KB data RAM. External flash memory can be accessed through SPI. It’s a system-on-a-chip with 2.4 GHz Wi-Fi (supporting WPA/WPA2). It has 16 General-Purpose Input/Output (GPIO): Serial Peripheral Interface(SPI), Inter-Integrated Circuit (I²C), Integrated Interchip Sound (I²S) Analog-to-Digital Conversion (10-bit ADC), UART (on dedicated pins, plus a transmit-only UART can be enabled on GPIO2), Pulse-Width Modulation (PWM).
  5. The ESP8266 operates at 3,3 V and may require up to 170 mA of current. Thus, we would need a 3,3 V regulator, since the micro-controller pins typically have 5 volt logic and most of the first versions of the ESPs don’t have an onboard regulator. If we would use ESP with 5V… We could seriously damage it! Thus, in order to make them work, we would need to create an additional Voltage Regulator or to buy an additional adapter. The Adafruit Huzzah ESP8266 is one of the newer versions of the module. For the power supply it has an integrated high-current capable 500 mA / 3,3 V regulator on the board; so we have not to buy a regulator and it’s is also breadboard friendly. This is very useful if we want to use it in a dedicated circuit… Then…
  6. As you can see… It’s very small, so it does need much space to place it in a circuit! And it’s very cheap with respect to other WiFi micro controllers such as the Arduino Wifi Shield. Now, let me introduce how the board really works…
  7. The board has 24 Pins in total: 7 Power Pins, 4 Serial, 9 GPIO, 1 Analog and 3 Control Pins. For Power Pins, there are 3 inputs for the regulator: 2 V+ and 1 VBat. The V+ pin is on the FTDI/Serial header and in the left side of the board. The Ground pins are 3: 2 are on left and right side of the board (1 per side) and 1 is on the FTDI/Serial header. There's also a 3.3 V output from the regulator available on the 3V pin. There are 4 Serial Pins: 2 RX and 2 TX that are the serial control and bootloading pins. They are the means for communicating with the ESP module. The TX pin is the output from the module and is 3.3 V logic. The RX pin is the input into the module and is 5V compliant. The pins are available in 2 places: one set is on the right side of the board and the other one is on the FTDI/Serial header.
  8. GPIO Pins There are 9 GPIO pins: #0, #2, #4, #5, #12, #13, #14, #15, #16. All GPIO are 3,3 V logic level in and out, and are not 5 V compatible. These pins can be used for any sort of input or output. Many have special functionality: GPIO #0: 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. It is also connected to the red LED so it could be used to blink it. GPIO #2: it is another way to detect boot-mode. It is also connected to the blue LED. GPIO #15: it is another way to detect boot-mode. It’s always possible to use it as an output. GPIO #16: it can be used to wake up from sleep mode of the board. To awake, connect it to the RESET pin.
  9. Analog Pin There is a single analog input pin called A. This pin has a 1,0 V maximum voltage, so if you have an analog voltage to read that is higher, it will have to be divided down to 0 - 1.0V range. Other Control Pins We have a few other pins for controlling the board. LDO: This is the enable pin for the regulator. By default its pulled high. When connected to GND it will turn off the 3,3 V regulator and is an easy way to cut power off to the whole setup. RST: This is a 5 V compliant reset pin. By default it’s pulled high. When connected to GND it will reset the ESP8266 system. EN (CH_PD): This is a 3,3 V logic only reset pin. By default it’s pulled high. When connected to GND it will reset the ESP8266 system.
  10. To establish a communication with Adafruit ESP8266 board, we need an USB to Serial converter which will provide the connectivity between USB port of our PC and the Serial UART interface of the ESP8266 module. There are different options of cables and adaptors that could be choose offering connectivity at 5 or 3,3 V with various connector interfaces. There are many option between USB-to-TTL Cables, FTDI Cables, FTDI modules and so on… In my case, I used a SparkFun FTDI Basic 5V module. In order to make them work, remember to install the correct driver!
  11. Firmwares Different options for firmware are available: each one allows to program the chip in a different way. 1. AT+ Command Processor, the default for first versions like ESP01; 2. Node MCU Lua, the default for Adafruit Huzzah ESP8266; 3. Custom Firmware, created using the Arduino IDE; 4. esp-open-SDK, that allows the direct programming on ESP8266; 5. Firmware by Espruino community (Javascript Interpret); 6. Firmware by MicroPython community (Python Interpret); These last two, are very good interpreters but in early stage of development (published in December 2015) with not all functionalities made been available yet. Remember that in the ESP8266 module, it’s possible to load one firmware at a time. So before starting to programming the ESP, the developer has to make the choice of the firmware to use. It’s not possible to change it during development or share properties of different firmwares.
  12. The Huzzah ESP8266 board is pre-programmed with a NodeMCU Lua interpreter. But, if the we want to use a different firmware, it’s possible to use the tools developed by ESP8266 Community for loading a firmware image on the chip. To load the firmware in the chip, we will need: a Flashing Tool: I choose esptool, a Python-based cross-platform flashing tool. an Image of Firmware: any image of firmware to install. For the installation of the image on the module, we must be able to use esptool. In order to make esptool working, we must install pySerial on our system. Now, supposing that esptool and pySerial are correctly installed and the firmware image is available, it’s possible to begin the installation of the firmware on the module. The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work! The command for the installation of the firmware using esptool is: sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image where: /dev/tty.device_name is the name assigned by the OS to the ESP8266 device; /path_to_firmware_image is the location of the image of the firmware. We can now focus on some of the most common firmwares for ESP…
  13. Maybe the quickest way to get started with the ESP8266! It allows ESP8266 to process AT+ Commands received over Serial UART interface. The Advantages that it’s useful for a beginner user since he will not need not be familiar with any specific programming language or framework to use the ESP8266; he can simply send a series of commands to achieve his goal. Disadvantages are that the module must be always connected to the computer. and that it operates at very low level. So it’s not so intuitive in a regular use. How can we send AT commands to the module? There are different ways of sending serial messages over the computer's USB. The most used are: Serial Terminal Softwares as PuTty or CoolTerm for Windows/MacOS/Unix; Arduino IDE's Serial Monitor. Let we see a list of the AT Commands
  14. AT to see if the board is connected; AT+CWLAP to have a list of the available access points; AT+CWJAP to connect with an access point (with relative ssid and password) AT+CWJAP to disconnect from an access point; AT+CIFSR to get the IP Address; AT+CWMODE to set the mode in which the module will operate (Station, Access Point or both)
  15. AT+CWLIF to check IPs of connected devices in access point mode; AT+CIPSERVER to set up in server mode with a specific port; and so on… Then we have another option for firmware that is quite more advanced…
  16. At the moment NodeMCU is the most popular alternative firmware to AT+ Commands! NodeMCU runs a Lua interpreter onboard the ESP8266, which is able to execute commands written in the Lua scripting language. The commands are sent to the via the Serial UART interface. NodeMCU is a good starting point for developers as it provides an environment that allows running commands not only for controlling the ESP8266's wireless interface, but also its GPIO and hardware functionality. In addition, we have access to Lua programming language for writing our applications. Finally, we can save our applications in the ESP8266's flash memory and instruct it to run the application code every time it restarts! To write our application we could use ESPplorer IDE tool. Lua Language Pros: • Portable: builds on any platform with an ANSI C compiler. • Lua is comparably as easy as Python in terms of learning how to write code. • Embedded and extensible language that provides a straightforward interface to/from C/C++/Objective-C. It has a very clean C API. • Sufficiently fast: performs well comparing to other languages and has a JIT compiler that noticeably improves performance on many tasks. • Well documented: reference manual, book, wiki, 6-page short reference and more. • Friendly and enthusiastic community. • Clean and simple syntax suitable for beginners and accessible to non-programmers. • Integrated interpreter: just run lua from the command line. • Native support for coroutines to implement iterators and non-preemptive multi-threading. • Incremental garbage collector that has low latency, no additional memory cost, little - implementation complexity, and support for weak tables. • Simple yet powerful debug library. • Free Cons: • Lua does not focus on 100% backward compatibility. Many newer releases of Lua break programs written in previous versions. • Limited error handling support. • Global scoping by default. • No Unicode support. • Lua supports only a few data structures, including arrays, lists and hash tables. • Limited pattern-matching support. • No POSIX functions built-in.. • No class/object finalizers. • Packaging on Windows. It requires a fair amount of experience with Windows application packaging to produce an installer that provides everything your end user needs in a way that makes your use of Lua as the core language irrelevant to them.
  17. Maybe it’s the easiest way to design a custom firmware for the ESP8266 module! Whereas the Adafruit Huzzah Board is pre-programmed with the latest version of the NodeMCU firmware, we can easily replace it using the Arduino IDE. This allows us to run our own firmware on the ESP8266, which executes every time the module is powered. WARNING! This method erases the previous firmware from the ESP8266's flash! (To come back to initial configuration of the board, there would be executed the steps described before in the slide 13) It would be the best choice for those users which want to use the latest versions of ESP8266 that allows to use it as a regular micro-controller (as the ATmega328 in Arduino/Genuino UNO).
  18. The Arduino IDE will not initially recognize the ESP8266 since it does not have it installed by default in the devices menu! So we need to install it in the IDE if we want to program the module with it! The installation is quite simple: Open Preferences window of the Arduino IDE; Enter in the Additional Boards Manager URLs field the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json Go in the Boards Manager and install the last release for esp8266 module by the ESP8266 Web Community; Restart the Arduino IDE; After restarting the Arduino IDE, we can find a specific menu of the different models of ESP8266 boards. Selecting the model of the board, the IDE will automatically set the correct parameters in order to make feasible the USB-to-Serial communication. If all the previous configuration steps are been made correctly, we are now ready to write our custom firmware with the Arduino IDE.
  19. My Idea was to create an application for the remote control of the temperature/humidity in the room with the possibility to turn on/off the light by using the smartphone. The first step was to create a dedicated hardware circuit with the DHT sensor and the Relay module that will be connected to the ESP; Then I created the application code using the Arduino IDE that implement the function that I need; To create the communication between my iPhone and the ESP, I used “Blynk”, an app that was presented by Ioannis during the Projects Presentation and that will be presented in one of the next lectures by my colleague Davide Meacci. I choose it because it has very useful features and because it gives it to me an easy way to communicate with my Wifi module.
  20. This is the scheme of the circuit that I built. There are the ESP and 2 extra components: a light bulb controlled by a relay module and a DHT Temperature Humidity Sensor. A Relay is a switch operated by a relatively small electric current that can turn on or off a larger electric current. It uses an electromagnet to mechanically operate the switch. Relays are used because many electronic sensors are incredibly sensitive to current and they produce only small electric currents. In my case, I need a relay to drive the light that use bigger current (220 against 5V). The relay acts as a bridge making it possible for small current to activate larger one. It could be seen as one circuit to switch on a second circuit. When power flows through the first circuit, it activates the electromagnet that attracts a contact and activates the second circuit. When the power is switched off, a spring pulls the contact back up to its original position, switching the second circuit off again. It has two different behaviours: Normally open and Normally closed. NO: the contacts in the second circuit are not connected by default and switch on only when a current flows through the magnet. NC: the contacts are connected so a current flows through them by default and switch off only when the magnet is activated, pulling or pushing the contacts apart. The relay module in normally open configuration is powered by the GND-V+ pins and controlled by GPIO 12 pins of ESP. The DHT11 is a 4-pin sensor that operates from 3.5 to 5.5V. It takes Temperature/Humidity of the room and send it to the ESP by the GPIO 14 pin. It can measure temperature from 0-50 °C with an accuracy of ±2°C and relative humidity ranging from 20-95% with an accuracy of  ±5%. Let now see the code of my application.
  21. Presentation of the main features of the ESP8266 WiFi module created for the course "Pervasive Systems"University of Rome "La Sapienza"