SlideShare a Scribd company logo
1 of 31
Download to read offline
Go and Get Physical with
the Cloud
Using Arduino with Google App Engine for Go
!
Justin Grammens
justin@arduino.mn
I Want to Build Something!
Goal : Track movement using a motion sensor
Technology Requirements:
Use Go
Use Google App Engine
Use Arduino
Send text message when movement occurs
What We’ll Cover
Go Programming Language
Deployment on Google App Engine ( using Go )
REST interface on App Engine ( using go-restful )
Reading sensor data on Arduino
Sending data to our application on App Engine
Send message to 3rd party SMS provider ( Twillio )
Block Diagram
App
Engine
ArduinoBrowser
SMS
Service
Go Programming Language
Developed by Google in 2007
Statically typed language, loosely derived from C.
Automatic memory management
FAST compilation and execution!
Download at: https://code.google.com/p/go/
Go Language Key Points
Some dynamic typing ( “x:= 0” instead of “int x = 0” )
Remote package management ( “go get” )
Built in mechanisms for concurrency
Able to produce statically linked native binaries
Strong focus on support for concurrency
Go Language Key Points
No type inheritance
No method overloading
Has pointers, but no pointer arithmetic (ie. can’t be
changed)
No generics (a la List<String> in Java for instance)
No Exceptions - instead uses an error return type
func Open(name string) (file *File, err error)
Workspaces
Designed from the ground up to work with code in
public repositories
$GOPATH variable points to your workspace location
Put your code in a unique path
convention is: $GOPATH/src/github/user/project
Example Workspace
bin/
hello # command executable
pkg/
darwin_amd64/github.com/justingrammens
mydate.a # package object
src/
github.com/justingrammens/
hello/
.git/		 	 	 # git repository metadata
hello.go		 	 # package source
mydate/
.git/ # git repository metadata
mydate.go # package source
IDEs / Editors with Plugins
Emacs
Eclipse - ( GoClipse )
IntelliJ IDEA
Sublime Text
TextMate
Vim
Example: hello.go
git clone https://github.com/justingrammens/
gdev
!
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
!
Example: hello-world.go
usage: type “go” on command line
$: go run hello.go
hello world
!
$: go install
$: $GOPATH/bin/hello
!
$ go build
./hello ( note the size of the executable )
Writing a Library
package mydate
!
import "time"
!
func Birthdate() time.Time {
d := time.Date(2014, time.May, 6, 0, 0, 0, 0, time.UTC)
return d
}
Return type
Capital letter means
public access
Calling function
Publish Library
git push to public repository: https://github.com/
justingrammens/gdev
Access with:
import “github.com/justingrammens/gdev/go-
examples/mydate”
Anyone can install to their workspace with:
go get github.com/justingrammens/gdev/go-
examples/mydate
Calling Library
package main
!
import "fmt"
import "github.com/justingrammens/gdev/mydate"
import "time"
!
func main() {
	 now := time.Now()
	 birthday := mydate.Birthdate()
	 diff := birthday.YearDay() - now.YearDay()
	 fmt.Printf("There are only %d days to my birthday!n", diff )
}
Example:
Functions can return multiple values:
	 func AddandSub(x, y int) (sum, difference int) {
	 	 sum = x + y
	 	 difference = x - y
	 	 return
	 }
Called with:
sum, difference := mydate.AddandSub(10, 11)
App Engine Using Go
Platform as a Service (PaSS)
Run applications in Google’s infrastructure
Frees you up to develop, not system admin
Develop and test locally, deploy globally
Beware - Go is Experimental!
https://developers.google.com/appengine/downloads
App Engine Using Go
Deployed to [your_app_id].appspot.com
Quotas:
Request & Response Size - 32 MB
Request Duration - 60 sec
Max total files - 10,000 total : 1,000 per directory
Max size files - 32 MB
App Engine Using Go
Run “goapp” to see commands
goapp serve : runs local server
goapp deploy : upload to App Engine
App Engine Using Go
Run Hello World Example
cd appengine-examples
goapp server
Local service: http://localhost:8080
Local datastore viewer: http://localhost:8000
App Engine Using Go
No standard REST framework out of the box
Use “go-restful” project
Easy install and setup with “go get” command
Resources:
“Events”
“Sms”
App Engine Using Go
Run DevFest App
cd devfest
goapp server
Access swagger for API at http://localhost:8080/apidocs
Push update to google app engine at:
appcfg.py --oauth2 update my app
Manage at: https://appengine.google.com
Test Web Service
Simple REST Client
Verify the values are being stored
Toggle values for SMS notifications
Arduino
Open source microcontroller board
Started in Italy in 2005 as a college student project
Based on a simplified version of C++ ( Wiring )
Allows for adding additional boards via “shields”
WIFI shield is added for our project
Many readily available sensors and libraries!
Arduino Wifi Shield
Hardware Parts
PIR Motion Sensor -
$9.95
Arduino R3 Board -
$30.00
Official Arduino WIFI
Shield - $70.00
Schematic
Arduino Basics
Only 2 functions are required
!
void setup() {
// put your setup code here, to run once.
}
!
void loop() {
// put your main code here, to run repeatedly.
}
Motion Sample Code
Motion activated by:
Takes an infrared “snapshot” of the room
If anything changes, pin #2 goes LOW
Use the digitalRead of values
Use WifiClient to Post JSON to our web service.
Print the status to the serial monitor.
Resources
Play with Go Code! http://tour.golang.org/
https://groups.google.com/forum/m/#!forum/google-
appengine-go
https://developers.google.com/appengine/docs/go/
http://arduino.mn - Local Arduino user’s group!
Thanks!
Questions?

More Related Content

What's hot

Windows 10 on Raspberry PI 2
Windows 10 on Raspberry PI 2Windows 10 on Raspberry PI 2
Windows 10 on Raspberry PI 2Mirco Vanini
 
Cross platform mobile apps using rhomobile and jquery mobile
Cross platform mobile apps using rhomobile and jquery mobileCross platform mobile apps using rhomobile and jquery mobile
Cross platform mobile apps using rhomobile and jquery mobileSPRITLE SOFTWARE PRIVATE LIMIT ED
 
Hacking with the Raspberry Pi and Windows 10 IoT Core
Hacking with the Raspberry Pi and Windows 10 IoT CoreHacking with the Raspberry Pi and Windows 10 IoT Core
Hacking with the Raspberry Pi and Windows 10 IoT CoreNick Landry
 
Introduction to Node-RED
Introduction to Node-REDIntroduction to Node-RED
Introduction to Node-REDnodered_ug_jp
 
Humix community kick off
Humix community kick offHumix community kick off
Humix community kick offJeffrey Liu
 
Gwt training presentation
Gwt training presentationGwt training presentation
Gwt training presentationMUFIX Community
 
Language Matters: JavaScript 
from IoT Product Concept 
to Production
Language Matters: JavaScript 
from IoT Product Concept 
to ProductionLanguage Matters: JavaScript 
from IoT Product Concept 
to Production
Language Matters: JavaScript 
from IoT Product Concept 
to ProductionKinoma
 
Mobile CICD
Mobile CICD Mobile CICD
Mobile CICD Gurzu Inc
 

What's hot (10)

Ogdk
OgdkOgdk
Ogdk
 
Windows 10 on Raspberry PI 2
Windows 10 on Raspberry PI 2Windows 10 on Raspberry PI 2
Windows 10 on Raspberry PI 2
 
Cross platform mobile apps using rhomobile and jquery mobile
Cross platform mobile apps using rhomobile and jquery mobileCross platform mobile apps using rhomobile and jquery mobile
Cross platform mobile apps using rhomobile and jquery mobile
 
Node red workshop
Node red workshopNode red workshop
Node red workshop
 
Hacking with the Raspberry Pi and Windows 10 IoT Core
Hacking with the Raspberry Pi and Windows 10 IoT CoreHacking with the Raspberry Pi and Windows 10 IoT Core
Hacking with the Raspberry Pi and Windows 10 IoT Core
 
Introduction to Node-RED
Introduction to Node-REDIntroduction to Node-RED
Introduction to Node-RED
 
Humix community kick off
Humix community kick offHumix community kick off
Humix community kick off
 
Gwt training presentation
Gwt training presentationGwt training presentation
Gwt training presentation
 
Language Matters: JavaScript 
from IoT Product Concept 
to Production
Language Matters: JavaScript 
from IoT Product Concept 
to ProductionLanguage Matters: JavaScript 
from IoT Product Concept 
to Production
Language Matters: JavaScript 
from IoT Product Concept 
to Production
 
Mobile CICD
Mobile CICD Mobile CICD
Mobile CICD
 

Similar to Physical Computing Using Go and Arduino

Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...KAI CHU CHUNG
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloudwesley chun
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentColin Su
 
Introduction to go
Introduction to goIntroduction to go
Introduction to goAnthony Chow
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemoachipa
 
Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Igalia
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and GolangAlmog Baku
 
Android is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog BakuAndroid is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog BakuDroidConTLV
 
Playing with parse.com
Playing with parse.comPlaying with parse.com
Playing with parse.comJUG Genova
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Runwesley chun
 
How to Build Your First Web App in Go
How to Build Your First Web App in GoHow to Build Your First Web App in Go
How to Build Your First Web App in GoAll Things Open
 
GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.Åsa Pehrsson
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with goVimlesh Sharma
 
Trying out the Go language with Google App Engine
Trying out the Go language with Google App EngineTrying out the Go language with Google App Engine
Trying out the Go language with Google App EngineLynn Langit
 

Similar to Physical Computing Using Go and Arduino (20)

Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloud
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
 
Developing for Google Glass
Developing for Google GlassDeveloping for Google Glass
Developing for Google Glass
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemo
 
Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and Golang
 
Android is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog BakuAndroid is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog Baku
 
Playing with parse.com
Playing with parse.comPlaying with parse.com
Playing with parse.com
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
 
How to Build Your First Web App in Go
How to Build Your First Web App in GoHow to Build Your First Web App in Go
How to Build Your First Web App in Go
 
GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
Trying out the Go language with Google App Engine
Trying out the Go language with Google App EngineTrying out the Go language with Google App Engine
Trying out the Go language with Google App Engine
 

More from Justin Grammens

Scope Creep - Damned if I Do, Damned if I Don't
Scope Creep - Damned if I Do, Damned if I Don'tScope Creep - Damned if I Do, Damned if I Don't
Scope Creep - Damned if I Do, Damned if I Don'tJustin Grammens
 
Deep Learning with TensorFlow
Deep Learning with TensorFlowDeep Learning with TensorFlow
Deep Learning with TensorFlowJustin Grammens
 
Speaking at John Carrol University on the Internet of Things
Speaking at John Carrol University on the Internet of ThingsSpeaking at John Carrol University on the Internet of Things
Speaking at John Carrol University on the Internet of ThingsJustin Grammens
 
NDC Minnesota 2019 - Fundamentals of Azure IoT
NDC Minnesota 2019 - Fundamentals of Azure IoTNDC Minnesota 2019 - Fundamentals of Azure IoT
NDC Minnesota 2019 - Fundamentals of Azure IoTJustin Grammens
 
This Time, It’s Personal: Why Security and the IoT Is Different
This Time, It’s Personal: Why Security and the IoT Is DifferentThis Time, It’s Personal: Why Security and the IoT Is Different
This Time, It’s Personal: Why Security and the IoT Is DifferentJustin Grammens
 
Looking into the Future: Using Google's Prediction API
Looking into the Future: Using Google's Prediction APILooking into the Future: Using Google's Prediction API
Looking into the Future: Using Google's Prediction APIJustin Grammens
 
The Internet of Things - What It Is, Where Its Headed and Its Applications
The Internet of Things - What It Is, Where Its Headed and Its ApplicationsThe Internet of Things - What It Is, Where Its Headed and Its Applications
The Internet of Things - What It Is, Where Its Headed and Its ApplicationsJustin Grammens
 
Internet of Things: What It Is, Where's Headed and Its Applications
Internet of Things: What It Is, Where's Headed and Its ApplicationsInternet of Things: What It Is, Where's Headed and Its Applications
Internet of Things: What It Is, Where's Headed and Its ApplicationsJustin Grammens
 
Collaborative Learning - The Role Communities Play in IoT
Collaborative Learning - The Role Communities Play in IoTCollaborative Learning - The Role Communities Play in IoT
Collaborative Learning - The Role Communities Play in IoTJustin Grammens
 
Internet of Things: What it is, where it is going and how it is being applied.
Internet of Things: What it is, where it is going and how it is being applied.Internet of Things: What it is, where it is going and how it is being applied.
Internet of Things: What it is, where it is going and how it is being applied.Justin Grammens
 
Arduino, Open Source and The Internet of Things Landscape
Arduino, Open Source and The Internet of Things LandscapeArduino, Open Source and The Internet of Things Landscape
Arduino, Open Source and The Internet of Things LandscapeJustin Grammens
 
The State of Arduino and IoT
The State of Arduino and IoTThe State of Arduino and IoT
The State of Arduino and IoTJustin Grammens
 
Voice Enabled Applications
Voice Enabled ApplicationsVoice Enabled Applications
Voice Enabled ApplicationsJustin Grammens
 
Adhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationAdhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationJustin Grammens
 
Asterisk-Java Framework Presentation
Asterisk-Java Framework PresentationAsterisk-Java Framework Presentation
Asterisk-Java Framework PresentationJustin Grammens
 

More from Justin Grammens (18)

Scope Creep - Damned if I Do, Damned if I Don't
Scope Creep - Damned if I Do, Damned if I Don'tScope Creep - Damned if I Do, Damned if I Don't
Scope Creep - Damned if I Do, Damned if I Don't
 
Deep Learning with TensorFlow
Deep Learning with TensorFlowDeep Learning with TensorFlow
Deep Learning with TensorFlow
 
Speaking at John Carrol University on the Internet of Things
Speaking at John Carrol University on the Internet of ThingsSpeaking at John Carrol University on the Internet of Things
Speaking at John Carrol University on the Internet of Things
 
NDC Minnesota 2019 - Fundamentals of Azure IoT
NDC Minnesota 2019 - Fundamentals of Azure IoTNDC Minnesota 2019 - Fundamentals of Azure IoT
NDC Minnesota 2019 - Fundamentals of Azure IoT
 
This Time, It’s Personal: Why Security and the IoT Is Different
This Time, It’s Personal: Why Security and the IoT Is DifferentThis Time, It’s Personal: Why Security and the IoT Is Different
This Time, It’s Personal: Why Security and the IoT Is Different
 
Looking into the Future: Using Google's Prediction API
Looking into the Future: Using Google's Prediction APILooking into the Future: Using Google's Prediction API
Looking into the Future: Using Google's Prediction API
 
The Internet of Things - What It Is, Where Its Headed and Its Applications
The Internet of Things - What It Is, Where Its Headed and Its ApplicationsThe Internet of Things - What It Is, Where Its Headed and Its Applications
The Internet of Things - What It Is, Where Its Headed and Its Applications
 
Internet of Things: What It Is, Where's Headed and Its Applications
Internet of Things: What It Is, Where's Headed and Its ApplicationsInternet of Things: What It Is, Where's Headed and Its Applications
Internet of Things: What It Is, Where's Headed and Its Applications
 
Collaborative Learning - The Role Communities Play in IoT
Collaborative Learning - The Role Communities Play in IoTCollaborative Learning - The Role Communities Play in IoT
Collaborative Learning - The Role Communities Play in IoT
 
Internet of Things: What it is, where it is going and how it is being applied.
Internet of Things: What it is, where it is going and how it is being applied.Internet of Things: What it is, where it is going and how it is being applied.
Internet of Things: What it is, where it is going and how it is being applied.
 
Arduino, Open Source and The Internet of Things Landscape
Arduino, Open Source and The Internet of Things LandscapeArduino, Open Source and The Internet of Things Landscape
Arduino, Open Source and The Internet of Things Landscape
 
The State of Arduino and IoT
The State of Arduino and IoTThe State of Arduino and IoT
The State of Arduino and IoT
 
Android Minnebar
Android MinnebarAndroid Minnebar
Android Minnebar
 
Android TCJUG
Android TCJUGAndroid TCJUG
Android TCJUG
 
Voice Enabled Applications
Voice Enabled ApplicationsVoice Enabled Applications
Voice Enabled Applications
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
Adhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationAdhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework Presentation
 
Asterisk-Java Framework Presentation
Asterisk-Java Framework PresentationAsterisk-Java Framework Presentation
Asterisk-Java Framework Presentation
 

Recently uploaded

NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...Amil baba
 
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls in Delhi
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Servicesnajka9823
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...ttt fff
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil Baba Dawood bangali
 
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls DubaiDubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubaikojalkojal131
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一ss ss
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...Amil baba
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile servicerehmti665
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作f3774p8b
 
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookvip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookmanojkuma9823
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxLeaMaePahinagGarciaV
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...Authentic No 1 Amil Baba In Pakistan
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证gwhohjj
 

Recently uploaded (20)

NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
 
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
 
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
 
Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls DubaiDubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile service
 
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
young call girls in  Khanpur,🔝 9953056974 🔝 escort Serviceyoung call girls in  Khanpur,🔝 9953056974 🔝 escort Service
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
 
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookvip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptx
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
 

Physical Computing Using Go and Arduino

  • 1. Go and Get Physical with the Cloud Using Arduino with Google App Engine for Go ! Justin Grammens justin@arduino.mn
  • 2. I Want to Build Something! Goal : Track movement using a motion sensor Technology Requirements: Use Go Use Google App Engine Use Arduino Send text message when movement occurs
  • 3. What We’ll Cover Go Programming Language Deployment on Google App Engine ( using Go ) REST interface on App Engine ( using go-restful ) Reading sensor data on Arduino Sending data to our application on App Engine Send message to 3rd party SMS provider ( Twillio )
  • 5. Go Programming Language Developed by Google in 2007 Statically typed language, loosely derived from C. Automatic memory management FAST compilation and execution! Download at: https://code.google.com/p/go/
  • 6. Go Language Key Points Some dynamic typing ( “x:= 0” instead of “int x = 0” ) Remote package management ( “go get” ) Built in mechanisms for concurrency Able to produce statically linked native binaries Strong focus on support for concurrency
  • 7. Go Language Key Points No type inheritance No method overloading Has pointers, but no pointer arithmetic (ie. can’t be changed) No generics (a la List<String> in Java for instance) No Exceptions - instead uses an error return type func Open(name string) (file *File, err error)
  • 8. Workspaces Designed from the ground up to work with code in public repositories $GOPATH variable points to your workspace location Put your code in a unique path convention is: $GOPATH/src/github/user/project
  • 9. Example Workspace bin/ hello # command executable pkg/ darwin_amd64/github.com/justingrammens mydate.a # package object src/ github.com/justingrammens/ hello/ .git/ # git repository metadata hello.go # package source mydate/ .git/ # git repository metadata mydate.go # package source
  • 10. IDEs / Editors with Plugins Emacs Eclipse - ( GoClipse ) IntelliJ IDEA Sublime Text TextMate Vim
  • 11. Example: hello.go git clone https://github.com/justingrammens/ gdev ! package main import "fmt" func main() { fmt.Println("hello world") } !
  • 12. Example: hello-world.go usage: type “go” on command line $: go run hello.go hello world ! $: go install $: $GOPATH/bin/hello ! $ go build ./hello ( note the size of the executable )
  • 13. Writing a Library package mydate ! import "time" ! func Birthdate() time.Time { d := time.Date(2014, time.May, 6, 0, 0, 0, 0, time.UTC) return d } Return type Capital letter means public access Calling function
  • 14. Publish Library git push to public repository: https://github.com/ justingrammens/gdev Access with: import “github.com/justingrammens/gdev/go- examples/mydate” Anyone can install to their workspace with: go get github.com/justingrammens/gdev/go- examples/mydate
  • 15. Calling Library package main ! import "fmt" import "github.com/justingrammens/gdev/mydate" import "time" ! func main() { now := time.Now() birthday := mydate.Birthdate() diff := birthday.YearDay() - now.YearDay() fmt.Printf("There are only %d days to my birthday!n", diff ) }
  • 16. Example: Functions can return multiple values: func AddandSub(x, y int) (sum, difference int) { sum = x + y difference = x - y return } Called with: sum, difference := mydate.AddandSub(10, 11)
  • 17. App Engine Using Go Platform as a Service (PaSS) Run applications in Google’s infrastructure Frees you up to develop, not system admin Develop and test locally, deploy globally Beware - Go is Experimental! https://developers.google.com/appengine/downloads
  • 18. App Engine Using Go Deployed to [your_app_id].appspot.com Quotas: Request & Response Size - 32 MB Request Duration - 60 sec Max total files - 10,000 total : 1,000 per directory Max size files - 32 MB
  • 19. App Engine Using Go Run “goapp” to see commands goapp serve : runs local server goapp deploy : upload to App Engine
  • 20. App Engine Using Go Run Hello World Example cd appengine-examples goapp server Local service: http://localhost:8080 Local datastore viewer: http://localhost:8000
  • 21. App Engine Using Go No standard REST framework out of the box Use “go-restful” project Easy install and setup with “go get” command Resources: “Events” “Sms”
  • 22. App Engine Using Go Run DevFest App cd devfest goapp server Access swagger for API at http://localhost:8080/apidocs Push update to google app engine at: appcfg.py --oauth2 update my app Manage at: https://appengine.google.com
  • 23. Test Web Service Simple REST Client Verify the values are being stored Toggle values for SMS notifications
  • 24. Arduino Open source microcontroller board Started in Italy in 2005 as a college student project Based on a simplified version of C++ ( Wiring ) Allows for adding additional boards via “shields” WIFI shield is added for our project Many readily available sensors and libraries!
  • 26. Hardware Parts PIR Motion Sensor - $9.95 Arduino R3 Board - $30.00 Official Arduino WIFI Shield - $70.00
  • 28. Arduino Basics Only 2 functions are required ! void setup() { // put your setup code here, to run once. } ! void loop() { // put your main code here, to run repeatedly. }
  • 29. Motion Sample Code Motion activated by: Takes an infrared “snapshot” of the room If anything changes, pin #2 goes LOW Use the digitalRead of values Use WifiClient to Post JSON to our web service. Print the status to the serial monitor.
  • 30. Resources Play with Go Code! http://tour.golang.org/ https://groups.google.com/forum/m/#!forum/google- appengine-go https://developers.google.com/appengine/docs/go/ http://arduino.mn - Local Arduino user’s group!