The Lego MachineCloud project has received a massive boost in the form of two great technologies from Lego and Salesforce! I’m so pleased to confirm that my test to get the Salesforce Streaming API working on the EV3 has been a raving success! This technology allows the robot to be highly responsive to commands from Salesforce, including the hugely exciting brand new Salesforce1 mobile app.
Having uploaded the required Java libraries to the brick and adapted some Java code from a previous project. I then extended the Force.com objects I created for the previous robot to create a more “declarative” programming approach. That can be driven by Command records created by the user in the latest Salesforce user web and mobile interfaces!
Streaming Commands from the Force.com Machine Cloud
Here you can see a screenshot of the Robot record showing a list of commands that it has executed, note the New Command button! Simply click this button and select the type of command you want, hit Save and often before the screen can even refresh the EV3 will get the streaming API event notification and perform the command! I literally lept up from my chair the first time it did this. I’ve uploaded the source code to the project to GitHub, feel free to take a look and see how its all done!
Declarative Robot Programming via your Mobile!
I have extended the Robot and Command objects with another object called Program. This is a container for multiple Command records, allowing you to design a program in the Salesforce UI and then create a single Command record to execute that Program!
Having updated my version of the Salesforce mobile app, now known as Salesforce1, i quickly found that my Command object is now also available in this application. Within a few taps my EV3 was now also responding to commands sent via my phone! Now that is a true “No Software” reality! Amazing stuff Salesforce!
Dreamforce
I’ll be bringing the robot you see in the video to Dreamforce with me next week, where I cannot wait to see what people think of this approach to programming the EV3 in the “Internet of Things Lab” session. Its a basic framework at this stage but the potential is huge for having Robot’s socialise (from all over the world!) on the Salesforce “Machine Cloud” platform. See you at Dreamforce next week!
Brief Demo Video