SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Internet of Things - The Salesforce
Lego Machine Cloud
Andrew Fawcett
FinancialForce.com, CTO
@andyinthecloud
Andrew Fawcett
FinancialForce.com, CTO
@andyinthecloud
About FinancialForce.com
• San Francisco Headquarters
• Harrogate, UK
• Granada, Spain
• Toronto, Canada
• Manchester, US
• Opening Sydney, AUS in Sept, 2014
• 350+ Employees
• 400+ by 12/31/2014
• Customers in 31 countries
• 80% Y-o-Y revenue growth
• Advent commitment of $50 million
Session Resources
• Follow the Session in the Dreamforce
App, I will share this slide deck and
other related links on the Feed
• Be social and feel free to ask follow up
questions! 
Introduction
• What are the device requirements?
• How intelligent does the device need to be?
• What is a Machine Cloud?
• Building a Machine Cloud with Salesforce1 Platform
• Demos
• How to make your own Machine Cloud with
with Lego Mindstorms EV3
What does a Device need to call the Salesforce API’s?
• Ability to connect to a local internet gateway
– e.g. phone or other computer connected to Internet
• Ability to connect direct to Internet
– SSL support ideally, though non-SSL end points
proxies can be used
• Ability to parse XML or JSON
– String manipulation or ideally JSON or XML parsers
• Ability to consume Java libraries
– Ideally Salesforce Web Service Connector
Basic Capabilities, limited RAM/CPU
Advanced Capabilities e.g. running OS’s
What does a Device need to call the Salesforce API’s?
• Common runtime language
– Such as Java!
• Oracle port to ARMv5 process running on Lego Mindstorms EV3
• Community Java runtime known as Lejos for Lego Mindstorms NXT
How intelligent should the device be?
• Processing power and storage can vary
– Depends on sensor input and output demands
– Cloud based logic can be used via HTTPS communications
– HTTPS communications
• Streaming communications vs Polling
• Ability to connect locally to the device is useful
– Lego Mindstorms EV3 runs a Lego variation of Linux
– Can TELNET to it and execute Unix commands
– Java Remote Debug is also possible
LEGO Mindstorms EV3 Programmable Brick
Feature Spec
Display Monochrome LCD
178 x 128 pixels
Operating System Linux based
Main Processor 300 MH Texas Instruments Sitara
AM11808 (ARM9 core)
Main Memory 64 MB RAM, 16 MB Flash
USB Host Port Yes
WiFi Yes via USB Dongle
Bluetooth Yes
What is a Machine Cloud?
• A single place for machines to
communicate and share information
• Machines can communicate to us and
other machines across the world
• Can be used to store data
• Can perform calculations on behalf of
devices, with access to more
information, also easier maintenance
and updates to software
Introducing a Machine Cloud built with Salesforce1 Platform
Salesforce1
Mobile
Custom
Objects
REST and
Streaming
API’s
Connected
Applications
Controlling Machines through Custom Objects
#clicksnotcode
Controlling Machines through Custom Objects
#clicksnotcode
Demo : Pairing
Pairing Mindstorm EV3 Robots to our Machine Cloud and sending commands
Ok so what just happened under the hood?
Salesforce
Streaming and
REST APIEV3 #1
ev3force.jar
Heroku
Connected App
EV3 Pairing REST API
EV3 #2
ev3force.jar
Custom
Objects
Commands
Commands
Pairing Pairing
You want to go further under the hood?
Salesforce
Streaming and
REST API
Heroku
Connected App
EV3 Pairing REST API
EV3
2. Get Pin
3. Wait for PIN Entry and
receive oAuth Token
4. User Enters PIN, oAuth Token is passed
/ev3force.properties
5. EV3 stores oAuth Token
ev3force.jar
Custom
Objects
1. oAuth Token
stored?
First time ev3force.jar runs
Each time ev3force.jar runs
6. Read Robot Details
7. Start Listening
8. Create
Command records
Demo: Controlling a Lego Robot
Moving a Robot around
Demo: Programming a Robot
Pre-creating Command records and sending a Run Program command
How is it implemented?
Code: Pairing
// Http commons with pairing service
HttpClient httpClient = new HttpClient();
httpClient.setConnectTimeout(20 * 1000); // Connection timeout
httpClient.setTimeout(120 * 1000); // Read timeout
httpClient.start();
// Get a pin number
ContentExchange getPin = new ContentExchange();
getPin.setMethod("GET");
getPin.setURL("https://ev3forcepairing.herokuapp.com/service/pin");
httpClient.send(getPin);
getPin.waitForDone();
Map<String, Object> parsed = (Map<String, Object>) JSON.parse(getPin.getResponseContent());
// Display pin number to enter into Salesforce
LCD.clear();
LCD.drawString("Pin " + parsed.get("pin"), 0, 3);
Code: Pairing
// Wait for oAuth token for the given pin number
while(true)
{
getPin = new ContentExchange();
getPin.setMethod("GET");
getPin.setURL("https://ev3forcepairing.herokuapp.com/service/pin?pin=" + pin);
httpClient.send(getPin);
getPin.waitForDone();
parsed = (Map<String, Object>) JSON.parse(getPin.getResponseContent());
oAuthToken = (String) parsed.get("oAuthToken");
robotId = (String) parsed.get("robotId");
serverUrl = (String) parsed.get(”serverUrl");
if(oAuthToken!=null)
break;
LCD.drawString("Waiting " + waitCount++, 0, 4);
Delay.msDelay(1000);
}
Code: Pairing
<td><b>Pin:</b></td>
<td>
<form action="/default/pinset.jsp">
<input name="pin"/>
<input type="submit" value="Pair"/>
<input name=”refreshToken" type="hidden"
value="${canvasRequest.client.refreshToken}"/>
<input name="recordId" type="hidden"
value="${canvasRequest.context.environmentContext.record.Id}"/>
</form>
</td>
<body>
<%
String pin = request.getParameter("pin");
String refreshToken = request.getParameter(”refreshToken");
String robotId = request.getParameter("recordId");
PairingResource.setConnection(pin, refreshToken, robotId);
%>
Now check your EV3!
</body>
Code: Listening for Commands via Streaming API
// Subscribe to the 'commands' topic to listen for new Command__c records
client.getChannel("/topic/commands").subscribe(new ClientSessionChannel.MessageListener()
{
public void onMessage(ClientSessionChannel channel, Message message)
{
HashMap<String, Object> data = (HashMap<String, Object>)
JSON.parse(message.toString());
HashMap<String, Object> record =
(HashMap<String, Object>) data.get("data");
HashMap<String, Object> sobject =
(HashMap<String, Object>) record.get("sobject");
String commandName = (String) sobject.get("Name");
String command = (String) sobject.get("Command__c");
String commandParameter = (String) sobject.get("CommandParameter__c");
String programToRunId = (String) sobject.get("ProgramToRun__c");
executeCommand(
commandName, command, commandParameter, programToRunId, partnerConnection);
}
});
Code: Moving the Robot around with Lejos
import lejos.hardware.motor.Motor;
public static void moveForward(int rotations)
{
Motor.B.rotate((180 * rotations)*1, true);
Motor.C.rotate((180 * rotations)*1, true);
while (Motor.B.isMoving() || Motor.C.isMoving());
Motor.B.flt(true);
Motor.C.flt(true);
}
public static void moveBackwards(int rotations)
{
Motor.B.rotate((180 * rotations)*-1, true);
Motor.C.rotate((180 * rotations)*-1, true);
while (Motor.B.isMoving() || Motor.C.isMoving());
Motor.B.flt(true);
Motor.C.flt(true);
}
Building your Lego Robot
• What do I need?
– Edimax EW-7811UN 150Mbps Wireless Nano USB Adapter
– Micro SD Card (SDHC Only), 1GB, no greater than 32GB
– Lego Mindstorms EV3 Set, Gripper Robot!
Creating your own Lego Robot Machine Cloud!
• Installation in Salesforce
– Install the Machine Cloud managed package (see Readme)
• https://github.com/afawcett/legoev3-machinecloud
• Installation on Lego Mindstorms EV3
1. Install Lejos on your SDCard and install in the EV3
• http://sourceforge.net/p/lejos/wiki/Home/
2. Use the Lejos menu on the EV3 to connect to your Wifi
3. Copy the ev3force.jar to your EV3 Robot (from /dist folder in GitHub Repo)
• Run the /bin/ev3console UI and deploy using the Programs tab
Creating your own Lego Robot Machine Cloud!
• Connecting your Robots
1. Run the ev3force.jar application on the EV3
2. Note the PIN number shown on the EV3 Robot
3. Login to your Salesforce org and create a Robot record
4. Enter PIN number, wait for the device to connect to Salesforce
5. Send it commands and programs to run!
Further Ideas…
• Expose the Machine Cloud via Salesforce Communities
• Machine Cloud API?
– Perhaps we already have this?
• Using the Salesforce API to insert records to the Command__c object? 
• Add support for other Devices?
– Watches, Phones etc
• Add support for Generic Streaming API events
– Events not driven by Database events but by processes
Session Resources
• Follow the Session in the Dreamforce
App, I will share this slide deck and
other related links on the Feed
• Be social and feel free to ask follow up
questions! 
Internet of things   the salesforce lego machine cloud

Weitere ähnliche Inhalte

Was ist angesagt?

Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material designSrinadh Kanugala
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning componentsMohith Shrivastava
 
Firebase Cloud Messaging for iOS
Firebase Cloud Messaging for iOSFirebase Cloud Messaging for iOS
Firebase Cloud Messaging for iOSJames Daniels
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge TriggersAtlassian
 
iOSDevCamp Firebase Overview
iOSDevCamp Firebase OverviewiOSDevCamp Firebase Overview
iOSDevCamp Firebase OverviewJames Daniels
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge RuntimeAtlassian
 
Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerSalesforce Developers
 
Build a video chat application with twilio, rails, and javascript (part 1)
Build a video chat application with twilio, rails, and javascript (part 1)Build a video chat application with twilio, rails, and javascript (part 1)
Build a video chat application with twilio, rails, and javascript (part 1)Katy Slemon
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceAtlassian
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to AppsGilles Pommier
 
Spec-first API Design for Speed and Safety
Spec-first API Design for Speed and SafetySpec-first API Design for Speed and Safety
Spec-first API Design for Speed and SafetyAtlassian
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentChris O'Brien
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaAtlassian
 
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...Atlassian
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelAtlassian
 
Creating Your Own Server Add-on that Customizes Confluence or JIRA
Creating Your Own Server Add-on that Customizes Confluence or JIRACreating Your Own Server Add-on that Customizes Confluence or JIRA
Creating Your Own Server Add-on that Customizes Confluence or JIRAAtlassian
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowYakov Fain
 
Practical Patterns for Developing a Cross-product Cross-version App
Practical Patterns for Developing a Cross-product Cross-version AppPractical Patterns for Developing a Cross-product Cross-version App
Practical Patterns for Developing a Cross-product Cross-version AppAtlassian
 

Was ist angesagt? (20)

Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning components
 
Firebase Cloud Messaging for iOS
Firebase Cloud Messaging for iOSFirebase Cloud Messaging for iOS
Firebase Cloud Messaging for iOS
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge Triggers
 
iOSDevCamp Firebase Overview
iOSDevCamp Firebase OverviewiOSDevCamp Firebase Overview
iOSDevCamp Firebase Overview
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
 
Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using Swagger
 
Build a video chat application with twilio, rails, and javascript (part 1)
Build a video chat application with twilio, rails, and javascript (part 1)Build a video chat application with twilio, rails, and javascript (part 1)
Build a video chat application with twilio, rails, and javascript (part 1)
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps
 
Spec-first API Design for Speed and Safety
Spec-first API Design for Speed and SafetySpec-first API Design for Speed and Safety
Spec-first API Design for Speed and Safety
 
Next level of Appium
Next level of AppiumNext level of Appium
Next level of Appium
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure Java
 
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy Model
 
Creating Your Own Server Add-on that Customizes Confluence or JIRA
Creating Your Own Server Add-on that Customizes Confluence or JIRACreating Your Own Server Add-on that Customizes Confluence or JIRA
Creating Your Own Server Add-on that Customizes Confluence or JIRA
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
 
Practical Patterns for Developing a Cross-product Cross-version App
Practical Patterns for Developing a Cross-product Cross-version AppPractical Patterns for Developing a Cross-product Cross-version App
Practical Patterns for Developing a Cross-product Cross-version App
 

Andere mochten auch

Building BI Publisher Reports using Templates
Building BI Publisher Reports using TemplatesBuilding BI Publisher Reports using Templates
Building BI Publisher Reports using Templatesp6academy
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics CloudMohith Shrivastava
 
Real-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data DirectReal-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data DirectSalesforce Developers
 
Apex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce ObjectApex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce ObjectSalesforce Developers
 
Force.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter FeedForce.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter FeedSalesforce Developers
 
Lightning strikes twice- SEDreamin
Lightning strikes twice- SEDreaminLightning strikes twice- SEDreamin
Lightning strikes twice- SEDreaminMohith Shrivastava
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builderandyinthecloud
 
Lightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the WorldLightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the WorldSalesforce Developers
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceLightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceSalesforce Developers
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsSalesforce Developers
 
How the Best Consumer Brands like Angie's List Find New Customers on Facebook
How the Best Consumer Brands like Angie's List Find New Customers on FacebookHow the Best Consumer Brands like Angie's List Find New Customers on Facebook
How the Best Consumer Brands like Angie's List Find New Customers on FacebookSalesforce Marketing Cloud
 
How Intuit Turned Transactional Emails Into Quick Customer Wins
How Intuit Turned Transactional Emails Into Quick Customer WinsHow Intuit Turned Transactional Emails Into Quick Customer Wins
How Intuit Turned Transactional Emails Into Quick Customer WinsSalesforce Marketing Cloud
 
XLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & TricksXLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & Tricksguest92a5de
 
Secure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best PracticesSecure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best PracticesSalesforce Developers
 
Marketing and Sales Aligned with a Common Goal
Marketing and Sales Aligned with a Common GoalMarketing and Sales Aligned with a Common Goal
Marketing and Sales Aligned with a Common GoalSalesforce Marketing Cloud
 
Access External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectAccess External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectSalesforce Developers
 
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...MediaPost
 
Slideshare About Me
Slideshare About MeSlideshare About Me
Slideshare About Meorolandy
 

Andere mochten auch (20)

Building BI Publisher Reports using Templates
Building BI Publisher Reports using TemplatesBuilding BI Publisher Reports using Templates
Building BI Publisher Reports using Templates
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics Cloud
 
Real-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data DirectReal-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
 
Apex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce ObjectApex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce Object
 
Force.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter FeedForce.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter Feed
 
Lightning strikes twice- SEDreamin
Lightning strikes twice- SEDreaminLightning strikes twice- SEDreamin
Lightning strikes twice- SEDreamin
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builder
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
 
Lightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the WorldLightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the World
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceLightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External Objects
 
How the Best Consumer Brands like Angie's List Find New Customers on Facebook
How the Best Consumer Brands like Angie's List Find New Customers on FacebookHow the Best Consumer Brands like Angie's List Find New Customers on Facebook
How the Best Consumer Brands like Angie's List Find New Customers on Facebook
 
How Intuit Turned Transactional Emails Into Quick Customer Wins
How Intuit Turned Transactional Emails Into Quick Customer WinsHow Intuit Turned Transactional Emails Into Quick Customer Wins
How Intuit Turned Transactional Emails Into Quick Customer Wins
 
XLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & TricksXLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & Tricks
 
Secure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best PracticesSecure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best Practices
 
Marketing and Sales Aligned with a Common Goal
Marketing and Sales Aligned with a Common GoalMarketing and Sales Aligned with a Common Goal
Marketing and Sales Aligned with a Common Goal
 
Access External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectAccess External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning Connect
 
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...
Detecting Signals from the Noise to Engage Consumers During Their Path to Pur...
 
Basics of Killer Content Marketing
Basics of Killer Content MarketingBasics of Killer Content Marketing
Basics of Killer Content Marketing
 
Slideshare About Me
Slideshare About MeSlideshare About Me
Slideshare About Me
 

Ähnlich wie Internet of things the salesforce lego machine cloud

PowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGTaylor Riggan
 
Azure Internet of Things
Azure Internet of ThingsAzure Internet of Things
Azure Internet of ThingsAlon Fliess
 
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7Rapid7
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT Meetup
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...InfluxData
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca
 
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesCodemotion
 
SignalR Intro + WPDev integration @ Codetock
SignalR Intro + WPDev integration @ CodetockSignalR Intro + WPDev integration @ Codetock
SignalR Intro + WPDev integration @ CodetockSam Basu
 
APIs for the Internet of Things
APIs for the Internet of ThingsAPIs for the Internet of Things
APIs for the Internet of ThingsKinoma
 
Internetandjava
InternetandjavaInternetandjava
Internetandjavamuniinb4u
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearningmuniinb4u
 

Ähnlich wie Internet of things the salesforce lego machine cloud (20)

PowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUG
 
Azure Internet of Things
Azure Internet of ThingsAzure Internet of Things
Azure Internet of Things
 
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
 
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
 
SignalR Intro + WPDev integration @ Codetock
SignalR Intro + WPDev integration @ CodetockSignalR Intro + WPDev integration @ Codetock
SignalR Intro + WPDev integration @ Codetock
 
IoT on azure
IoT on azureIoT on azure
IoT on azure
 
APIs for the Internet of Things
APIs for the Internet of ThingsAPIs for the Internet of Things
APIs for the Internet of Things
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
 
ppttips
ppttipsppttips
ppttips
 
ppttips
ppttipsppttips
ppttips
 
Java
JavaJava
Java
 
ppttips
ppttipsppttips
ppttips
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearning
 
ppt tips
ppt tipsppt tips
ppt tips
 
ppttips
ppttipsppttips
ppttips
 

Kürzlich hochgeladen

Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...srsj9000
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...ttt fff
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程1k98h0e1
 
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一ss ss
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
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
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一ss ss
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfPresentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfchapmanellie27
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》o8wvnojp
 
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts ServiceVip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts Serviceankitnayak356677
 
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
 
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
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一ss ss
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gayasrsj9000
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一Fi sss
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightKomal Khan
 

Kürzlich hochgeladen (20)

Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程
 
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
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...
 
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Serviceyoung call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfPresentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
 
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts ServiceVip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
 
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
 
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
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun Tonight
 

Internet of things the salesforce lego machine cloud

  • 1. Internet of Things - The Salesforce Lego Machine Cloud Andrew Fawcett FinancialForce.com, CTO @andyinthecloud
  • 3. About FinancialForce.com • San Francisco Headquarters • Harrogate, UK • Granada, Spain • Toronto, Canada • Manchester, US • Opening Sydney, AUS in Sept, 2014 • 350+ Employees • 400+ by 12/31/2014 • Customers in 31 countries • 80% Y-o-Y revenue growth • Advent commitment of $50 million
  • 4. Session Resources • Follow the Session in the Dreamforce App, I will share this slide deck and other related links on the Feed • Be social and feel free to ask follow up questions! 
  • 5. Introduction • What are the device requirements? • How intelligent does the device need to be? • What is a Machine Cloud? • Building a Machine Cloud with Salesforce1 Platform • Demos • How to make your own Machine Cloud with with Lego Mindstorms EV3
  • 6. What does a Device need to call the Salesforce API’s? • Ability to connect to a local internet gateway – e.g. phone or other computer connected to Internet • Ability to connect direct to Internet – SSL support ideally, though non-SSL end points proxies can be used • Ability to parse XML or JSON – String manipulation or ideally JSON or XML parsers • Ability to consume Java libraries – Ideally Salesforce Web Service Connector Basic Capabilities, limited RAM/CPU Advanced Capabilities e.g. running OS’s
  • 7. What does a Device need to call the Salesforce API’s? • Common runtime language – Such as Java! • Oracle port to ARMv5 process running on Lego Mindstorms EV3 • Community Java runtime known as Lejos for Lego Mindstorms NXT
  • 8. How intelligent should the device be? • Processing power and storage can vary – Depends on sensor input and output demands – Cloud based logic can be used via HTTPS communications – HTTPS communications • Streaming communications vs Polling • Ability to connect locally to the device is useful – Lego Mindstorms EV3 runs a Lego variation of Linux – Can TELNET to it and execute Unix commands – Java Remote Debug is also possible
  • 9. LEGO Mindstorms EV3 Programmable Brick Feature Spec Display Monochrome LCD 178 x 128 pixels Operating System Linux based Main Processor 300 MH Texas Instruments Sitara AM11808 (ARM9 core) Main Memory 64 MB RAM, 16 MB Flash USB Host Port Yes WiFi Yes via USB Dongle Bluetooth Yes
  • 10. What is a Machine Cloud? • A single place for machines to communicate and share information • Machines can communicate to us and other machines across the world • Can be used to store data • Can perform calculations on behalf of devices, with access to more information, also easier maintenance and updates to software
  • 11. Introducing a Machine Cloud built with Salesforce1 Platform Salesforce1 Mobile Custom Objects REST and Streaming API’s Connected Applications
  • 12. Controlling Machines through Custom Objects #clicksnotcode
  • 13. Controlling Machines through Custom Objects #clicksnotcode
  • 14. Demo : Pairing Pairing Mindstorm EV3 Robots to our Machine Cloud and sending commands
  • 15. Ok so what just happened under the hood? Salesforce Streaming and REST APIEV3 #1 ev3force.jar Heroku Connected App EV3 Pairing REST API EV3 #2 ev3force.jar Custom Objects Commands Commands Pairing Pairing
  • 16. You want to go further under the hood? Salesforce Streaming and REST API Heroku Connected App EV3 Pairing REST API EV3 2. Get Pin 3. Wait for PIN Entry and receive oAuth Token 4. User Enters PIN, oAuth Token is passed /ev3force.properties 5. EV3 stores oAuth Token ev3force.jar Custom Objects 1. oAuth Token stored? First time ev3force.jar runs Each time ev3force.jar runs 6. Read Robot Details 7. Start Listening 8. Create Command records
  • 17. Demo: Controlling a Lego Robot Moving a Robot around
  • 18. Demo: Programming a Robot Pre-creating Command records and sending a Run Program command
  • 19. How is it implemented?
  • 20. Code: Pairing // Http commons with pairing service HttpClient httpClient = new HttpClient(); httpClient.setConnectTimeout(20 * 1000); // Connection timeout httpClient.setTimeout(120 * 1000); // Read timeout httpClient.start(); // Get a pin number ContentExchange getPin = new ContentExchange(); getPin.setMethod("GET"); getPin.setURL("https://ev3forcepairing.herokuapp.com/service/pin"); httpClient.send(getPin); getPin.waitForDone(); Map<String, Object> parsed = (Map<String, Object>) JSON.parse(getPin.getResponseContent()); // Display pin number to enter into Salesforce LCD.clear(); LCD.drawString("Pin " + parsed.get("pin"), 0, 3);
  • 21. Code: Pairing // Wait for oAuth token for the given pin number while(true) { getPin = new ContentExchange(); getPin.setMethod("GET"); getPin.setURL("https://ev3forcepairing.herokuapp.com/service/pin?pin=" + pin); httpClient.send(getPin); getPin.waitForDone(); parsed = (Map<String, Object>) JSON.parse(getPin.getResponseContent()); oAuthToken = (String) parsed.get("oAuthToken"); robotId = (String) parsed.get("robotId"); serverUrl = (String) parsed.get(”serverUrl"); if(oAuthToken!=null) break; LCD.drawString("Waiting " + waitCount++, 0, 4); Delay.msDelay(1000); }
  • 22. Code: Pairing <td><b>Pin:</b></td> <td> <form action="/default/pinset.jsp"> <input name="pin"/> <input type="submit" value="Pair"/> <input name=”refreshToken" type="hidden" value="${canvasRequest.client.refreshToken}"/> <input name="recordId" type="hidden" value="${canvasRequest.context.environmentContext.record.Id}"/> </form> </td> <body> <% String pin = request.getParameter("pin"); String refreshToken = request.getParameter(”refreshToken"); String robotId = request.getParameter("recordId"); PairingResource.setConnection(pin, refreshToken, robotId); %> Now check your EV3! </body>
  • 23. Code: Listening for Commands via Streaming API // Subscribe to the 'commands' topic to listen for new Command__c records client.getChannel("/topic/commands").subscribe(new ClientSessionChannel.MessageListener() { public void onMessage(ClientSessionChannel channel, Message message) { HashMap<String, Object> data = (HashMap<String, Object>) JSON.parse(message.toString()); HashMap<String, Object> record = (HashMap<String, Object>) data.get("data"); HashMap<String, Object> sobject = (HashMap<String, Object>) record.get("sobject"); String commandName = (String) sobject.get("Name"); String command = (String) sobject.get("Command__c"); String commandParameter = (String) sobject.get("CommandParameter__c"); String programToRunId = (String) sobject.get("ProgramToRun__c"); executeCommand( commandName, command, commandParameter, programToRunId, partnerConnection); } });
  • 24. Code: Moving the Robot around with Lejos import lejos.hardware.motor.Motor; public static void moveForward(int rotations) { Motor.B.rotate((180 * rotations)*1, true); Motor.C.rotate((180 * rotations)*1, true); while (Motor.B.isMoving() || Motor.C.isMoving()); Motor.B.flt(true); Motor.C.flt(true); } public static void moveBackwards(int rotations) { Motor.B.rotate((180 * rotations)*-1, true); Motor.C.rotate((180 * rotations)*-1, true); while (Motor.B.isMoving() || Motor.C.isMoving()); Motor.B.flt(true); Motor.C.flt(true); }
  • 25. Building your Lego Robot • What do I need? – Edimax EW-7811UN 150Mbps Wireless Nano USB Adapter – Micro SD Card (SDHC Only), 1GB, no greater than 32GB – Lego Mindstorms EV3 Set, Gripper Robot!
  • 26. Creating your own Lego Robot Machine Cloud! • Installation in Salesforce – Install the Machine Cloud managed package (see Readme) • https://github.com/afawcett/legoev3-machinecloud • Installation on Lego Mindstorms EV3 1. Install Lejos on your SDCard and install in the EV3 • http://sourceforge.net/p/lejos/wiki/Home/ 2. Use the Lejos menu on the EV3 to connect to your Wifi 3. Copy the ev3force.jar to your EV3 Robot (from /dist folder in GitHub Repo) • Run the /bin/ev3console UI and deploy using the Programs tab
  • 27. Creating your own Lego Robot Machine Cloud! • Connecting your Robots 1. Run the ev3force.jar application on the EV3 2. Note the PIN number shown on the EV3 Robot 3. Login to your Salesforce org and create a Robot record 4. Enter PIN number, wait for the device to connect to Salesforce 5. Send it commands and programs to run!
  • 28. Further Ideas… • Expose the Machine Cloud via Salesforce Communities • Machine Cloud API? – Perhaps we already have this? • Using the Salesforce API to insert records to the Command__c object?  • Add support for other Devices? – Watches, Phones etc • Add support for Generic Streaming API events – Events not driven by Database events but by processes
  • 29. Session Resources • Follow the Session in the Dreamforce App, I will share this slide deck and other related links on the Feed • Be social and feel free to ask follow up questions! 