SlideShare a Scribd company logo
Full Stack Meat Project
‘GrillLog’
Kevin Kazmierczak
What are we talking about?
Creating a custom built dual probe BBQ
thermometer instead of buying one
Motivation
● Learn Arduino and basic electronics
● Be able to see grill temperatures on my devices
● Get notified when it was ready
● Learn AWS
● I thought it’d be similar in cost...
About Me
● http://www.kevinkaz.com
● @kazmiekr
● Solutions Architect for Universal Mind
● Two Alexa skills published
○ TechBuzz - MBTA Alerts
● 4 Apple Apps - Download them!
Taptronome FuelMate Battle Pet
Galaxy
MadBombz
Demo
Version 1
● Built using Parse :(
● Wifi using ESP8266
● Old blog article
Overview
● Arduino
● AWS IoT
● Lambda
● DynamoDB
● API Gateway
● SNS
● Alexa
● iOS
● Web
● Android
Warning
I am not an expert in any of this. Please feel free to add additional
context or information as needed.
Architecture Overview
Arduino Basics
● 14 Digital I/O Pins ( 6 PWM )
● 6 Analog
● 5V
● Embedded code written in C/C++ as a ‘Sketch’
Arduino Yun
● Device details
○ Built in wifi
○ Two processors, traditional ATmega and AR9331 (Linux)
○ Linux processor handles all the more CPU intensive tasks ( wifi / data processing )
○ ATmega handles reading/writing outputs
● How does it compare to others?
● Could you replace this with a RPi?
Fritzing Circuit Diagram
Learn more about Fritzing
GrillLog Implementation
● Every 10 seconds the device reads two
analog inputs
● Using a Steinhart–Hart equation, it
converts the analog resistance to
temperature
● Equation coefficients calibrated by
taking 3 different temperatures and
plugged into an online calculator
● Current readings are dumped to Serial
and the LCD display
AWS Fine Print
● Sign up for a free tier trial account
● One year of free tier account services
● Some of the core services have very generous free limits even
without a trial account
● Pay for what you use
● Security
○ Ensure that there are roles setup that have access to execute the pieces of the
different services
AWS IoT
● Allows device to communicate over MQTT with encrypted traffic
● MQTT - Lightweight messaging protocol, think JMS or Pub/Sub
● Each device gets a signed certificate to use with messaging
● Devices can have shadows for offline sync
● Compatible devices - Anything that can do secure MQTT
● Use command line mosquitto to simulate device messaging
AWS IoT
AWS IoT Rules
● Rules can filter messages into different channels
● SQL query like syntax to set them up
● Use built in actions
● Lambda is most flexible action
GrillLog Implementation
● Yun has certificates installed
● Yun constructs JSON document of
temps
● Yun posts message on ‘templogs’ topic
● AWS has a rule that all incoming
‘templog’ messages are forwarded to a
lambda function
● Tweaked AWS config to solve memory
issues
AWS Lambda
● Runs code in response to events
● Pay for what you consume
● Develop in Javascript/Java/Python
● No servers to manage or scale
● Core service used to integrate across AWS
● Pricing
○ First 1 million requests per month are free
○ $0.20 per 1 million requests thereafter ($0.0000002 per request)
Lamba Basics
● Can start from one of their many templates
○ Language specific
○ Voice templates
○ Microservices
○ Hello world
● Export a ‘handler’ that takes and event, context, callback
● Do whatever
exports.handler = function(event, context, callback) {
console.log("value1 = " + event.key1);
console.log("value2 = " + event.key2);
callback(null, "some success message");
// or
// callback("some error type");
}
GrillLog Implementation
● Three lambda functions
○ Handle incoming IoT messages
○ Handle web requests
○ Handle voice requests
● All three lambdas just forward
into a custom
controller/service layer written
in Node.js
Custom Service Layer
● AWS supports Node 4.3 (finally!!!)
○ ES2016 (ES6) features
■ Promises/arrow functions/etc - check for support before using
● Controller processes input and utilizes services needed
○ Could swap out service implementations later if needed
● Promise based - AWS sdk methods can return a promise
● Easy to test via command line locally
● Use any packages you need via npm
● Service layer gets packaged with lambda
GrillLog Implementation
● Utilizes the aws-sdk package
● Deployed via shell script
○ Creates a zip file of required files
○ Calls AWS specific CLI tooling
○ Cleans up
● Uploads a zip per each lambda
endpoint
AWS DynamoDB
● NoSQL database similar to MongoDB
○ Schema-less
● Event driven hooks
● Easy to save data, not as easy to query
● Integration with other AWS services with streams/triggers
● Pricing
○ 25 GB in free tier, pay per usage
○ “For a little less than $0.25/day ($7.50/month), you could support an application
that performs 1 million writes and reads per day”
DynamoDB Basics
● Each table has a primary key (hash key) - Most unique
● Optional sort key - What will I most likely sort on?
● Get data out via either a ‘scan’ or ‘query’
○ ‘query’ requires primary key then you add filter criteria
● Indexes are required to speed up queries
● Sorting is tricky
● No date datatype, have to use a timestamp number
● Save whatever!
GrillLog Implementation
● Contains 3 tables
○ DeviceStatus
■ Current status information per device
○ TempLogs
■ Raw temp data from device
○ CookLogs
■ Archived cook data
AWS SNS - Simple Notification Service
● Pub-sub messaging
● Deliver across multiple protocols
○ iOS/Android
○ Email
○ SMS
● Hooks into other services
● Pricing
○ Your first 1 million push requests are free
○ $0.50 per 1 million Amazon SNS requests thereafter.
SNS Basics
● Create platform application
○ Need certificates to handle push integration with Apple/Google
● Devices can register to application with token
● Messages can be sent to the endpoints registered
● Raw or JSON
● Can tie multiple endpoints together via subscriptions
○ Topic could post to email and push together
● Push messages via AWS dashboard
GrillLog Implementation
● Devices are manually registered with
device token on dashboard
● Application endpoint created with
Apple push certificates from iTunes
provisioning portal
● Custom services push JSON formatted
messages for Apple devices
AWS API Gateway
● Deploy a customized API
● Define the resources that can be called
● SDK generation
● Authentication - keys, IAM, CORS
● Pricing
○ Free tier includes one million API calls per month for up to 12 months
○ $3.50 per million API calls received, plus the cost of data transfer out, in gigabytes.
API Gateway Basics
● You can create an API endpoint from the lambda ‘API endpoints’ tab
● Create resources as endpoints like
○ /status or /logs
● Add methods to those resources
○ GET/POST/PUT
● Point those endpoints to a lambda or proxy
● Configure the mappings - How will data pass through
● Customize as needed
● Create multiple ‘stages’ that you can deploy to
GrillLog Implementation
● Exposes REST endpoints
○ status/logs/startgrill/startcook/endgrill
● CORS enabled on status/logs for web
● Mobile clients handle state movement
● Entire request information is
forwarded to a lambda
● Lambda determines what the URL
should do and call proper controller
method in custom services
Alexa Integration
● Registered skill on amazon developer site
● Forward to lambda or custom deployed services (HTTPS)
● Register intents ( voice input formats )
● Deploy to app store - Requires approval
○ They are VERY strict that you follow the guidelines
○ You could get a free t-shirt
● Test on developer site
○ Lets you hear responses and see source JSON
● Detailed skill creation walkthrough
Alexa Skill Configuration
UtterancesIntents
GrillLog Implementation
● Registered skill forwarding to lambda
● Simple ‘what’s the status’ intent
● Calls into custom services to grab
current status
● Converts response into a text string
passed back to voice services
Logging
● Configure services to write CloudWatch logs
● Add alerts if needed
iOS Application
● Apple developer account - $99
○ Be able to deploy to devices and provision
● Configured app in iTunes connect
● Generate APNS certs imported to SNS
● Written in Swift
● Polls for temp status every 10 sec
● Regenerates chart every 30 sec
● Uses ‘Charts’ project for charting
● Sends push notifications
○ Warm temperature threshold
○ Food temperature
● Background fetch to detect offline situations
Web Application
● Deployed on http://grilllog.kevinkaz.com
● Written in ES2016 transpiled in webpack
● Uses D3 to handle charting
● Uses a fetch polyfill
● Styling done in Less
Android Application
● Written by coworker, Chris Scott
● Mortar and Flow for view lifecycles
● Dagger for dependency injection
● RxJava and Retrofit for service integration
Future Plans
● PID Controller for fan controlled temperature
control
● Apple Watch Complication
● Waterproof case
● More notifications
● Review past cooks
● Archive condensed logs
Questions

More Related Content

What's hot

Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
aspyker
 
AWS temporary credentials challenges in prevention detection mitigation
AWS temporary credentials   challenges in prevention detection mitigationAWS temporary credentials   challenges in prevention detection mitigation
AWS temporary credentials challenges in prevention detection mitigation
John Varghese
 
NetflixOSS Meetup S6E2 - Spinnaker, Kayenta
NetflixOSS Meetup S6E2 - Spinnaker, KayentaNetflixOSS Meetup S6E2 - Spinnaker, Kayenta
NetflixOSS Meetup S6E2 - Spinnaker, Kayenta
aspyker
 
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Lucas Jellema
 
NetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & ContainersNetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & Containers
aspyker
 
Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...
Luciano Mammino
 
REAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKEREAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKE
Rolando Carrasco
 
End-to-end test automation with Endtest.dev
End-to-end test automation with Endtest.devEnd-to-end test automation with Endtest.dev
End-to-end test automation with Endtest.dev
Konstantin Tarkus
 
CMP376 - Another Week, Another Million Containers on Amazon EC2
CMP376 - Another Week, Another Million Containers on Amazon EC2CMP376 - Another Week, Another Million Containers on Amazon EC2
CMP376 - Another Week, Another Million Containers on Amazon EC2
aspyker
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3
Ruslan Meshenberg
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
aspyker
 
CS80A Foothill College Open Source Talk
CS80A Foothill College Open Source TalkCS80A Foothill College Open Source Talk
CS80A Foothill College Open Source Talk
aspyker
 
Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1
aspyker
 
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric LippmannIcinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga
 
DCEU 18: From Monolith to Microservices
DCEU 18: From Monolith to MicroservicesDCEU 18: From Monolith to Microservices
DCEU 18: From Monolith to Microservices
Docker, Inc.
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
Docker, Inc.
 
Terrascan - Cloud Native Security Tool
Terrascan - Cloud Native Security Tool Terrascan - Cloud Native Security Tool
Terrascan - Cloud Native Security Tool
sangam biradar
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
aspyker
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
Ruslan Meshenberg
 
Serverless Architectures
Serverless ArchitecturesServerless Architectures
Serverless Architectures
Lynn Langit
 

What's hot (20)

Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
AWS temporary credentials challenges in prevention detection mitigation
AWS temporary credentials   challenges in prevention detection mitigationAWS temporary credentials   challenges in prevention detection mitigation
AWS temporary credentials challenges in prevention detection mitigation
 
NetflixOSS Meetup S6E2 - Spinnaker, Kayenta
NetflixOSS Meetup S6E2 - Spinnaker, KayentaNetflixOSS Meetup S6E2 - Spinnaker, Kayenta
NetflixOSS Meetup S6E2 - Spinnaker, Kayenta
 
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
 
NetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & ContainersNetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & Containers
 
Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...
 
REAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKEREAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKE
 
End-to-end test automation with Endtest.dev
End-to-end test automation with Endtest.devEnd-to-end test automation with Endtest.dev
End-to-end test automation with Endtest.dev
 
CMP376 - Another Week, Another Million Containers on Amazon EC2
CMP376 - Another Week, Another Million Containers on Amazon EC2CMP376 - Another Week, Another Million Containers on Amazon EC2
CMP376 - Another Week, Another Million Containers on Amazon EC2
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
 
CS80A Foothill College Open Source Talk
CS80A Foothill College Open Source TalkCS80A Foothill College Open Source Talk
CS80A Foothill College Open Source Talk
 
Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1
 
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric LippmannIcinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
 
DCEU 18: From Monolith to Microservices
DCEU 18: From Monolith to MicroservicesDCEU 18: From Monolith to Microservices
DCEU 18: From Monolith to Microservices
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
 
Terrascan - Cloud Native Security Tool
Terrascan - Cloud Native Security Tool Terrascan - Cloud Native Security Tool
Terrascan - Cloud Native Security Tool
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
Serverless Architectures
Serverless ArchitecturesServerless Architectures
Serverless Architectures
 

Similar to Full Stack Meat Project with Arduino Node AWS Mobile

Low Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the CloudLow Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the Cloud
Dhaval Nagar
 
Write less (code) and build more with serverless
Write less (code) and build more with serverlessWrite less (code) and build more with serverless
Write less (code) and build more with serverless
Dhaval Nagar
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
AWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 RecapAWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 Recap
Ivaylo Bratoev
 
Architecting applications on amazon web services with node.js
Architecting applications on amazon web services with node.jsArchitecting applications on amazon web services with node.js
Architecting applications on amazon web services with node.js
Henry Fougere
 
AWS Developer Ecosystem.pdf
AWS Developer Ecosystem.pdfAWS Developer Ecosystem.pdf
AWS Developer Ecosystem.pdf
Dhaval Nagar
 
Spring 21 Salesforce Release Webinar
Spring 21 Salesforce Release WebinarSpring 21 Salesforce Release Webinar
Spring 21 Salesforce Release Webinar
brightgenss
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
Ciklum Ukraine
 
Lessons learned after a year of lambda - AWS Community Day SF 2017
Lessons learned after a year of lambda - AWS Community Day SF 2017Lessons learned after a year of lambda - AWS Community Day SF 2017
Lessons learned after a year of lambda - AWS Community Day SF 2017
Matt Billock
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
Imre Nagi
 
State of serverless
State of serverlessState of serverless
State of serverless
Anurag Saran
 
Crio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS MasterclassCrio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS Masterclass
Dhaval Nagar
 
PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Lamba scaffold webinar
Lamba scaffold webinarLamba scaffold webinar
Lamba scaffold webinar
Matt Billock
 
Serverless Computing with AWS
Serverless Computing with AWSServerless Computing with AWS
Serverless Computing with AWS
TransferWiseSG
 
AWS IoT Edge Management
AWS IoT Edge ManagementAWS IoT Edge Management
AWS IoT Edge Management
Avinash Patil
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
Amazon Web Services
 
ITV& Bashton
ITV& Bashton ITV& Bashton
ITV& Bashton
Amazon Web Services
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
Eduardo Silva Pereira
 

Similar to Full Stack Meat Project with Arduino Node AWS Mobile (20)

Low Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the CloudLow Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the Cloud
 
Write less (code) and build more with serverless
Write less (code) and build more with serverlessWrite less (code) and build more with serverless
Write less (code) and build more with serverless
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
 
AWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 RecapAWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 Recap
 
Architecting applications on amazon web services with node.js
Architecting applications on amazon web services with node.jsArchitecting applications on amazon web services with node.js
Architecting applications on amazon web services with node.js
 
AWS Developer Ecosystem.pdf
AWS Developer Ecosystem.pdfAWS Developer Ecosystem.pdf
AWS Developer Ecosystem.pdf
 
Spring 21 Salesforce Release Webinar
Spring 21 Salesforce Release WebinarSpring 21 Salesforce Release Webinar
Spring 21 Salesforce Release Webinar
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
 
Lessons learned after a year of lambda - AWS Community Day SF 2017
Lessons learned after a year of lambda - AWS Community Day SF 2017Lessons learned after a year of lambda - AWS Community Day SF 2017
Lessons learned after a year of lambda - AWS Community Day SF 2017
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
 
State of serverless
State of serverlessState of serverless
State of serverless
 
Crio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS MasterclassCrio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS Masterclass
 
PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
 
Lamba scaffold webinar
Lamba scaffold webinarLamba scaffold webinar
Lamba scaffold webinar
 
Serverless Computing with AWS
Serverless Computing with AWSServerless Computing with AWS
Serverless Computing with AWS
 
AWS IoT Edge Management
AWS IoT Edge ManagementAWS IoT Edge Management
AWS IoT Edge Management
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
ITV& Bashton
ITV& Bashton ITV& Bashton
ITV& Bashton
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 

Recently uploaded

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
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
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
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
 
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
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
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
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 

Recently uploaded (20)

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
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
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
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
 
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
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
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
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 

Full Stack Meat Project with Arduino Node AWS Mobile

  • 1. Full Stack Meat Project ‘GrillLog’ Kevin Kazmierczak
  • 2. What are we talking about? Creating a custom built dual probe BBQ thermometer instead of buying one
  • 3. Motivation ● Learn Arduino and basic electronics ● Be able to see grill temperatures on my devices ● Get notified when it was ready ● Learn AWS ● I thought it’d be similar in cost...
  • 4. About Me ● http://www.kevinkaz.com ● @kazmiekr ● Solutions Architect for Universal Mind ● Two Alexa skills published ○ TechBuzz - MBTA Alerts ● 4 Apple Apps - Download them! Taptronome FuelMate Battle Pet Galaxy MadBombz
  • 6.
  • 7.
  • 8. Version 1 ● Built using Parse :( ● Wifi using ESP8266 ● Old blog article
  • 9. Overview ● Arduino ● AWS IoT ● Lambda ● DynamoDB ● API Gateway ● SNS ● Alexa ● iOS ● Web ● Android
  • 10. Warning I am not an expert in any of this. Please feel free to add additional context or information as needed.
  • 12. Arduino Basics ● 14 Digital I/O Pins ( 6 PWM ) ● 6 Analog ● 5V ● Embedded code written in C/C++ as a ‘Sketch’
  • 13. Arduino Yun ● Device details ○ Built in wifi ○ Two processors, traditional ATmega and AR9331 (Linux) ○ Linux processor handles all the more CPU intensive tasks ( wifi / data processing ) ○ ATmega handles reading/writing outputs ● How does it compare to others? ● Could you replace this with a RPi?
  • 14. Fritzing Circuit Diagram Learn more about Fritzing
  • 15. GrillLog Implementation ● Every 10 seconds the device reads two analog inputs ● Using a Steinhart–Hart equation, it converts the analog resistance to temperature ● Equation coefficients calibrated by taking 3 different temperatures and plugged into an online calculator ● Current readings are dumped to Serial and the LCD display
  • 16.
  • 17. AWS Fine Print ● Sign up for a free tier trial account ● One year of free tier account services ● Some of the core services have very generous free limits even without a trial account ● Pay for what you use ● Security ○ Ensure that there are roles setup that have access to execute the pieces of the different services
  • 18. AWS IoT ● Allows device to communicate over MQTT with encrypted traffic ● MQTT - Lightweight messaging protocol, think JMS or Pub/Sub ● Each device gets a signed certificate to use with messaging ● Devices can have shadows for offline sync ● Compatible devices - Anything that can do secure MQTT ● Use command line mosquitto to simulate device messaging
  • 20. AWS IoT Rules ● Rules can filter messages into different channels ● SQL query like syntax to set them up ● Use built in actions ● Lambda is most flexible action
  • 21. GrillLog Implementation ● Yun has certificates installed ● Yun constructs JSON document of temps ● Yun posts message on ‘templogs’ topic ● AWS has a rule that all incoming ‘templog’ messages are forwarded to a lambda function ● Tweaked AWS config to solve memory issues
  • 22. AWS Lambda ● Runs code in response to events ● Pay for what you consume ● Develop in Javascript/Java/Python ● No servers to manage or scale ● Core service used to integrate across AWS ● Pricing ○ First 1 million requests per month are free ○ $0.20 per 1 million requests thereafter ($0.0000002 per request)
  • 23. Lamba Basics ● Can start from one of their many templates ○ Language specific ○ Voice templates ○ Microservices ○ Hello world ● Export a ‘handler’ that takes and event, context, callback ● Do whatever exports.handler = function(event, context, callback) { console.log("value1 = " + event.key1); console.log("value2 = " + event.key2); callback(null, "some success message"); // or // callback("some error type"); }
  • 24. GrillLog Implementation ● Three lambda functions ○ Handle incoming IoT messages ○ Handle web requests ○ Handle voice requests ● All three lambdas just forward into a custom controller/service layer written in Node.js
  • 25. Custom Service Layer ● AWS supports Node 4.3 (finally!!!) ○ ES2016 (ES6) features ■ Promises/arrow functions/etc - check for support before using ● Controller processes input and utilizes services needed ○ Could swap out service implementations later if needed ● Promise based - AWS sdk methods can return a promise ● Easy to test via command line locally ● Use any packages you need via npm ● Service layer gets packaged with lambda
  • 26. GrillLog Implementation ● Utilizes the aws-sdk package ● Deployed via shell script ○ Creates a zip file of required files ○ Calls AWS specific CLI tooling ○ Cleans up ● Uploads a zip per each lambda endpoint
  • 27. AWS DynamoDB ● NoSQL database similar to MongoDB ○ Schema-less ● Event driven hooks ● Easy to save data, not as easy to query ● Integration with other AWS services with streams/triggers ● Pricing ○ 25 GB in free tier, pay per usage ○ “For a little less than $0.25/day ($7.50/month), you could support an application that performs 1 million writes and reads per day”
  • 28. DynamoDB Basics ● Each table has a primary key (hash key) - Most unique ● Optional sort key - What will I most likely sort on? ● Get data out via either a ‘scan’ or ‘query’ ○ ‘query’ requires primary key then you add filter criteria ● Indexes are required to speed up queries ● Sorting is tricky ● No date datatype, have to use a timestamp number ● Save whatever!
  • 29. GrillLog Implementation ● Contains 3 tables ○ DeviceStatus ■ Current status information per device ○ TempLogs ■ Raw temp data from device ○ CookLogs ■ Archived cook data
  • 30. AWS SNS - Simple Notification Service ● Pub-sub messaging ● Deliver across multiple protocols ○ iOS/Android ○ Email ○ SMS ● Hooks into other services ● Pricing ○ Your first 1 million push requests are free ○ $0.50 per 1 million Amazon SNS requests thereafter.
  • 31. SNS Basics ● Create platform application ○ Need certificates to handle push integration with Apple/Google ● Devices can register to application with token ● Messages can be sent to the endpoints registered ● Raw or JSON ● Can tie multiple endpoints together via subscriptions ○ Topic could post to email and push together ● Push messages via AWS dashboard
  • 32. GrillLog Implementation ● Devices are manually registered with device token on dashboard ● Application endpoint created with Apple push certificates from iTunes provisioning portal ● Custom services push JSON formatted messages for Apple devices
  • 33. AWS API Gateway ● Deploy a customized API ● Define the resources that can be called ● SDK generation ● Authentication - keys, IAM, CORS ● Pricing ○ Free tier includes one million API calls per month for up to 12 months ○ $3.50 per million API calls received, plus the cost of data transfer out, in gigabytes.
  • 34. API Gateway Basics ● You can create an API endpoint from the lambda ‘API endpoints’ tab ● Create resources as endpoints like ○ /status or /logs ● Add methods to those resources ○ GET/POST/PUT ● Point those endpoints to a lambda or proxy ● Configure the mappings - How will data pass through ● Customize as needed ● Create multiple ‘stages’ that you can deploy to
  • 35. GrillLog Implementation ● Exposes REST endpoints ○ status/logs/startgrill/startcook/endgrill ● CORS enabled on status/logs for web ● Mobile clients handle state movement ● Entire request information is forwarded to a lambda ● Lambda determines what the URL should do and call proper controller method in custom services
  • 36. Alexa Integration ● Registered skill on amazon developer site ● Forward to lambda or custom deployed services (HTTPS) ● Register intents ( voice input formats ) ● Deploy to app store - Requires approval ○ They are VERY strict that you follow the guidelines ○ You could get a free t-shirt ● Test on developer site ○ Lets you hear responses and see source JSON ● Detailed skill creation walkthrough
  • 38. GrillLog Implementation ● Registered skill forwarding to lambda ● Simple ‘what’s the status’ intent ● Calls into custom services to grab current status ● Converts response into a text string passed back to voice services
  • 39. Logging ● Configure services to write CloudWatch logs ● Add alerts if needed
  • 40. iOS Application ● Apple developer account - $99 ○ Be able to deploy to devices and provision ● Configured app in iTunes connect ● Generate APNS certs imported to SNS ● Written in Swift ● Polls for temp status every 10 sec ● Regenerates chart every 30 sec ● Uses ‘Charts’ project for charting ● Sends push notifications ○ Warm temperature threshold ○ Food temperature ● Background fetch to detect offline situations
  • 41. Web Application ● Deployed on http://grilllog.kevinkaz.com ● Written in ES2016 transpiled in webpack ● Uses D3 to handle charting ● Uses a fetch polyfill ● Styling done in Less
  • 42. Android Application ● Written by coworker, Chris Scott ● Mortar and Flow for view lifecycles ● Dagger for dependency injection ● RxJava and Retrofit for service integration
  • 43. Future Plans ● PID Controller for fan controlled temperature control ● Apple Watch Complication ● Waterproof case ● More notifications ● Review past cooks ● Archive condensed logs