SlideShare a Scribd company logo
The Arduino WiFi
Shield
Katrina Ellison Geltman
March 27, 2014
Arduino UNO R3 Arduino WiFi Shield
Arduino UNO R3 Arduino WiFi Shield
+
vs.
+
vs.
How it Works
Getting set up
In the beginning, you have:
WiFi ShieldComputer WiFi Router
Arduino
You set up the basics.
WiFi ShieldComputer WiFi Router
Arduino
WiFi
driver
Server
object
You request to connect to the network.
WiFi ShieldComputer WiFi Router
Arduino
WiFi
driver
Request to connect
Server
object
If you’re lucky, you connect successfully.
WiFi ShieldComputer WiFi Router
Arduino
WiFi
driverConnection successful
Request to connect
Server
object
You start your server.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Start TCP server
listening on
socket/port
Now it’s listening on a particular port.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
You’re ready to go!
Receiving requests
After setup, everything happens in an event loop.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
At the beginning of the loop, a client object is created
using the server’s port & socket.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
The client asks the WiFi shield whether it’s active or not.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
What's my state?
If there haven’t been any requests, the client stays inactive.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Inactive
The event loop ends and re-starts.
If there haven’t been any requests, the client stays inactive.
!
!
The event loop ends and re-starts.
!
I think the client is deleted, but I’m not sure how.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
If a request has been made, the client activates.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Client
object
Connected!
Request!
Your code asks the client object for whatever data it’s receiving
from your computer.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Client
object
Connected!
Request!
Data?
If there is data, it reads it and processes it.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Client
object
Read data
Request!
Read data
(This is when your Arduino actually does something)
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Client
object
Read data
Request!
Read data
Then the event loop ends and the client is deleted.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
!
Then the event loop ends and the client is deleted.
(I think)
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
Client
object
Inactive
That’s all good
How it goes wrong
Bad things happen if you disconnect from the network.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
The server doesn’t reconnect properly when the network reconnects.
WiFi ShieldComputer WiFi Router
Arduino
Server
object
Your
code
loop
We know this from our debugging output.
Socket Port
Server
Status
Client
Status
-1 0 0 0
We know this from our debugging output.
Socket Port
Server
Status
Client
Status
-1 0 0 0
0 80 0 0
We know this from our debugging output.
Socket Port
Server
Status
Client
Status
-1 0 0 0
0 80 0 0
Still active!
We know this from our debugging output.
Socket Port
Server
Status
Client
Status
-1 0 0 0
0 80 0 0
No server!
How to fix it
Manually release
port & socket
void WiFiServer::disconnect() {
WiFiClass::_state[_sock] = -1;
WiFiClass::_server_port[_sock] = 0;
}
void WiFiServer::disconnect() {
WiFiClass::_state[_sock] = -1;
WiFiClass::_server_port[_sock] = 0;
}
void WiFiServer::disconnect() {
WiFiClass::_state[_sock] = -1;
WiFiClass::_server_port[_sock] = 0;
}
void WiFiServer::disconnect() {
WiFiClass::_state[_sock] = -1;
WiFiClass::_server_port[_sock] = 0;
}
Socket Port
Server
Status
Client
Status
-1 0 0 0
Socket Port
Server
Status
Client
Status
-1 0 0 0
0 80 1 0
It works!
It works!
… trivially
It doesn’t work
if a client object has ever
been created
It doesn’t work
if a client object has ever
been created
This makes it useless!
It doesn’t work
if a client object has ever
been created
usually
This makes it useless!
Memory
management?
But available memory
does not change from
loop to loop.
I don’t really
know C++
Or network
programming
So I would love to
hear your ideas
But whether or not you
can help
Your main takeaway
should be
Arduino UNO R3 Arduino WiFi Shield

More Related Content

PDF
Esp8266 basics
PDF
Esp8266 v12
PDF
ESP32 WiFi & Bluetooth Module - Getting Started Guide
PPTX
Attendance System using ESP8266(Wi-Fi) with MySQL
PPTX
Open Source Home Automation with LinkSprite.IO
PPTX
IoT with openHAB on pcDuino3B
PPTX
Wi-Fi Esp8266 nodemcu
PPTX
Node mcu x raspberrypi2 x mqtt
Esp8266 basics
Esp8266 v12
ESP32 WiFi & Bluetooth Module - Getting Started Guide
Attendance System using ESP8266(Wi-Fi) with MySQL
Open Source Home Automation with LinkSprite.IO
IoT with openHAB on pcDuino3B
Wi-Fi Esp8266 nodemcu
Node mcu x raspberrypi2 x mqtt

What's hot (19)

PPTX
Lab Handson: Power your Creations with Intel Edison!
PDF
Webshield internet of things
PPTX
Arduino & NodeMcu
PDF
Lesson 9- NodeMCU with Arduino UNO (UART)
PDF
Interacting with Intel Edison
PDF
Gc itach wf2-ir
PDF
Rdl esp32 development board trainer kit
PDF
NodeMCU 0.9 Manual using Arduino IDE
PDF
Lesson 10- NodeMCU with LCD I2C
PDF
Intel Curie Presentation
PDF
IoT Getting Started with Intel® IoT Devkit
PDF
IoT Intro and Demo
PPTX
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
PDF
Shameful secrets of proprietary network protocols
PPTX
Attendance system using MYSQL with Raspberry pi and RFID-RC522
PPTX
Ceis101 final joshua_brown
PPTX
IoT on Raspberry Pi
PPTX
Arduino 習作工坊 - Lesson 1 燈光之夜
PDF
Overview of the Intel® Internet of Things Developer Kit
Lab Handson: Power your Creations with Intel Edison!
Webshield internet of things
Arduino & NodeMcu
Lesson 9- NodeMCU with Arduino UNO (UART)
Interacting with Intel Edison
Gc itach wf2-ir
Rdl esp32 development board trainer kit
NodeMCU 0.9 Manual using Arduino IDE
Lesson 10- NodeMCU with LCD I2C
Intel Curie Presentation
IoT Getting Started with Intel® IoT Devkit
IoT Intro and Demo
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Shameful secrets of proprietary network protocols
Attendance system using MYSQL with Raspberry pi and RFID-RC522
Ceis101 final joshua_brown
IoT on Raspberry Pi
Arduino 習作工坊 - Lesson 1 燈光之夜
Overview of the Intel® Internet of Things Developer Kit
Ad

Viewers also liked (20)

PDF
Arduino + ethernet shield (1)
PDF
Cloud Computing - Technology Radar 2015 / Apr 27th 2015
PPT
Fs Ch 11
PDF
Libro de proyectos del kit oficial de Arduino en castellano completo - Arduin...
PDF
Simulated Annealing
PDF
Fy10 us budget_spending
PPTX
SharePoint Online Collaboration Options
DOCX
Articulo
PPTX
Pricing for profit
PDF
Certificate - Azure Fundamentals
PDF
City square presentation
PDF
ITCamp 2013 - Peter Leeson - Intelligent Evolution
PDF
Azure licensing (not) so easy - Laurynas Dovydaitis
PDF
Software Licensing for SaaS Applications
PPT
Tutorial Brainshark 4
PDF
Federal it transformation plans
PPTX
Automotive Industry Research: An Analysis of the Key Insights from the VFACTS...
PPT
Advanced scientific visualization
PPTX
SharePoint Online v Onprem - presented by Concurrency, Inc
Arduino + ethernet shield (1)
Cloud Computing - Technology Radar 2015 / Apr 27th 2015
Fs Ch 11
Libro de proyectos del kit oficial de Arduino en castellano completo - Arduin...
Simulated Annealing
Fy10 us budget_spending
SharePoint Online Collaboration Options
Articulo
Pricing for profit
Certificate - Azure Fundamentals
City square presentation
ITCamp 2013 - Peter Leeson - Intelligent Evolution
Azure licensing (not) so easy - Laurynas Dovydaitis
Software Licensing for SaaS Applications
Tutorial Brainshark 4
Federal it transformation plans
Automotive Industry Research: An Analysis of the Key Insights from the VFACTS...
Advanced scientific visualization
SharePoint Online v Onprem - presented by Concurrency, Inc
Ad

Similar to The Arduino WiFi Shield (20)

PDF
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
PPT
L14 More Wireless Hacking: Cracking Wired Equivalent Privacy (WEP) it-slidesh...
PDF
Wavlink AC750 WiFi range extender.pdf
PDF
Arduino: interruptor de encendido controlado por Internet
PDF
Manual repetidor wi fi
PDF
Osiot13 IoT buildout
PPT
Java client socket-20070327
PPT
Strengthening security of WiFi networks.
PPTX
10 steps for troubleshooting wi fi
PPT
Backend network-planning
PPT
Wireless routers Presentation
PDF
programmer avec Arduino
PDF
Netgear wnr834 b_v2
PPT
Firewall
PPT
Authenticated Identites in VoIP Call Control
PPT
Presentation To Vo Ip Round Table V2
PDF
Instrument Rack to visualize
 Rails requests processing
PPT
wirelessssssssssssssssssssssssssssssssss
PPTX
MIT App Inventor + Arduino + Bluetooth
PDF
Wi-Fi Module
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
L14 More Wireless Hacking: Cracking Wired Equivalent Privacy (WEP) it-slidesh...
Wavlink AC750 WiFi range extender.pdf
Arduino: interruptor de encendido controlado por Internet
Manual repetidor wi fi
Osiot13 IoT buildout
Java client socket-20070327
Strengthening security of WiFi networks.
10 steps for troubleshooting wi fi
Backend network-planning
Wireless routers Presentation
programmer avec Arduino
Netgear wnr834 b_v2
Firewall
Authenticated Identites in VoIP Call Control
Presentation To Vo Ip Round Table V2
Instrument Rack to visualize
 Rails requests processing
wirelessssssssssssssssssssssssssssssssss
MIT App Inventor + Arduino + Bluetooth
Wi-Fi Module

Recently uploaded (20)

PDF
SAHIL PROdhdjejss yo yo pdf TOCOL PPT.pdf
PDF
Maxon CINEMA 4D 2025 Crack Free Download Latest Version
PDF
ISS2022 present sdabhsa hsdhdfahasda ssdsd
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PPTX
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
DOCX
Edukasi kultural untuk kita semua maka c
PDF
2_STM32&SecureElements2_STM32&SecureElements
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
PPTX
Operating System Processes_Scheduler OSS
PPTX
New professional education PROF-ED-7_103359.pptx
PPTX
quadraticequations-111211090004-phpapp02.pptx
PPTX
Lecture-3-Computer-programming for BS InfoTech
PDF
PakistanCoinageAct-906.pdfdbnsshsjjsbsbb
PPT
Hypersensitivity Namisha1111111111-WPS.ppt
PPTX
AI_ML_Internship_WReport_Template_v2.pptx
PPTX
A Clear View_ Interpreting Scope Numbers and Features
PPT
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh
PPT
Lines and angles cbse class 9 math chemistry
PPTX
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru
SAHIL PROdhdjejss yo yo pdf TOCOL PPT.pdf
Maxon CINEMA 4D 2025 Crack Free Download Latest Version
ISS2022 present sdabhsa hsdhdfahasda ssdsd
A PROPOSAL ON IoT climate sensor 2.docx
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
Edukasi kultural untuk kita semua maka c
2_STM32&SecureElements2_STM32&SecureElements
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
Operating System Processes_Scheduler OSS
New professional education PROF-ED-7_103359.pptx
quadraticequations-111211090004-phpapp02.pptx
Lecture-3-Computer-programming for BS InfoTech
PakistanCoinageAct-906.pdfdbnsshsjjsbsbb
Hypersensitivity Namisha1111111111-WPS.ppt
AI_ML_Internship_WReport_Template_v2.pptx
A Clear View_ Interpreting Scope Numbers and Features
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh
Lines and angles cbse class 9 math chemistry
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru

The Arduino WiFi Shield