ESP8266 WiFi - ESP8266 IoT Workshop (2024)

Lab Objectives

This Lab will show you how to connection your ESP8266 to a local WiFi network. This Lab will also introduce the Serial Monitor, which allows you to see output from a running application. By the end of this lab you should:

  • Be able to add a WiFi connection to a sketch
  • Be able to add a Serial connection and generate output to the serial connection.
  • Understand the function calls needed to start up the WiFi and Serial connections then how to use the connections and where to find documentation about the functions available.

Introduction

In the First App practical you verified you had a working development environment and uploaded your first application to the ESP8266. Now we will start exploring some of the more advanced functionality of the ESP8266, starting with the on board WiFi interface.

The ESP8266 has a built in WiFi interface that supports 802.11 b/g/n 2.4 GHz networking. 5GHz frequencies are not supported. The ESP8266 can be setup to be an access point or to join an existing Wireless LAN. We are going to join a LAN in the workshop.

Step 1 - Load an example sketch

In the Arduino IDE, load the WiFiScan example sketch, using File -> Examples -> ESP8266WiFi -> WiFiScan then upload the sketch to your ESP8266. This sketch will scan for local WiFi networks and display the results.

Step 2 - Run the sketch and monitor output

ESP8266 WiFi - ESP8266 IoT Workshop (1)

To display the results, the sketch is using the Serial interface on the ESP8266 to send output to. This output will be sent back into the USB port on your laptop/workstation. To see the output you need to open up the Serial Monitor, which is the magnifying glass icon at the top right of the IDE. You must ensure that the baud rate set in the serial monitor matches the speed of the Serial.begin(115200); statement in the setup function in the sketch.

Every 5 seconds you will see the board scan for available networks then output what it finds to the serial port.

Step 3 - Access the documentation for the enhanced ESP8266 library

You can get documentation about using ESP8266 in Arduino and the libraries that are installed with the ESP8266 plugin from here. If you finish this assignment early modify the sketch to show the channel number each network is using and the encryption type in addition to the SSID and RSSI(signal strength).

Step 4 - How to connect to a WiFi network

The example sketch WiFiClient shows how to connect to a WiFi network, providing a SSID and password, which we will use in part 2 of the workshop. Load the sketch (File -> Examples -> ESP8266WiFi -> WiFiClient) and examine the code, take note of how the WiFi network credentials are entered to join a network.

Note

you don't need to run this example and apply for the sparkfun credentials, simply walk through the code and see how the connection to the WiFi is created.*

Step 5 - Understanding the pattern of using the ESP8266 Library

Now you have seen 2 different example sketches using both Serial and WiFi connections. You may begin to see a pattern on how to use the resources:

  • Optionally include the required header, such as #include "ESP8266WiFi.h"
  • In the setup() function initialise the library, usually with a begin() call and/or setting parameters
  • In the loop() function access features of the library

Note

If you finish early jump back to step 3 to add the additional functionality

ESP8266 WiFi - ESP8266 IoT Workshop (2024)

FAQs

What is the use of the ESP8266 Wi-Fi module * 1 point monitors motion evaluates air pressure network provider switches circuits? ›

The ESP8266 WiFi Module is a self contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor.

Can ESP8266 work with 5GHz Wi-Fi? ›

The ESP8266 has a built in WiFi interface that supports 802.11 b/g/n 2.4 GHz networking. 5GHz frequencies are not supported.

How much power does the ESP8266 consume per hour? ›

In the context of smart home projects powered by ESPHome, for example, choosing an ESP8266 over an ESP32 could drastically reduce power usage when both devices are often in their full operating mode, as the ESP8266 draws around 120mA. In contrast, the ESP32 requires around 180mA when transmitting data over WiFi.

Why is ESP8266 so popular? ›

Advantage of ESP8266 over other competitors like Arduino

The price and size are the USP of the module with the added advantage of good speed and processing power. Arduinos are approximately 10 times more expensive and much larger than ESP with comparable processing powers.

What are the disadvantages of ESP8266? ›

Disadvantages of the ESP8266:

1 The energy-efficient design is low, which may have some impact on battery life, especially in low-power applications that need to run for long periods of time.

What is the maximum WiFi range of ESP8266? ›

Connecting to the WiFi module through a TPLink WR841N router, [CN] as able to ping the module at 479 meters with a huge rubber duck antenna soldered on, or 366 meters with the PCB antenna.

Can ESP8266 run on 5V? ›

The ESP8266's maximum voltage is 3.6V, so the Thing has an onboard 3.3V regulator to deliver a safe, consistent voltage to the IC. That means the ESP8266's I/O pins also run at 3.3V, you'll need to Logic Level Controller any 5V signals running into the IC.

Can ESP8266 connect to phone hotspot? ›

The ESP8266's WiFi radio is 2.4GHz only. To enable 2.4GHz on the iPhone hotspot, turn on the "Maximize Compatibility" button under "Settings | Personal Hotspot". Then 2.4GHz devices should be able to connect to the phone.

How long can ESP8266 run on battery? ›

The ESP8266 is pretty power hungry, but you should be able to get much more than two weeks on those batteries. Even in the worst case scenario, I'd expect about three months. Right, there is sleep and then there is deep sleep. AT+SLEEP has 2 modes, light sleep and modem sleep.

Can ESP8266 run 24 7? ›

The ESP8266 (NodeMCU) has a radio and a processor with running code. An NRF24 is just a radio, no MCU. My ESP modules are running without problems 24/7. It all has to do with a clean supply, proper code and non-interfering peripherals.

How to speed up ESP8266? ›

The serial upload speed defaults to 115200 bps, which is reliable, but can feel a bit slow. You can increase the upload speed by a factor of about 8 by selecting 921600 under the Tools > Upload Speed menu. This faster upload speed can be slightly less reliable, but will save you loads of time!

Can ESP8266 work without Arduino? ›

A few weeks ago I've created a project with an ESP8266 called: ESP8266 Web Server without an Arduino. That's exactly what you're going to build, if you follow all the steps in this Instructable. It's amazing what you can do with this $4 WiFi Module. The video below shows the final result of this project.

How do I connect my phone to my ESP8266 module? ›

  1. Step 1: Solder. Solder the ESP8266-12 module to the PCB adapter.
  2. Step 2: Make Hookups. ...
  3. Step 3: ​Mount the ESP Module. ...
  4. Step 4: Mount All the Remaining Parts.
  5. Step 5: Connect All the Elements. ...
  6. Step 6: Software for the Microcontroller. ...
  7. Step 7: ESP Configuration. ...
  8. Step 8: ​Smartphone Configuration.

What language does ESP8266 use? ›

ZBasic for ESP8266 — A subset of Microsoft's widely-used Visual Basic 6, which has been adapted as a control language for the ZX microcontroller family and the ESP8266. Zerynth — IoT framework for programming ESP8266 and other microcontrollers in Python.

What is the use of an ESP8266 Wi-Fi module? ›

The ESP8266 module enables microcontrollers to connect to 2.4 GHz Wi-Fi, using IEEE 802.11 bgn. It can be used with ESP-AT firmware to provide Wi-Fi connectivity to external host MCUs, or it can be used as a self-sufficient MCU by running an RTOS-based SDK.

What is the purpose of a Wi-Fi module? ›

Wi-Fi modules are used to provide internet connection to robotic and electronic projects. Wi-Fi modules allow developing IoT (Internet of Things) projects. By using Wi-Fİ modules you can send data over the internet to your robot or make it send data over the internet.

What is the Wi-Fi component of ESP8266? ›

ESP8266 Serial Wifi Wireless Module has a powerful enough on-board processing and storage capability that allows it to be integrated with the sensors and other application-specific devices through its GPIOs with minimal development up-front and minimal loading during runtime.

Top Articles
Davao Manpower Agencies Accredited by POEA for Overseas
How To Reduce Voltage Using a Resistor? Step By Step
Circle L Bassets
Public Agent.502
Methstreams Boxing Stream
Cpcon Protection Priority Focus
Milk And Mocha Bear Gifs
Oak Ridge Multibillion Dollar Nuclear Project: Largest Investment in Tennessee History
Scrotal Support Walgreens
Oriellys Bad Axe
Who Is Denise Richards' Husband? All About Aaron Phypers
Claims Adjuster: Definition, Job Duties, How To Become One
Pathfinder 2E Throwing Weapons
'Kendall Jenner of Bodybuilding' Vladislava Galagan Shares Her Best Fitness Advice For Women – Fitness Volt
Ian D. McClure on LinkedIn: New partnerships, licenses, patents and projects in today’s #ukotc…
Csgo Themed Inventory
Greene County sheriff sues state auditor for not releasing whistleblower complaints
MyChart | University Hospitals
Ratchet & Clank Rift Apart: Trofea - lista | GRYOnline.pl
What is IXL and How Does it Work?
Secret Stars Sessions Julia
Identogo Roanoke Va
Perugino's Deli Menu
Soul of the Brine King PoE Pantheon 3.14 Upgrade
David Goggins Is A Fraud
Springfield Ma Craigslist
Twitter Jeff Grubb
Toonily.cim
Magicseaweed Bob Hall
Nehemiah 6 Kjv
Money Network Pay Stub Portal 711
They Cloned Tyrone Showtimes Near Showbiz Cinemas - Kingwood
Courtney Callaway Matthew Boynton
18443168434
Kino am Raschplatz - Vorschau
Warrior Badge Ability Wars
Alloyed Trident Spear
Joy Ride 2023 Showtimes Near Amc Ward Parkway
La Monja 2 Pelicula Completa Tokyvideo
Lipidene Reviews 2021
Heatinghelp The Wall
G122 Pink Pill
Sdn Md 2023-2024
Lol Shot Io Unblocked
Stihl Blowers For Sale Taunton Ma
Stellaris Archaeological Site
Minute Clinic Schedule 360
Craigslist Lasalle County Il
Ncaa Wrestling Bracket Challenge
Natalya Neidhart: Assembling the BOAT
Lucio Volleyball Code
Online Reading Resources for Students & Teachers | Raz-Kids
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 5828

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.