SlideShare a Scribd company logo
Rise of the Machines:
PHP & IoT
@colinodell
Colin O’Dell
• Lead Web Developer at Unleashed Technologies
• PHP League Leadership Team
• Baltimore PHP Co-Organizer
• Arduino & Raspberry Pi Enthusiast
@colinodell
Goals
• Introduce the basics of building custom IoT devices
• Understand where web technologies fit in
• Four real-world example projects
@colinodell
Internet of Things
The Internet of Things is the internetworking of physical devices,
vehicles, buildings and other items—embedded with electronics,
software, sensors, actuators, and network connectivity that enable
these objects to collect and exchange data.
- https://en.wikipedia.org/wiki/Internet_of_things
@colinodell
Internet of Things
The Internet of Things is the internetworking of physical devices,
vehicles, buildings and other items—embedded with electronics,
software, sensors, actuators, and network connectivity that enable
these objects to collect and exchange data.
- https://en.wikipedia.org/wiki/Internet_of_things
@colinodell
Connectivity
• Ethernet / WiFi
• NFC / RFID
• Bluetooth LE
• Zigbee / Z-Wave
• Cellular (LTE / CDMA / GSM)
• …and many others
@colinodell
0
10
20
30
40
50
60
2003 2010 2015 2020
(Billions) Population vs Connected Devices
People Connected Devices
@colinodellSource: https://www.cisco.com/c/dam/en_us/about/ac79/docs/innov/IoT_IBSG_0411FINAL.pdf
@colinodell
@colinodell
What We’ll Cover
• Device overview
• Four examples of combining IoT with PHP
 Project Goals
 Hardware & Platform Choice
 Building the device
 Demo*
• Q&A
@colinodell
DIY IoT Devices
For the software or hardware enthusiast
@colinodell
@colinodell
How to choose?
• Identify required features
• Ideal programming language
• Consider power requirements
• Size / footprint
@colinodell
Four Examples Using PHP
@colinodell
Uptime Monitor
Use Raspberry Pi to monitor if site is up; change LED color accordingly
@colinodell
Why Raspberry Pi?
• Internet connectivity
 Handles HTTPs out-of-the-box
• Runs Linux (Raspian – a derivative of Debian)
 PHP easily installed
• Has GPIO pins
• Raspberry Pi Zero only $5
• Why not?
@colinodell
Hardware
@colinodell
• Raspberry Pi (any variant)
• Micro USB cable (power)
• USB WiFi dongle
• Micro SD card
• RGB LED
• Two resistors
• Wires
RGB LEDs
@colinodell
Wiring
@colinodell
@colinodell
$ composer require piphp/gpio
@colinodell
<?php
const URL = 'https://www.colinodell.com';
const GPIO_PIN_GREEN = 12;
const GPIO_PIN_RED = 16;
require_once 'vendor/autoload.php';
$gpio = new PiPHPGPIOGPIO();
$greenLed = $gpio->getOutputPin(GPIO_PIN_GREEN);
$redLed = $gpio->getOutputPin(GPIO_PIN_RED);
$httpClient = new GuzzleHttpClient();
while (true) {
try {
$response = $httpClient->head(URL, [
'connect_timeout' => 3,
'timeout' => 3,
]);
echo URL . " is onlinen";
$greenLed->setValue(1);
$redLed->setValue(0);
} catch (RuntimeException $ex) {
echo URL . " is OFFLINE!n";
$greenLed->setValue(0);
$redLed->setValue(1);
}
sleep(3);
}
@colinodell
HTTP Server for
colinodell.com
Raspberry Pi
Terminal (SSH)
Live view of
colinodell.com
Recap
• PHP on a Raspberry Pi
• PHP checks if site is up
• PiPHP/GPIO library used to control output pins (LEDs)
Other uses for output pins:
• Control motors/servos
• Control relays (turn higher-voltage things on/off)
• Drive digital displays (LCD screens, LED number displays, etc.)
@colinodell
Conference Room
Occupancy Sensor
Raspberry Pi detects movement in room; sends room status to Slack
@colinodell
Why Raspberry Pi?
• Runs Linux (Raspian – a derivative of Debian)
• Has GPIO pins
• PHP easily installed
• Raspberry Pi Zero only $5
• Handles HTTPs out-of-the-box
• Why not?
@colinodell
TL;DR: Same reasons as before!
Hardware
@colinodell
• Raspberry Pi (any variant)
• Micro USB cable (power)
• USB WiFi dongle
• PIR Sensor
• Wires
PIR Sensors
@colinodellImages from https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview
Wiring
@colinodell
@colinodell
Signal
@colinodell
Motion Detected
Occupied Vacant Occupied
@colinodell
<?php
namespace ColinODellPHPIoTExamplesPHPPIRSensor;
class Room
{
/**
* @var bool
*/
private $occupied = false;
/**
* @var int
*/
private $lastMovement;
/**
* @var callable
*/
private $onRoomStateChange;
/**
* @var int
*/
private $roomEmptyTimeout;
/**
@colinodell
<?php
// Configuration:
const GPIO_PIN = 17;
const DECLARE_ROOM_EMPTY_AFTER = 60*5; // 5 minutes
const SLACK_INCOMING_WEBHOOK_URL = 'https://hooks.slack.com/services/xxxx/xxxx/xxxx';
// End configuration
require_once 'vendor/autoload.php';
use ColinODellPHPIoTExamplesPHPPIRSensorRoom;
use PiPHPGPIOGPIO;
use PiPHPGPIOPinInputPinInterface;
// HTTP client for communicating with Slack
$http = new GuzzleHttpClient();
// Instantiate a new room object to keep track of its state
$room = new Room();
$room->setRoomEmptyTimeout(DECLARE_ROOM_EMPTY_AFTER);
$room->setOnRoomChangeCallback(function($isOccupied) use ($http) {
$message = 'The conference room is now ' . ($isOccupied ? 'occupied.' : 'vacant.');
$http->postAsync(SLACK_INCOMING_WEBHOOK_URL, [
@colinodell
Recap
• PHP on a Raspberry Pi
• PiPHP/GPIO library monitors GPIO pin for signal changes
• PHP tracks duration between rising edges (low-to-high signal changes)
• Notifications pushed to Slack via webhook
Other uses for input pins:
• Switches & buttons
• Sensors (temperature, humidity, motion, accelerometer, GPS)
• Receiving data from other devices
@colinodell
Alexa Custom Skill
Use PHP + Laravel to handle request for ZendCon session information
@colinodell
@colinodell
Why Alexa / Amazon Echo?
• Amazon handles voice recognition
• Parsed request passed from Amazon to our API endpoint
• We handle accordingly; send formatted response for Alexa to read aloud
• Published skills easily installable
@colinodell
User Interaction Flow
@colinodellDiagram from https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/overviews/understanding-custom-skills
Invoking Custom Skills
• Ask [skill name] [action] Ask ZendCon which sessions are next
• Tell [skill name] [action] Tell ZendCon this talk is great
• [action] using [skill name] Rate this talk 5 stars using ZendCon
@colinodell
Actions
• What sessions are next?
• What session is next in {room}?
• What sessions are at {time} in {room}?
• Who is speaking in {room} {day} at {time}?
@colinodell
Defining Actions
GetSessions what sessions are next
GetSessions what talks are next
GetSessions who is talking next
GetSessions who is speaking next
GetSessions which sessions are next
GetSessions which talks are next
GetSessions what session is next in {room}
GetSessions what talk is next in {room}
GetSessions who is talking next in {room}
GetSessions who is speaking next in {room}
GetSessions which session is next in {room}
GetSessions which talk is next in {room}
GetSessions what sessions are at {time}
GetSessions what talks are at {time}
GetSessions who is talking at {time}
GetSessions who is speaking at {time}
GetSessions which sessions are at {time}
GetSessions which talks are at {time}
GetSessions what sessions are at {time} {day}
GetSessions what talks are at {time} {day}
GetSessions who is talking at {time} {day}
GetSessions who is speaking at {time} {day}
GetSessions which sessions are at {time} {day}
GetSessions which talks are at {time} {day}
GetSessions what session is in {room} at {time}
GetSessions what talk is in {room} at {time}
GetSessions who is talking in {room} at {time}
GetSessions who is speaking in {room} at {time}
GetSessions which session is in {room} at {time}
GetSessions which talk is in {room} at {time}
GetSessions what session is in {room} at {time} {day}
GetSessions what talk is in {room} at {time} {day}
GetSessions who is talking in {room} at {time} {day}
GetSessions who is speaking in {room} at {time} {day}
GetSessions which session is in {room} at {time} {day}
GetSessions which talk is in {room} at {time} {day}
GetSessions what session is {day} in {room} at {time}
GetSessions what talk is {day} in {room} at {time}
GetSessions who is talking {day} in {room} at {time}
GetSessions who is speaking {day} in {room} at {time}
GetSessions which session {day} is in {room} at {time}
GetSessions which talk {day} is in {room} at {time}
@colinodell
Intent Schema
@colinodell
{
"intents": [
{
"intent": "GetSessions",
"slots": [
{
"name": "day",
"type": "AMAZON.DATE"
},
{
"name": "time",
"type": "AMAZON.TIME"
},
{
"name": "room",
"type": "ROOM"
}
]
},
{
"intent": "AMAZON.HelpIntent"
}
]
}
The Joint
Artist C
Artist D
Artist E
Artist F
Artist G
Artist H
@colinodell
$ composer require develpr/alexa-app
AlexaRoute::intent('/alexa-end-point', 'GetDeveloperJoke', function(){
Alexa::say("A SQL query goes into a bar, walks up to two tables and asks, "Can I join you?"");
});
@colinodell
// TODO: Import schedule to MySQL database
@colinodell
<?php
namespace AppHttpControllers;
use CarbonCarbon;
use DevelprAlexaAppFacadesAlexa;
use DevelprAlexaAppRequestAlexaRequest;
use IlluminateDatabaseQueryBuilder;
use IlluminateSupportFacadesDB;
class SessionController extends Controller
{
public function getSessions(AlexaRequest $request)
{
$request->getIntent();
$time = $request->slot('time') ?: Carbon::now()->format('G:i');
$day = $request->slot('day') ?: Carbon::now()->format('Y-m-d');
$room = $request->slot('room');
try {
$sessions = $this->findSessions($time, $day, $room);
if (count($sessions) === 0) {
// No sessions found
return Alexa::say('Sorry, I couldn't find any sessions on ' . $day . ' at ' . $time)->endSession();
} elseif (count($sessions) === 1) {
return Alexa::say($this->getSessionText(reset($sessions)))->endSession();;
} else {
$text = 'I found ' . count($sessions) . ' sessions. ';
foreach ($sessions as $session) {
@colinodell
<?php
// app/Http/routes.php
AlexaRoute::intent('/alexa', 'GetSessions', 'AppHttpControllersSessionController@getSessions');
Recap
• Alexa parses voice request; passes to PHP
• Laravel application handles requests; returns response
• Alexa renders responses as voice and/or cards
Other uses for Alexa:
• Querying for information
• Interactive sessions (online ordering, games, etc.)
• Home automation
@colinodell
Packagist Download Counter
Displaying downloads counts from the Packagist API with Particle Photon
@colinodell
Particle Photon
@colinodell
• WiFi built in
• Small footprint
• Can be powered via MicroUSB
• Enough digital GPIO pins
• Programmable via web-based IDE
• OTA flashing
• Built-in webhook support
Hardware
@colinodell
• Particle Photon
• MAX7219 8-Digit Red LED Display Module
• Micro USB cable (power)
• Wires
MAX7219 8-Digit Red LED Display Module
@colinodellImages from https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview
Wiring
@colinodell
@colinodell
@colinodell
@colinodell
Problem!
• JSON document is 32.5 KB
• Photon webhook responses are 512-byte chunks spaced 250ms apart
@colinodell
Problem!
• JSON document is 32.5 KB
• Photon webhook responses are 512-byte chunks spaced 250ms apart
@colinodell
Solution!
• Use Yahoo YQL to reduce response size
Problem!
• JSON document is 32.5 KB
• Photon webhook responses are 512-byte chunks spaced 250ms apart
@colinodell
Solution!
• Use Yahoo YQL to reduce response size
• Use PHP to parse JSON, return just one number
packagist-counter.php
@colinodell
<?php
const URL = 'https://packagist.org/packages/league/commonmark.json';
$json = json_decode(file_get_contents(URL), true);
header('Content-Type: text/plain');
echo $json['package']['downloads']['total'];
@colinodell
@colinodell
@colinodell
@colinodell
Recap
• Particle Photon + 8 digit LED display
• Particle webhook fetches data from packagist-counter.php
• packagist-counter.php fetches from packagist.org; trims out the fat
@colinodell
Summary
@colinodell
Summary
• IoT is everywhere!
• PHP can bridge the gap
• Run PHP:
 On the device (RasPi examples)
 In “the cloud” (Alexa; Particle Photon)
 Or both!
• Anyone can build web-connected devices
@colinodell
Please leave feedback on Joind.in!
Questions?
Project Source Code / Documentation:
https://github.com/colinodell/php-iot-examples
Even More Projects:
https://www.hackster.io
Building Robots with PHP:
Christopher Pitt @ The Joint (next session)
@colinodell
Please leave feedback on Joind.in!

More Related Content

What's hot

effective_r27
effective_r27effective_r27
effective_r27
Hiroshi Ono
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
Filip Ekberg
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
C# 6.0 - What?! C# is being updated?
C# 6.0 - What?! C# is being updated?C# 6.0 - What?! C# is being updated?
C# 6.0 - What?! C# is being updated?
Filip Ekberg
 
Drinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of ResilienceDrinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of Resilience
C4Media
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworks
kenbot
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl Programmer
John Anderson
 
Perl in the Internet of Things
Perl in the Internet of ThingsPerl in the Internet of Things
Perl in the Internet of Things
Dave Cross
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
Daniel Bohannon
 
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShellPesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
Daniel Bohannon
 
Le PERL est mort
Le PERL est mortLe PERL est mort
Le PERL est mort
apeiron
 
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
Codemotion
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)
Chris Tankersley
 
DevSec Defense
DevSec DefenseDevSec Defense
DevSec Defense
Daniel Bohannon
 
An introduction to git
An introduction to gitAn introduction to git
An introduction to git
olberger
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018
Chris Tankersley
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Else
mckern
 
PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25
David Fetter
 
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Daniel Bohannon
 

What's hot (20)

effective_r27
effective_r27effective_r27
effective_r27
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
C# 6.0 - What?! C# is being updated?
C# 6.0 - What?! C# is being updated?C# 6.0 - What?! C# is being updated?
C# 6.0 - What?! C# is being updated?
 
Drinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of ResilienceDrinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of Resilience
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworks
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl Programmer
 
Perl in the Internet of Things
Perl in the Internet of ThingsPerl in the Internet of Things
Perl in the Internet of Things
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShellPesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
 
Le PERL est mort
Le PERL est mortLe PERL est mort
Le PERL est mort
 
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)
 
DevSec Defense
DevSec DefenseDevSec Defense
DevSec Defense
 
An introduction to git
An introduction to gitAn introduction to git
An introduction to git
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Else
 
PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25
 
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
 

Similar to Rise of the Machines: PHP and IoT - ZendCon 2017

PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the Cloud
ZendCon
 
All a flutter about Flutter.io
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
Steven Cooper
 
How Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build HerokuHow Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build Heroku
Craig Kerstiens
 
Aio...whatever
Aio...whateverAio...whatever
Aio...whatever
Steve Genoud
 
Work Queues
Work QueuesWork Queues
Work Queues
ciconf
 
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Rif Kiamil
 
R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
Niels Ole Dam
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniter
Erik Giberti
 
Drilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache DrillDrilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache Drill
Charles Givre
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.js
Shoaib Burq
 
About Clack
About ClackAbout Clack
About Clack
fukamachi
 
SOTR 2012
SOTR 2012SOTR 2012
SOTR 2012
Steven Peeters
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
Lindsay Holmwood
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace Way
Phil Wilkins
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
darrelmiller71
 
Scotch On The Rocks 2011
Scotch On The Rocks 2011Scotch On The Rocks 2011
Scotch On The Rocks 2011
Steven Peeters
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
Elizabeth Smith
 
Future of PHP
Future of PHPFuture of PHP
Future of PHP
Richard McIntyre
 
Reactive programming with RxJS - Taiwan
Reactive programming with RxJS - TaiwanReactive programming with RxJS - Taiwan
Reactive programming with RxJS - Taiwan
modernweb
 
Deploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero DowntimeDeploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero Downtime
Twilio Inc
 

Similar to Rise of the Machines: PHP and IoT - ZendCon 2017 (20)

PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the Cloud
 
All a flutter about Flutter.io
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
 
How Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build HerokuHow Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build Heroku
 
Aio...whatever
Aio...whateverAio...whatever
Aio...whatever
 
Work Queues
Work QueuesWork Queues
Work Queues
 
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
 
R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniter
 
Drilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache DrillDrilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache Drill
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.js
 
About Clack
About ClackAbout Clack
About Clack
 
SOTR 2012
SOTR 2012SOTR 2012
SOTR 2012
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace Way
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Scotch On The Rocks 2011
Scotch On The Rocks 2011Scotch On The Rocks 2011
Scotch On The Rocks 2011
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
Future of PHP
Future of PHPFuture of PHP
Future of PHP
 
Reactive programming with RxJS - Taiwan
Reactive programming with RxJS - TaiwanReactive programming with RxJS - Taiwan
Reactive programming with RxJS - Taiwan
 
Deploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero DowntimeDeploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero Downtime
 

More from Colin O'Dell

Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021
Colin O'Dell
 
Releasing High Quality Packages - Longhorn PHP 2021
Releasing High Quality Packages - Longhorn PHP 2021Releasing High Quality Packages - Longhorn PHP 2021
Releasing High Quality Packages - Longhorn PHP 2021
Colin O'Dell
 
Releasing High Quality PHP Packages - ConFoo Montreal 2019
Releasing High Quality PHP Packages - ConFoo Montreal 2019Releasing High Quality PHP Packages - ConFoo Montreal 2019
Releasing High Quality PHP Packages - ConFoo Montreal 2019
Colin O'Dell
 
Debugging Effectively - ConFoo Montreal 2019
Debugging Effectively - ConFoo Montreal 2019Debugging Effectively - ConFoo Montreal 2019
Debugging Effectively - ConFoo Montreal 2019
Colin O'Dell
 
Automating Deployments with Deployer - php[world] 2018
Automating Deployments with Deployer - php[world] 2018Automating Deployments with Deployer - php[world] 2018
Automating Deployments with Deployer - php[world] 2018
Colin O'Dell
 
Releasing High-Quality Packages - php[world] 2018
Releasing High-Quality Packages - php[world] 2018Releasing High-Quality Packages - php[world] 2018
Releasing High-Quality Packages - php[world] 2018
Colin O'Dell
 
Debugging Effectively - DrupalCon Nashville 2018
Debugging Effectively - DrupalCon Nashville 2018Debugging Effectively - DrupalCon Nashville 2018
Debugging Effectively - DrupalCon Nashville 2018
Colin O'Dell
 
CommonMark: Markdown Done Right - ZendCon 2017
CommonMark: Markdown Done Right - ZendCon 2017CommonMark: Markdown Done Right - ZendCon 2017
CommonMark: Markdown Done Right - ZendCon 2017
Colin O'Dell
 
Debugging Effectively - All Things Open 2017
Debugging Effectively - All Things Open 2017Debugging Effectively - All Things Open 2017
Debugging Effectively - All Things Open 2017
Colin O'Dell
 
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Colin O'Dell
 
Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017
Colin O'Dell
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
Colin O'Dell
 
Debugging Effectively - ZendCon 2016
Debugging Effectively - ZendCon 2016Debugging Effectively - ZendCon 2016
Debugging Effectively - ZendCon 2016
Colin O'Dell
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016
Colin O'Dell
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
Colin O'Dell
 
Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016
Colin O'Dell
 
CommonMark: Markdown done right - Nomad PHP September 2016
CommonMark: Markdown done right - Nomad PHP September 2016CommonMark: Markdown done right - Nomad PHP September 2016
CommonMark: Markdown done right - Nomad PHP September 2016
Colin O'Dell
 
Debugging Effectively - Frederick Web Tech 9/6/16
Debugging Effectively - Frederick Web Tech 9/6/16Debugging Effectively - Frederick Web Tech 9/6/16
Debugging Effectively - Frederick Web Tech 9/6/16
Colin O'Dell
 
Debugging Effectively
Debugging EffectivelyDebugging Effectively
Debugging Effectively
Colin O'Dell
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
 

More from Colin O'Dell (20)

Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021
 
Releasing High Quality Packages - Longhorn PHP 2021
Releasing High Quality Packages - Longhorn PHP 2021Releasing High Quality Packages - Longhorn PHP 2021
Releasing High Quality Packages - Longhorn PHP 2021
 
Releasing High Quality PHP Packages - ConFoo Montreal 2019
Releasing High Quality PHP Packages - ConFoo Montreal 2019Releasing High Quality PHP Packages - ConFoo Montreal 2019
Releasing High Quality PHP Packages - ConFoo Montreal 2019
 
Debugging Effectively - ConFoo Montreal 2019
Debugging Effectively - ConFoo Montreal 2019Debugging Effectively - ConFoo Montreal 2019
Debugging Effectively - ConFoo Montreal 2019
 
Automating Deployments with Deployer - php[world] 2018
Automating Deployments with Deployer - php[world] 2018Automating Deployments with Deployer - php[world] 2018
Automating Deployments with Deployer - php[world] 2018
 
Releasing High-Quality Packages - php[world] 2018
Releasing High-Quality Packages - php[world] 2018Releasing High-Quality Packages - php[world] 2018
Releasing High-Quality Packages - php[world] 2018
 
Debugging Effectively - DrupalCon Nashville 2018
Debugging Effectively - DrupalCon Nashville 2018Debugging Effectively - DrupalCon Nashville 2018
Debugging Effectively - DrupalCon Nashville 2018
 
CommonMark: Markdown Done Right - ZendCon 2017
CommonMark: Markdown Done Right - ZendCon 2017CommonMark: Markdown Done Right - ZendCon 2017
CommonMark: Markdown Done Right - ZendCon 2017
 
Debugging Effectively - All Things Open 2017
Debugging Effectively - All Things Open 2017Debugging Effectively - All Things Open 2017
Debugging Effectively - All Things Open 2017
 
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
 
Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
 
Debugging Effectively - ZendCon 2016
Debugging Effectively - ZendCon 2016Debugging Effectively - ZendCon 2016
Debugging Effectively - ZendCon 2016
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
 
Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016
 
CommonMark: Markdown done right - Nomad PHP September 2016
CommonMark: Markdown done right - Nomad PHP September 2016CommonMark: Markdown done right - Nomad PHP September 2016
CommonMark: Markdown done right - Nomad PHP September 2016
 
Debugging Effectively - Frederick Web Tech 9/6/16
Debugging Effectively - Frederick Web Tech 9/6/16Debugging Effectively - Frederick Web Tech 9/6/16
Debugging Effectively - Frederick Web Tech 9/6/16
 
Debugging Effectively
Debugging EffectivelyDebugging Effectively
Debugging Effectively
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
 

Recently uploaded

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 

Recently uploaded (20)

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 

Rise of the Machines: PHP and IoT - ZendCon 2017

  • 1. Rise of the Machines: PHP & IoT @colinodell
  • 2. Colin O’Dell • Lead Web Developer at Unleashed Technologies • PHP League Leadership Team • Baltimore PHP Co-Organizer • Arduino & Raspberry Pi Enthusiast @colinodell
  • 3. Goals • Introduce the basics of building custom IoT devices • Understand where web technologies fit in • Four real-world example projects @colinodell
  • 4. Internet of Things The Internet of Things is the internetworking of physical devices, vehicles, buildings and other items—embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data. - https://en.wikipedia.org/wiki/Internet_of_things @colinodell
  • 5. Internet of Things The Internet of Things is the internetworking of physical devices, vehicles, buildings and other items—embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data. - https://en.wikipedia.org/wiki/Internet_of_things @colinodell
  • 6. Connectivity • Ethernet / WiFi • NFC / RFID • Bluetooth LE • Zigbee / Z-Wave • Cellular (LTE / CDMA / GSM) • …and many others @colinodell
  • 7. 0 10 20 30 40 50 60 2003 2010 2015 2020 (Billions) Population vs Connected Devices People Connected Devices @colinodellSource: https://www.cisco.com/c/dam/en_us/about/ac79/docs/innov/IoT_IBSG_0411FINAL.pdf
  • 10. What We’ll Cover • Device overview • Four examples of combining IoT with PHP  Project Goals  Hardware & Platform Choice  Building the device  Demo* • Q&A @colinodell
  • 11. DIY IoT Devices For the software or hardware enthusiast @colinodell
  • 13. How to choose? • Identify required features • Ideal programming language • Consider power requirements • Size / footprint @colinodell
  • 14. Four Examples Using PHP @colinodell
  • 15. Uptime Monitor Use Raspberry Pi to monitor if site is up; change LED color accordingly @colinodell
  • 16. Why Raspberry Pi? • Internet connectivity  Handles HTTPs out-of-the-box • Runs Linux (Raspian – a derivative of Debian)  PHP easily installed • Has GPIO pins • Raspberry Pi Zero only $5 • Why not? @colinodell
  • 17. Hardware @colinodell • Raspberry Pi (any variant) • Micro USB cable (power) • USB WiFi dongle • Micro SD card • RGB LED • Two resistors • Wires
  • 21. @colinodell <?php const URL = 'https://www.colinodell.com'; const GPIO_PIN_GREEN = 12; const GPIO_PIN_RED = 16; require_once 'vendor/autoload.php'; $gpio = new PiPHPGPIOGPIO(); $greenLed = $gpio->getOutputPin(GPIO_PIN_GREEN); $redLed = $gpio->getOutputPin(GPIO_PIN_RED); $httpClient = new GuzzleHttpClient(); while (true) { try { $response = $httpClient->head(URL, [ 'connect_timeout' => 3, 'timeout' => 3, ]); echo URL . " is onlinen"; $greenLed->setValue(1); $redLed->setValue(0); } catch (RuntimeException $ex) { echo URL . " is OFFLINE!n"; $greenLed->setValue(0); $redLed->setValue(1); } sleep(3); }
  • 22. @colinodell HTTP Server for colinodell.com Raspberry Pi Terminal (SSH) Live view of colinodell.com
  • 23. Recap • PHP on a Raspberry Pi • PHP checks if site is up • PiPHP/GPIO library used to control output pins (LEDs) Other uses for output pins: • Control motors/servos • Control relays (turn higher-voltage things on/off) • Drive digital displays (LCD screens, LED number displays, etc.) @colinodell
  • 24. Conference Room Occupancy Sensor Raspberry Pi detects movement in room; sends room status to Slack @colinodell
  • 25. Why Raspberry Pi? • Runs Linux (Raspian – a derivative of Debian) • Has GPIO pins • PHP easily installed • Raspberry Pi Zero only $5 • Handles HTTPs out-of-the-box • Why not? @colinodell TL;DR: Same reasons as before!
  • 26. Hardware @colinodell • Raspberry Pi (any variant) • Micro USB cable (power) • USB WiFi dongle • PIR Sensor • Wires
  • 27. PIR Sensors @colinodellImages from https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview
  • 31. @colinodell <?php namespace ColinODellPHPIoTExamplesPHPPIRSensor; class Room { /** * @var bool */ private $occupied = false; /** * @var int */ private $lastMovement; /** * @var callable */ private $onRoomStateChange; /** * @var int */ private $roomEmptyTimeout; /**
  • 32. @colinodell <?php // Configuration: const GPIO_PIN = 17; const DECLARE_ROOM_EMPTY_AFTER = 60*5; // 5 minutes const SLACK_INCOMING_WEBHOOK_URL = 'https://hooks.slack.com/services/xxxx/xxxx/xxxx'; // End configuration require_once 'vendor/autoload.php'; use ColinODellPHPIoTExamplesPHPPIRSensorRoom; use PiPHPGPIOGPIO; use PiPHPGPIOPinInputPinInterface; // HTTP client for communicating with Slack $http = new GuzzleHttpClient(); // Instantiate a new room object to keep track of its state $room = new Room(); $room->setRoomEmptyTimeout(DECLARE_ROOM_EMPTY_AFTER); $room->setOnRoomChangeCallback(function($isOccupied) use ($http) { $message = 'The conference room is now ' . ($isOccupied ? 'occupied.' : 'vacant.'); $http->postAsync(SLACK_INCOMING_WEBHOOK_URL, [
  • 34. Recap • PHP on a Raspberry Pi • PiPHP/GPIO library monitors GPIO pin for signal changes • PHP tracks duration between rising edges (low-to-high signal changes) • Notifications pushed to Slack via webhook Other uses for input pins: • Switches & buttons • Sensors (temperature, humidity, motion, accelerometer, GPS) • Receiving data from other devices @colinodell
  • 35. Alexa Custom Skill Use PHP + Laravel to handle request for ZendCon session information @colinodell
  • 37. Why Alexa / Amazon Echo? • Amazon handles voice recognition • Parsed request passed from Amazon to our API endpoint • We handle accordingly; send formatted response for Alexa to read aloud • Published skills easily installable @colinodell
  • 38. User Interaction Flow @colinodellDiagram from https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/overviews/understanding-custom-skills
  • 39. Invoking Custom Skills • Ask [skill name] [action] Ask ZendCon which sessions are next • Tell [skill name] [action] Tell ZendCon this talk is great • [action] using [skill name] Rate this talk 5 stars using ZendCon @colinodell
  • 40. Actions • What sessions are next? • What session is next in {room}? • What sessions are at {time} in {room}? • Who is speaking in {room} {day} at {time}? @colinodell
  • 41. Defining Actions GetSessions what sessions are next GetSessions what talks are next GetSessions who is talking next GetSessions who is speaking next GetSessions which sessions are next GetSessions which talks are next GetSessions what session is next in {room} GetSessions what talk is next in {room} GetSessions who is talking next in {room} GetSessions who is speaking next in {room} GetSessions which session is next in {room} GetSessions which talk is next in {room} GetSessions what sessions are at {time} GetSessions what talks are at {time} GetSessions who is talking at {time} GetSessions who is speaking at {time} GetSessions which sessions are at {time} GetSessions which talks are at {time} GetSessions what sessions are at {time} {day} GetSessions what talks are at {time} {day} GetSessions who is talking at {time} {day} GetSessions who is speaking at {time} {day} GetSessions which sessions are at {time} {day} GetSessions which talks are at {time} {day} GetSessions what session is in {room} at {time} GetSessions what talk is in {room} at {time} GetSessions who is talking in {room} at {time} GetSessions who is speaking in {room} at {time} GetSessions which session is in {room} at {time} GetSessions which talk is in {room} at {time} GetSessions what session is in {room} at {time} {day} GetSessions what talk is in {room} at {time} {day} GetSessions who is talking in {room} at {time} {day} GetSessions who is speaking in {room} at {time} {day} GetSessions which session is in {room} at {time} {day} GetSessions which talk is in {room} at {time} {day} GetSessions what session is {day} in {room} at {time} GetSessions what talk is {day} in {room} at {time} GetSessions who is talking {day} in {room} at {time} GetSessions who is speaking {day} in {room} at {time} GetSessions which session {day} is in {room} at {time} GetSessions which talk {day} is in {room} at {time} @colinodell
  • 42. Intent Schema @colinodell { "intents": [ { "intent": "GetSessions", "slots": [ { "name": "day", "type": "AMAZON.DATE" }, { "name": "time", "type": "AMAZON.TIME" }, { "name": "room", "type": "ROOM" } ] }, { "intent": "AMAZON.HelpIntent" } ] } The Joint Artist C Artist D Artist E Artist F Artist G Artist H
  • 43. @colinodell $ composer require develpr/alexa-app AlexaRoute::intent('/alexa-end-point', 'GetDeveloperJoke', function(){ Alexa::say("A SQL query goes into a bar, walks up to two tables and asks, "Can I join you?""); });
  • 44. @colinodell // TODO: Import schedule to MySQL database
  • 45. @colinodell <?php namespace AppHttpControllers; use CarbonCarbon; use DevelprAlexaAppFacadesAlexa; use DevelprAlexaAppRequestAlexaRequest; use IlluminateDatabaseQueryBuilder; use IlluminateSupportFacadesDB; class SessionController extends Controller { public function getSessions(AlexaRequest $request) { $request->getIntent(); $time = $request->slot('time') ?: Carbon::now()->format('G:i'); $day = $request->slot('day') ?: Carbon::now()->format('Y-m-d'); $room = $request->slot('room'); try { $sessions = $this->findSessions($time, $day, $room); if (count($sessions) === 0) { // No sessions found return Alexa::say('Sorry, I couldn't find any sessions on ' . $day . ' at ' . $time)->endSession(); } elseif (count($sessions) === 1) { return Alexa::say($this->getSessionText(reset($sessions)))->endSession();; } else { $text = 'I found ' . count($sessions) . ' sessions. '; foreach ($sessions as $session) {
  • 47. Recap • Alexa parses voice request; passes to PHP • Laravel application handles requests; returns response • Alexa renders responses as voice and/or cards Other uses for Alexa: • Querying for information • Interactive sessions (online ordering, games, etc.) • Home automation @colinodell
  • 48. Packagist Download Counter Displaying downloads counts from the Packagist API with Particle Photon @colinodell
  • 49. Particle Photon @colinodell • WiFi built in • Small footprint • Can be powered via MicroUSB • Enough digital GPIO pins • Programmable via web-based IDE • OTA flashing • Built-in webhook support
  • 50. Hardware @colinodell • Particle Photon • MAX7219 8-Digit Red LED Display Module • Micro USB cable (power) • Wires
  • 51. MAX7219 8-Digit Red LED Display Module @colinodellImages from https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview
  • 56. Problem! • JSON document is 32.5 KB • Photon webhook responses are 512-byte chunks spaced 250ms apart @colinodell
  • 57. Problem! • JSON document is 32.5 KB • Photon webhook responses are 512-byte chunks spaced 250ms apart @colinodell Solution! • Use Yahoo YQL to reduce response size
  • 58. Problem! • JSON document is 32.5 KB • Photon webhook responses are 512-byte chunks spaced 250ms apart @colinodell Solution! • Use Yahoo YQL to reduce response size • Use PHP to parse JSON, return just one number
  • 59. packagist-counter.php @colinodell <?php const URL = 'https://packagist.org/packages/league/commonmark.json'; $json = json_decode(file_get_contents(URL), true); header('Content-Type: text/plain'); echo $json['package']['downloads']['total'];
  • 64. Recap • Particle Photon + 8 digit LED display • Particle webhook fetches data from packagist-counter.php • packagist-counter.php fetches from packagist.org; trims out the fat @colinodell
  • 66. Summary • IoT is everywhere! • PHP can bridge the gap • Run PHP:  On the device (RasPi examples)  In “the cloud” (Alexa; Particle Photon)  Or both! • Anyone can build web-connected devices @colinodell Please leave feedback on Joind.in!
  • 67. Questions? Project Source Code / Documentation: https://github.com/colinodell/php-iot-examples Even More Projects: https://www.hackster.io Building Robots with PHP: Christopher Pitt @ The Joint (next session) @colinodell Please leave feedback on Joind.in!