/ IoT and RESTful Hardware What We’ve Learned from Three Years Treating Motion as REST Alden Hart - Synthetos O’Reilly Solid Conference May 21, 2014.

Slides:



Advertisements
Similar presentations
Oct, 26 th, 2010 OGF 30, NSI-WG: Network Service Interface working group Web Services Overview Web Services for NSI protocol implementation
Advertisements

Categories of I/O Devices
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
SOAP.
Module 4: Configuring Network Connectivity
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
I/O Devices and Drivers
1 JBus, A Platform Independent Publish/Subscribe Bus for CWave 2000 M.S. Thesis Defense Joseph W. Longson March 30, 2000.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
The Analytical Engine Module 6 Program Translation.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
OS Spring’03 Introduction Operating Systems Spring 2003.
Process Processes are executing or executable instances of programs. Processes in a modern OS haveOS –management information –resources –unique process.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 3 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
1 I/O Management in Representative Operating Systems.
OS Spring’04 Introduction Operating Systems Spring 2004.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Chapter 30 Electronic Mail Representation & Transfer
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
COMP201 Computer Systems Exceptions and Interrupts.
ECE 526 – Network Processing Systems Design Network Processor Architecture and Scalability Chapter 13,14: D. E. Comer.
Computer Networks. IP Addresses Before we communicate with a computer on the network we have to be able to identify it. Every computer on a network must.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Tools for Web Applications. Overview of TCP/IP Link Layer Network Layer Transport Layer Application Layer.
EMBEDDED SYSTEMS 9 April 2013 William W. McMillan.
The New Zealand Institute for Plant & Food Research Limited Matthew Laurenson Web Services: Introduction & Design Considerations.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
© 2004 Mercury Computer Systems, Inc. FPGAs & Software Components Graham Bardouleau & Jim Kulp Mercury Computer Systems, Inc. High Performance Embedded.
Networking in Windows NT Layered Network Architecture Network Interface Card Network Adapter Card Drivers NDIS InterfaceStreams Transport Protocols.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Lecture 6: Sun: 8/5/1435 Distributed Applications Lecturer/ Kawther Abas CS- 492 : Distributed system & Parallel Processing.
Bluetooth on CE. Mid - Presentation Roman Zoltsman & Oren Haggai Group /2001 Instructor: Nir Borenshtein HSDSL Lab. Technion.
1 © Donald F. Ferguson, All rights reserved.Modern Internet Service Oriented Application Development – Lecture 2: REST Details and Patterns Some.
Module 2.0: Threads.
Cevgroup.org C utting E dge V isionaries. cevgroup.org TODAY’s TALK 1) Internet Of Things (IoT) 2) Wi-Fi Controlled Robots 3) Augmented Reality.
© 2008 by Wind River; made available under the EPL v1.0 | 19-Nov-2008 TCF The Target Communication Framework Michael Scharf, Wind River wiki.eclipse.org/DSDP/TM/TCF_FAQ.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
Big Picture Lab 4 Operating Systems C Andras Moritz
2016 Global Seminar 按一下以編輯母片標題樣式 Virtualization apps simplify your IoT development Alfred Li.
Windows Communication Foundation and Web Services
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
IoT Integration Patterns, REST, and CoAP
Node.js Express Web Services
Chapter 5 Network and Transport Layers
Testing REST IPA using POSTMAN
Operating Systems Chapter 5: Input/Output Management
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Threads Chapter 4.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Introduction to Computer Systems
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

/ IoT and RESTful Hardware What We’ve Learned from Three Years Treating Motion as REST Alden Hart - Synthetos O’Reilly Solid Conference May 21, 2014

TinyG Motion Controller what’s TinyG? multi-axis motion control system designed for desktop CNC, 3D printing, pick & place… accepts Gcode from USB port and executes it locally on the board behaves like a RESTful server

The Controller Problem & Design Goals the problem the motion control functions are all good – but people got stuck at controller implementation specialized parsers and stateful clients got in the way design goals control interface that’s easy and intuitive simple compact / lightweight human readable / typeable / hackable relatively ubiquitous / low learning curve easily persisted and instantiated object oriented don’t have to be an industrial automation engineer to use (1 : 1000) does not require gateways or other additional hardware not design goals highly optimized transfer / storage support bandwidth starved and flakey communications channels support for hard, a-priori contracts XML-isms like Xpath/Xquery, annotation, schemas

RESTful Hardware what is RESTful? state exists on the server and is transferred to the client representation is flexible, independent well-defined resource model RESTful hardware server is an embedded chip / may not have an OS RESTful conventions make talking to the device very easy JSON JSON is the natural representation meets most of our design goals simple compact / lightweight human readable / typeable / hackable relatively ubiquitous / low learning curve easily persisted and instantiated object oriented

Putting JSON / REST on the Hardware put it On.The.Hardware code runs on the chip - not a gateway / translator / some-other-intermediary “Run JSON right over the traces” simple JSON parser, serializer, dispatcher and serial IO in < 8K C/C++ code bind names to dispatch tables to perform actions for the verbs marshalling in and out of floating point strtof() < 70 uSec on a 16 MHz AVR atmega328P (Arduino Uno) strtof() < 7uSec on a 84 MHz ARM Cortex M3 core all memory statically allocated – no mallocs transport doesn’t matter USB, SPI, Serial, MQTT, CoAP, HTTP… subset of JSON spec 7 bit ASCII only (UTF-8 sub-set) objects on a single line (no embedded line feeds) objects limited to 512 characters (less on smaller CPUs) decimal only, no hexadecimal limited support for arrays

Implementation Considerations well defined resource model static model – e.g. X axis, motor 1, machine setup parameters… dynamic model – e.g. position, velocity, coordinate system in use, tool in use… favor flat namespaces – right level of object granularity keeping it compact short, mnemonic tokens for names – e.g. xvm instead of XaxisVelocityMaximum don’t need to be globally unique – objects define scope many values are enumerated – e.g. 3 instead of GcodeProgramStop simple verbs (get, post) cheats & shortcuts no request headers. Use null to mean get no request ID – request / response is synchronous can consume Gcode natively without a JSON wrapper so people don’t have to pre-process their Gcode files

Implementation Examples from TinyG (1 of 2) get {“xvm”:null} {“ct”:null} {xvm:n} {ct:n} post (set) {xvm:16000} {ct:0.01} objects {x:{vm:16000}} {r:{x:{am:1,vm:16000,fr:10000,tn:0,tm:100,jm:200,jh:10000,jd:0.0100,sn:0,sx:0,sv:3000,lv:100,lb: ,zb:3.000}},f:[1,0,6,5473]} {r:{sys:{fb:428.01,fv:0.970,hp:1,hv:8,id:"2X2660-EVD”… {gc:”N75 G3 X Y Z I J0.0594”} footer revision status code flow control checksum footers f:[1,0,6,5473]

Implementation Examples from TinyG (2 of 2) status reports event reporting for the dynamic model timed and filtered timed reports during movement – e.g. every 250 milliseconds and at end-of-move filtered so only changed values are reported setup status report {sr:{posx:true, posy:true, posz:true, vel:true, momo:true, stat:true}} status reports for an X move from 0 to 100 {sr:{posx:0.000,vel:1.54,momo:0,stat:5}} {sr:{posx:2.494,vel: }} {sr:{posx:18.137,vel: }} {sr:{posx:43.528,vel: }} {sr:{posx:69.885,vel: }} {sr:{posx:91.760,vel: }} {sr:{posx:99.670,vel:479.38}} {sr:{posx: ,vel:0.00,stat:3}} exception reports {er:{fb:428.01,st:29,msg:"Generic exception report"}}

Useful Conventions We need some conventions for non-application specific functions don’t innovate. copy. $ root to discover objects (cribbed from JSONpath) {$:null} return top-level objects prefix for addressing, binding and routing assign a short name (handle) {ex1:null} address device “ex1” and route object to that device # topic prefix {#time:” T15:52:49.680Z”} devices that want time will process this message ! priority. Jump the queue {!fh:true}stop movement now! (feedhold)

Questions