SlideShare a Scribd company logo
1 of 31
Download to read offline
standard Arduino workshop 2014-2015
ESP8266+Arduino
Tom Tobback
www.cassiopeia.hk
2015
ESP8266+Arduino workshop 2015
Materials
ESP8266+Arduino workshop 2015
Arduino and wifi
Official Arduino wifi shield
EUR 69 + VAT
Sparkfun CC3000 shield
USD 40
Adafruit CC3000 module
USD 35
ESP8266+Arduino workshop 2015
ESP8266 wifi module
small
powerfull
cheap
=> IoT
ESP8266+Arduino workshop 2015
Today’s setup
ESP8266+Arduino workshop 2015
ESP8266 wifi module
don’t need
microcontroller
2 GPIO pins available
on ESP-01
more on
ESP-12
ESP8266+Arduino workshop 2015
ESP8266 wifi module
direct programming over USB/UART
without using Arduino board as micro-controller
1. esptool.py
2. NodeMCU - Lua
3. Arduino IDE!
https://github.com/esp8266/Arduino
ESP8266+Arduino workshop 2015
Today’s setup
ESP8266+Arduino workshop 2015
Downloads
http://www.dimsumlabs.com/
click on ESP8266 event
● DHT library zipped
● zip file with:
esp8266-thingspeak-dht11-test
esp8266-thingspeak-dht11-v3
esp8266-dht11-webserver
WiFiWebServer-dht11-led
ESP8266+Arduino workshop 2015
ESP8266 pinout
Vcc = 3V3
GND
UTXD = serial TX
URXD = serial RX
RST = reset
CH_PD = pull up 4.6kOhm
GPIO0 = input/output
GPIO2 = input/output
ESP8266+Arduino workshop 2015
ESP8266 test
Communicate with ESP8266 using Serial converter on our
Arduino board
● Vcc = 3V3
● GND
● URXD = serial RX = pin0
● UTXD = serial TX = pin1
note: pins seem 5V tolerant
ESP8266+Arduino workshop 2015
ESP8266 test
Communicate with ESP8266 using Serial converter on our
Arduino board (RX, TX)
Upload any sketch not using Serial e.g. blink
Connect ESP module
Open IDE Serial Monitor
Baud rate = 9600
Setting = “Both NL & CR”
ESP8266+Arduino workshop 2015
ESP8266 test
AT commands of standard firmware
AT+RST reset
AT+GMR check firmware version
AT+CWMODE=3 set mode to AP+STA
AT+CWLAP list wifi networks
AT+CWJAP=”ssid”,”password” connect to your wifi
AT+CIOBAUD? check baud rate
AT+CIOBAUD=9600 set new baud rate
https://nurdspace.nl/ESP8266
ESP8266+Arduino workshop 2015
ESP8266 and software serial
Arduino board has 1 hardware Serial on pin0 and pin1
but this is also used for uploading and for Serial Monitor
Some earlier modules had baud rate 115200 and their
firmware did not allow to change it. would only work with
hardware Serial, so Serial Monitor over software Serial +
USB converter
ESP8266+Arduino workshop 2015
ESP8266 and software serial
Better solution:
use updated firmware to allow 9600 baud
then can use software Serial for ESP8266
and hardware Serial for uploading/monitor as always
new modules come set with default 9600 baud
no update of firmware necessary
software serial on e.g. pin10 and pin11
standard Arduino library
ESP8266+Arduino workshop 2015
ESP8266 setup
ESP8266 can act as:
WEB SERVER
serve web pages over existing wifi network
ACCESS POINT
create its own wifi network + web server
WEB CLIENT
communicate with web servers (e.g. thingspeak.com)
over existing wifi network
ESP8266+Arduino workshop 2015
ESP8266 web server
AT+RST reset
AT+CWMODE=1 configure as node
AT+CWLAP list access points
AT+CWJAP=”ssid”,”pwd” connect to your wifi
AT+CIFSR show ip address
AT+CIPMUX=1 allow multiple connects
AT+CIPSERVER=1,80 start server on port 80
go to browser and type IP address
check reply in serial monitor
ESP8266+Arduino workshop 2015
ESP8266 web server
go to browser and type IP address
check reply in serial monitor
+IPD, 0 [means connection id = 0]
AT+CIPSEND=0,12
hello world [enter]
AT+CIPCLOSE=0
see browser
ESP8266+Arduino workshop 2015
ESP8266 access point
AT+RST reset
AT+CWMODE=2 configure as access point
AT+CWSAP? get your AP details
AT+CWSAP=”ssid”,”pwd”,1,3
define your wifi AP
change to unique ssid
connect to the AP with your phone
AT+CIFSR show ip address
AT+CIPMUX=1 allow multiple connects
AT+CIPSERVER=1,80 start server on port 80
go to browser and type IP address
check reply in serial monitor
ESP8266+Arduino workshop 2015
ESP8266 web client
AT+RST reset
AT+CWMODE=1 configure as node
AT+CWJAP=”ssid”,”pwd” connect to your wifi
AT+CIPSTART=”TCP”,”184.106.153.149”,80
connect to TCP socket
AT+CIPSEND= 4
wait for “>”
GET [enter]
check reply
ESP8266+Arduino workshop 2015
ESP8266 web client
ARDUINO SKETCH
send commands over software serial
espSerial.println("AT+RST");
construct String to send commands
AT+CIPSTART=”TCP”,”184.106.153.149”,80
String cmd;
cmd = "AT+CIPSTART="TCP","";
cmd += THINGSPEAK_IP;
cmd += "",80";
espSerial.println(cmd);
ESP8266+Arduino workshop 2015
ESP8266 web client
ARDUINO SKETCH
construct HTTP request to be sent
String cmd;
cmd = "GET /update?key=xxxxxxxxxxxxxxxxxx&field1=";
cmd += temp;
cmd += "rn";
send the length of the command
espSerial.print("AT+CIPSEND=");
espSerial.println(cmd.length());
wait for “>” with espSerial.find(">")
espSerial.println(cmd);
decode the reply with espSerial.find("SEND OK")
ESP8266+Arduino workshop 2015
thingspeak.com
create an account on thingspeak.com
create a channel
make public
enter description
field 1: temperature
field 2: humidity
save
get API Write Key
test in browser http://api.thingspeak.com/update?
key=APIKEY&field1=23.66
ESP8266+Arduino workshop 2015
CONNECTIONS:
● 5V
● GND
● SIGNAL with pull-up resistor
ARDUINO LIBRARY
https://github.com/adafruit/DHT-sensor-library
ARDUINO SKETCH
#include <DHT.h>
DHT dht(3, DHT11);
pinMode(3, INPUT); // DHT11
dht.begin();
float h = dht.readHumidity();
float t = dht.readTemperature();
DHT11 setup
ESP8266+Arduino workshop 2015
ESP8266-thingspeak-dht11-test sketch
22.00degC 59.00% reset ESP8266..
ó#âáT%ÐÇCÁaæ l!ÈÅèchKäFgÚ¡P¥øäæ |cø
[Vendor:www.ai-thinker.com Version:0.9.2.4]
ready
AT+CWMODE=1
no change
AT+CWJAP="tobback","xxxx"
OK
AT+CIPMUX=0
OK
AT+CIPSTART="TCP","184.106.153.149",80
OK [or Error]
Linked
AT+CIPSEND=60
> GET /update?key=RD9SEODFNKIBZ11M&field1=22.00&field2=59.00
wrong syntax
ERROR
SEND OK
+IPD,4:2107
OK
ESP8266+Arduino workshop 2015
ESP8266-thingspeak-dht11-v3 sketch
check espSerial feedback to know if commands are working
send status over Serial for debugging
DHT11 sensor sending data to THINGSPEAK.COM by ESP8266
sample interval (s): 5
22.00degC 57.00% reset ESP8266..module ready..connected to wifi..>send
thingspeak.com OK.. receive OK!
22.00degC 59.00% reset ESP8266..module ready..cannot connect to wifi
cannot connect to wifi
connected to wifi..>send thingspeak.com OK.. receive OK!
22.00degC 58.00% reset ESP8266..module ready..cannot connect to wifi
connected to wifi..>send thingspeak.com OK.. receive OK!
ESP8266+Arduino workshop 2015
ESP8266-twitter-dht11-v3 sketch
twitter via thingspeak.com: tweet from your Arduino
in Thingspeak:
add app ThingTweet
link to twitter account
in sketch:
“GET
/apps/thingtweet/1/statuses/update/api_key=KEY&status=”;
ESP8266+Arduino workshop 2015
ESP8266 with Arduino IDE
Customised IDE using esptool to upload/flash Arduino-style
sketches https://github.com/esp8266/Arduino
Needs Serial-USB converter (UART)
ESP8266+Arduino workshop 2015
ESP8266 with Arduino IDE
Hardware connections:
pull GPIO0 to GND (programming mode)
connect URXD to TX
connect URXD to RX
power off/on
in IDE:
set Tools / Programmer / esptool
set Tools / Board / generic ESP8266
set Tools / Port / xxx/usb0
upload BLINK with pin = 0 = GPIO0
release GPIO0 from GND
connect GPIO0 to LED
ESP8266+Arduino workshop 2015
ESP8266 with Arduino IDE
use high level libraries:
#include <ESP8266WiFi.h>
...
WiFiServer server(80);
WiFi.begin(ssid, password);
WiFiClient client = server.available();
...
String req = client.readStringUntil('r');
...
client.print(s);
standard Arduino workshop 2014-2015
Thank you
www.cassiopeia.hk
Happy tinkering!

More Related Content

What's hot

Programando o ESP8266 com Python
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com PythonRelsi Maron
 
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4Melvin Gutiérrez Rivero
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCUroadster43
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266Elaf A.Saeed
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introductionMichal Sedlak
 
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
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev BoardElaf A.Saeed
 
Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015mycal1
 
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
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseEueung Mulyana
 
Internet of Things
Internet of ThingsInternet of Things
Internet of ThingsAndy Gelme
 
Espresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewEspresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewThe World Bank
 
IOT Talking to Webserver - how to
IOT Talking to Webserver - how to IOT Talking to Webserver - how to
IOT Talking to Webserver - how to Indraneel Ganguli
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Baoshi Zhu
 

What's hot (20)

Programando o ESP8266 com Python
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com Python
 
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCU
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
 
Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015
 
Espressif Introduction
Espressif IntroductionEspressif Introduction
Espressif Introduction
 
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]
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and Firebase
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 
Espresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewEspresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 Overview
 
IOT Talking to Webserver - how to
IOT Talking to Webserver - how to IOT Talking to Webserver - how to
IOT Talking to Webserver - how to
 
Esp8266 Workshop
Esp8266 WorkshopEsp8266 Workshop
Esp8266 Workshop
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
 
Arduino & NodeMcu
Arduino & NodeMcuArduino & NodeMcu
Arduino & NodeMcu
 

Viewers also liked

DSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshopDSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshoptomtobback
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshoptomtobback
 
Home Automation by ESP8266
Home Automation by ESP8266Home Automation by ESP8266
Home Automation by ESP8266Gleb Vinnikov
 
CoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenariosCoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenarioscarlosralli
 
Wi fi technology ppt mine
Wi fi technology ppt mineWi fi technology ppt mine
Wi fi technology ppt mineRoshni Ayappan
 
What is the Internet of Things?
What is the Internet of Things?What is the Internet of Things?
What is the Internet of Things?Felix Grovit
 
getting started with esp8266 @HackIoT#2
getting started with esp8266 @HackIoT#2getting started with esp8266 @HackIoT#2
getting started with esp8266 @HackIoT#2Sergei Silnov
 
How to Install ESP8266 WiFi Web Server using Arduino IDE
How to Install ESP8266 WiFi Web Server using Arduino IDEHow to Install ESP8266 WiFi Web Server using Arduino IDE
How to Install ESP8266 WiFi Web Server using Arduino IDENaoto MATSUMOTO
 
Programming esp8266
Programming esp8266Programming esp8266
Programming esp8266Baoshi Zhu
 
Patent on In-vehicle Detection
Patent on In-vehicle DetectionPatent on In-vehicle Detection
Patent on In-vehicle DetectionJialing Li
 
iGPS- Vehicle & Personal Tracking Solution
iGPS- Vehicle & Personal Tracking SolutioniGPS- Vehicle & Personal Tracking Solution
iGPS- Vehicle & Personal Tracking SolutionSatya Patri
 
Blynk.IoT #iotconfua
Blynk.IoT #iotconfuaBlynk.IoT #iotconfua
Blynk.IoT #iotconfuaAndy Shutka
 
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...Rahul Gupta
 
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900Devrhoid Davis
 
Home Automation by ESP8266 #iotconfua
Home Automation by ESP8266 #iotconfuaHome Automation by ESP8266 #iotconfua
Home Automation by ESP8266 #iotconfuaAndy Shutka
 
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014Dynamic Apps with WebSockets and MQTT - IBM Impact 2014
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014Bryan Boyd
 

Viewers also liked (16)

DSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshopDSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshop
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
 
Home Automation by ESP8266
Home Automation by ESP8266Home Automation by ESP8266
Home Automation by ESP8266
 
CoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenariosCoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenarios
 
Wi fi technology ppt mine
Wi fi technology ppt mineWi fi technology ppt mine
Wi fi technology ppt mine
 
What is the Internet of Things?
What is the Internet of Things?What is the Internet of Things?
What is the Internet of Things?
 
getting started with esp8266 @HackIoT#2
getting started with esp8266 @HackIoT#2getting started with esp8266 @HackIoT#2
getting started with esp8266 @HackIoT#2
 
How to Install ESP8266 WiFi Web Server using Arduino IDE
How to Install ESP8266 WiFi Web Server using Arduino IDEHow to Install ESP8266 WiFi Web Server using Arduino IDE
How to Install ESP8266 WiFi Web Server using Arduino IDE
 
Programming esp8266
Programming esp8266Programming esp8266
Programming esp8266
 
Patent on In-vehicle Detection
Patent on In-vehicle DetectionPatent on In-vehicle Detection
Patent on In-vehicle Detection
 
iGPS- Vehicle & Personal Tracking Solution
iGPS- Vehicle & Personal Tracking SolutioniGPS- Vehicle & Personal Tracking Solution
iGPS- Vehicle & Personal Tracking Solution
 
Blynk.IoT #iotconfua
Blynk.IoT #iotconfuaBlynk.IoT #iotconfua
Blynk.IoT #iotconfua
 
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...
Contextual Retail Engagement and Operations Enabled through MQTT, IBM Bluemix...
 
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900
AT COMMAND SET FOR SENDING DATA VIA TCP USING SIM900
 
Home Automation by ESP8266 #iotconfua
Home Automation by ESP8266 #iotconfuaHome Automation by ESP8266 #iotconfua
Home Automation by ESP8266 #iotconfua
 
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014Dynamic Apps with WebSockets and MQTT - IBM Impact 2014
Dynamic Apps with WebSockets and MQTT - IBM Impact 2014
 

Similar to Cassiopeia Ltd - ESP8266+Arduino workshop

WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11hussain0075468
 
Cassiopeia ltd Arduino follow-up workshop 2018
Cassiopeia ltd   Arduino follow-up workshop 2018Cassiopeia ltd   Arduino follow-up workshop 2018
Cassiopeia ltd Arduino follow-up workshop 2018tomtobback
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Pance Cavkovski
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOJingfeng Liu
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IOJingfeng Liu
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the ArduinoCharles A B Jr
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfDaniel Donatelli
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of thingsRaghav Shetty
 
Arduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppArduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppSanjay Kumar
 
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
 
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
 
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
 

Similar to Cassiopeia Ltd - ESP8266+Arduino workshop (20)

Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
 
ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
Cassiopeia ltd Arduino follow-up workshop 2018
Cassiopeia ltd   Arduino follow-up workshop 2018Cassiopeia ltd   Arduino follow-up workshop 2018
Cassiopeia ltd Arduino follow-up workshop 2018
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IO
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdf
 
NodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDENodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDE
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of things
 
Arduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppArduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web App
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
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
 
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
 
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)
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Cassiopeia Ltd - ESP8266+Arduino workshop

  • 1. standard Arduino workshop 2014-2015 ESP8266+Arduino Tom Tobback www.cassiopeia.hk 2015
  • 3. ESP8266+Arduino workshop 2015 Arduino and wifi Official Arduino wifi shield EUR 69 + VAT Sparkfun CC3000 shield USD 40 Adafruit CC3000 module USD 35
  • 4. ESP8266+Arduino workshop 2015 ESP8266 wifi module small powerfull cheap => IoT
  • 6. ESP8266+Arduino workshop 2015 ESP8266 wifi module don’t need microcontroller 2 GPIO pins available on ESP-01 more on ESP-12
  • 7. ESP8266+Arduino workshop 2015 ESP8266 wifi module direct programming over USB/UART without using Arduino board as micro-controller 1. esptool.py 2. NodeMCU - Lua 3. Arduino IDE! https://github.com/esp8266/Arduino
  • 9. ESP8266+Arduino workshop 2015 Downloads http://www.dimsumlabs.com/ click on ESP8266 event ● DHT library zipped ● zip file with: esp8266-thingspeak-dht11-test esp8266-thingspeak-dht11-v3 esp8266-dht11-webserver WiFiWebServer-dht11-led
  • 10. ESP8266+Arduino workshop 2015 ESP8266 pinout Vcc = 3V3 GND UTXD = serial TX URXD = serial RX RST = reset CH_PD = pull up 4.6kOhm GPIO0 = input/output GPIO2 = input/output
  • 11. ESP8266+Arduino workshop 2015 ESP8266 test Communicate with ESP8266 using Serial converter on our Arduino board ● Vcc = 3V3 ● GND ● URXD = serial RX = pin0 ● UTXD = serial TX = pin1 note: pins seem 5V tolerant
  • 12. ESP8266+Arduino workshop 2015 ESP8266 test Communicate with ESP8266 using Serial converter on our Arduino board (RX, TX) Upload any sketch not using Serial e.g. blink Connect ESP module Open IDE Serial Monitor Baud rate = 9600 Setting = “Both NL & CR”
  • 13. ESP8266+Arduino workshop 2015 ESP8266 test AT commands of standard firmware AT+RST reset AT+GMR check firmware version AT+CWMODE=3 set mode to AP+STA AT+CWLAP list wifi networks AT+CWJAP=”ssid”,”password” connect to your wifi AT+CIOBAUD? check baud rate AT+CIOBAUD=9600 set new baud rate https://nurdspace.nl/ESP8266
  • 14. ESP8266+Arduino workshop 2015 ESP8266 and software serial Arduino board has 1 hardware Serial on pin0 and pin1 but this is also used for uploading and for Serial Monitor Some earlier modules had baud rate 115200 and their firmware did not allow to change it. would only work with hardware Serial, so Serial Monitor over software Serial + USB converter
  • 15. ESP8266+Arduino workshop 2015 ESP8266 and software serial Better solution: use updated firmware to allow 9600 baud then can use software Serial for ESP8266 and hardware Serial for uploading/monitor as always new modules come set with default 9600 baud no update of firmware necessary software serial on e.g. pin10 and pin11 standard Arduino library
  • 16. ESP8266+Arduino workshop 2015 ESP8266 setup ESP8266 can act as: WEB SERVER serve web pages over existing wifi network ACCESS POINT create its own wifi network + web server WEB CLIENT communicate with web servers (e.g. thingspeak.com) over existing wifi network
  • 17. ESP8266+Arduino workshop 2015 ESP8266 web server AT+RST reset AT+CWMODE=1 configure as node AT+CWLAP list access points AT+CWJAP=”ssid”,”pwd” connect to your wifi AT+CIFSR show ip address AT+CIPMUX=1 allow multiple connects AT+CIPSERVER=1,80 start server on port 80 go to browser and type IP address check reply in serial monitor
  • 18. ESP8266+Arduino workshop 2015 ESP8266 web server go to browser and type IP address check reply in serial monitor +IPD, 0 [means connection id = 0] AT+CIPSEND=0,12 hello world [enter] AT+CIPCLOSE=0 see browser
  • 19. ESP8266+Arduino workshop 2015 ESP8266 access point AT+RST reset AT+CWMODE=2 configure as access point AT+CWSAP? get your AP details AT+CWSAP=”ssid”,”pwd”,1,3 define your wifi AP change to unique ssid connect to the AP with your phone AT+CIFSR show ip address AT+CIPMUX=1 allow multiple connects AT+CIPSERVER=1,80 start server on port 80 go to browser and type IP address check reply in serial monitor
  • 20. ESP8266+Arduino workshop 2015 ESP8266 web client AT+RST reset AT+CWMODE=1 configure as node AT+CWJAP=”ssid”,”pwd” connect to your wifi AT+CIPSTART=”TCP”,”184.106.153.149”,80 connect to TCP socket AT+CIPSEND= 4 wait for “>” GET [enter] check reply
  • 21. ESP8266+Arduino workshop 2015 ESP8266 web client ARDUINO SKETCH send commands over software serial espSerial.println("AT+RST"); construct String to send commands AT+CIPSTART=”TCP”,”184.106.153.149”,80 String cmd; cmd = "AT+CIPSTART="TCP",""; cmd += THINGSPEAK_IP; cmd += "",80"; espSerial.println(cmd);
  • 22. ESP8266+Arduino workshop 2015 ESP8266 web client ARDUINO SKETCH construct HTTP request to be sent String cmd; cmd = "GET /update?key=xxxxxxxxxxxxxxxxxx&field1="; cmd += temp; cmd += "rn"; send the length of the command espSerial.print("AT+CIPSEND="); espSerial.println(cmd.length()); wait for “>” with espSerial.find(">") espSerial.println(cmd); decode the reply with espSerial.find("SEND OK")
  • 23. ESP8266+Arduino workshop 2015 thingspeak.com create an account on thingspeak.com create a channel make public enter description field 1: temperature field 2: humidity save get API Write Key test in browser http://api.thingspeak.com/update? key=APIKEY&field1=23.66
  • 24. ESP8266+Arduino workshop 2015 CONNECTIONS: ● 5V ● GND ● SIGNAL with pull-up resistor ARDUINO LIBRARY https://github.com/adafruit/DHT-sensor-library ARDUINO SKETCH #include <DHT.h> DHT dht(3, DHT11); pinMode(3, INPUT); // DHT11 dht.begin(); float h = dht.readHumidity(); float t = dht.readTemperature(); DHT11 setup
  • 25. ESP8266+Arduino workshop 2015 ESP8266-thingspeak-dht11-test sketch 22.00degC 59.00% reset ESP8266.. ó#âáT%ÐÇCÁaæ l!ÈÅèchKäFgÚ¡P¥øäæ |cø [Vendor:www.ai-thinker.com Version:0.9.2.4] ready AT+CWMODE=1 no change AT+CWJAP="tobback","xxxx" OK AT+CIPMUX=0 OK AT+CIPSTART="TCP","184.106.153.149",80 OK [or Error] Linked AT+CIPSEND=60 > GET /update?key=RD9SEODFNKIBZ11M&field1=22.00&field2=59.00 wrong syntax ERROR SEND OK +IPD,4:2107 OK
  • 26. ESP8266+Arduino workshop 2015 ESP8266-thingspeak-dht11-v3 sketch check espSerial feedback to know if commands are working send status over Serial for debugging DHT11 sensor sending data to THINGSPEAK.COM by ESP8266 sample interval (s): 5 22.00degC 57.00% reset ESP8266..module ready..connected to wifi..>send thingspeak.com OK.. receive OK! 22.00degC 59.00% reset ESP8266..module ready..cannot connect to wifi cannot connect to wifi connected to wifi..>send thingspeak.com OK.. receive OK! 22.00degC 58.00% reset ESP8266..module ready..cannot connect to wifi connected to wifi..>send thingspeak.com OK.. receive OK!
  • 27. ESP8266+Arduino workshop 2015 ESP8266-twitter-dht11-v3 sketch twitter via thingspeak.com: tweet from your Arduino in Thingspeak: add app ThingTweet link to twitter account in sketch: “GET /apps/thingtweet/1/statuses/update/api_key=KEY&status=”;
  • 28. ESP8266+Arduino workshop 2015 ESP8266 with Arduino IDE Customised IDE using esptool to upload/flash Arduino-style sketches https://github.com/esp8266/Arduino Needs Serial-USB converter (UART)
  • 29. ESP8266+Arduino workshop 2015 ESP8266 with Arduino IDE Hardware connections: pull GPIO0 to GND (programming mode) connect URXD to TX connect URXD to RX power off/on in IDE: set Tools / Programmer / esptool set Tools / Board / generic ESP8266 set Tools / Port / xxx/usb0 upload BLINK with pin = 0 = GPIO0 release GPIO0 from GND connect GPIO0 to LED
  • 30. ESP8266+Arduino workshop 2015 ESP8266 with Arduino IDE use high level libraries: #include <ESP8266WiFi.h> ... WiFiServer server(80); WiFi.begin(ssid, password); WiFiClient client = server.available(); ... String req = client.readStringUntil('r'); ... client.print(s);
  • 31. standard Arduino workshop 2014-2015 Thank you www.cassiopeia.hk Happy tinkering!