Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.99 KB

README.md

File metadata and controls

53 lines (40 loc) · 1.99 KB

Things Bus

WORK IN PROGRESS

SHORT: A Compact RPC (Remote Procedure Call) Protocol

LONG: A master driven software Bus protocol inspired by PCI/USB bus, based on Google protobuf. By standardizing the interface of commonly used peripheral devices, the controlling logic is modulized and re-usable.

Idea

A bus is a logical group of peripheral devices. A master connects to the bus and runs controlling logic. A bus itself is also a device, so it can be attached to another bus, thus building a complex hierarchical bus tree is possible. The communication between master and bus, bus and device can be remote. The transportation is abstract, and the protocol is specially designed to make communication over serial port possible.

Motivation - why?

When building a robot, a lot of peripherals are common, e.g. sensors, servos, step motors, DC motors etc. The interface of these devices can be standardized, and the robot itself becomes a collection of these devices. On the controlling side, many logics are re-usable, e.g. controlling left/right motors for different motion behaviors. With standardized device interfaces, the controlling logics can be easily wrapped in highly re-usable modules.

Goals

  • Small footprint: the protocol should be able to run on micro controllers
  • Error proof: the protocol must have recovery mechanism if transmission error encountered

Solution

Protobuf is a very efficient and compact binary message encoding format, and fits our goals best. The only thing left is to build an RPC protocol on top of it. See Protocol for a draft of the RPC wire format. And also in the folder proto, standardized commonly used device interfaces are defined.

TODO

  • Notification streams from device, for sensors
  • Bus/Board matching
  • Error recovery on serial transportation
  • Support C/C++, especially for Arduino
  • Support Java, for Android
  • Support Python, preferred for AI