Académique Documents
Professionnel Documents
Culture Documents
• To allow novice learners to tinker and experiment with the ESPresso Lite quickly
and easily;
B. Making it work
F. Controlling an actuator
G. Conditional programming
• Ease of use
- First, connect the OLED display, DHT11 sensor and USB cable (yellow is GND
and pink is VIN)
- When this happens, your ESPresso Lite will be in AP mode and will display the
board id as a WiFi network name
- Look for your board’s Wi-Fi
network name.
- Click on it to connect the
ESPresso Lite to your computer
- An Internet protocol (IP)
address 192.168.4.1 will
appear in the OLED display. Key
in this number into your web
browser and run it.
- A box will appear and prompt
you to choose an appropriate
Wi-Fi network SSID and
password
- Choose SSID : IoT-Workshop
Password : espresso
Building a simple sensor
- The ESPresso Lite is specially designed to minimise wiring when building
simple sensors such as for temperature-humidity. The components can be
inserted into the appropriate headers directly
topic: ESPert/xxxxxxxx/Command
Command message: {“LED”: “1” }
- Change LED to OLED you can send message to display on OLED Screen
{“OLED”:”Hello World”}
- Use bridging you can send message directly from the browser itself
www.espert.io/bridge/ESPert/xxxxxxxx/Command?LED=11&Message=LED
http://www.espert.io/bridge/ESPert/14348880/C
ommand?OLED=Hello World&Message=Button
pushed
Take a break
Conditional programming with IFTTT
- IFTTT or “If This Then That” is a free web-service that allow users to connect
other web-services together, triggered based on the conditional statement of
“if this then that”
- IFTTT can help novice IoT learner to create simple a IoT service as you can
turn everyday things into ‘smart’ objects by setting up its relationship using
simple logic such as “if the room is too hot, then turn on the airconditioning”.
- We will learn to use this service for our next task: To build a push notification
service whereby “if a button is pressed, then send a text message to your
ESPresso Lite
Creating an IFTTT account
- First, let’s begin by creating an IFTTT account at http://ifttt.com
- Create an ‘applet’ by selecting a channel for the trigger. You will be using the
Maker channel
- Connect to the Maker channel and find out what is the key (auto-generated)
for you
- Copy this key (Ctrl-C)
as we will need to use
this later
Hardcoding the IFTTT key into the ESPresso Lite
- At the MQTT web socket panel and publish the message containing
- This step essentially hardcodes the IFTTT key into the ESPresso Lite to
prevent third-party abuse of the key. The device will retain the information
even after it has been switched off
1h Build a hot button / push notification service
Let’s start to create the push notification service to ESPresso Lite board of your
friend using the conditional statement below:
If the FLASH button in the ESPresso Lite is pressed, then send a text message to
ESPresso Lite board of your friend
• Firstly make sure that you have obtained the IFTTT channel key and publish the
key via the MQTT web socket panel at http://www.espert.io/mqtt
• Once these prior setup is done, you can start creating your own button Applet
IFTTT
Choose a service
type “Maker”
in text box
Receive a web request
Sending notification to
Your friend’s board
Press the button
Once this action is created, you can proceed to test out your first IoT service. If it
works, congratulations! If it doesn’t, continue to troubleshoot and identify the
steps you may have missed out.
PROGRAM WITH ARDUINO IDE
1. Download the Arduino IDE
2. Install the Arduino core for ESP8266 (WROOM-02)
3. Install dependency for ESPresso Lite V2.0 board
Download the Arduino IDE
- The Arduino IDE can be downloaded from
https://www.arduino.cc/en/Main/Software
- we recommend using earlier versions (e.g. 1.6.13)
- Install Arduino 1.8.1 https://www.arduino.cc/en/Main/Software
- Start Arduino and open Preferences window.
Install the Arduino core for ESP8266 (WROOM-02)
1. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field.
2. Open Board Manager from Tools > Board > Board Manager and then install
esp8266 by ESP8266 Community (current version is 2.3.0*) by clicking on it.
3. From menu Tools > Board select ESPresso Lite 2.0
Install dependency for ESPresso Lite V2.0 board
Open Library Manager (menu Sketch > Include Library > Manage Libraries…) then
install the following libraries
When you are ready, open the Arduino IDE and try compiling some examples from
ESPert.
How to upload program Over-The-Air
1. OTA (Over the Air) update is the process of loading the firmware to ESP
module using Wi-Fi connection rather that a serial port.
2. Such functionality became extremely useful in case of limited or no physical
access to the module
3. OTA may be done using
a. Arduino IDE
b. Web Browser
c. HTTP Server
Web Browser OTA
1. web browser OTA can be useful in the following typical scenarios
2. after application deployment if loading directly from Arduino IDE is
inconvenient or not possible
3. after deployment if user is unable to expose module for OTA from external
update server
4. to provide updates after deployment to small quantity of modules when
setting an update server is not practicable
Concept
1. View compilation file by Open File > Preferences, look for “Show verbose
output during:” and check out “compilation” option
2. Start Arduino IDE and load sketch WebUpdater.ino available under File >
Examples > ESP8266HTTPUpdateServer
3. Update ssid and pass in the sketch so the module can join your Wi-Fi network
4. Upload sketch Once done open Serial Monitor and check message displayed,
that contains url for OTA update
5. Now open web browser and enter the url provided on Serial Monitor
6. Upload file new .bin
1.
Arduino: Lesson 1 - Blinking an LED
1. Open BlinkOTA.ino from resources folder
2. Compile the sketch and copy .bin path
Build a Hot Button - D.I.Y version
Build a Smart Plug - D.I.Y version
Q&A