As we had talked about in our last post, We’ll be working on BBIO-Server as our AOST (Architecture of Open Source Technologies) project. This will be an extension to Alexander Hiam’s work, PyBBIO!
Currently the BBIO-Server is implemented as a library in the PyBBIO project. It enables the users to build a web page via a python API. Lambda functions help enable the RPC mechanisim to link user action on the web page to hardware actions on the Beaglebone Black. Here is the overview of how to use the API.
NOTE : These links will change overtime, the current library may soon be depreciated.
Our proposal is to replace the current implementation as it has a few shortcomings. One of the problem being that there is no clean way to access hardware end points from the client side. The page has to be built using the BBIO-Server API; there is no other generic way to access the IO pins on the board. We plan to tackle this problem by developing a RESTful API to access hardware as follows :
1
|
|
gets the status of pin 3 of the 2nd GPIO module (the BBB has 4 GPIO modules). To set the pin status,
1
|
|
to setup a sensor/actuator on a paritcular port, we will be using the PUT request
1
|
|
Also the current implementation is a custom built HTTP server using the python HTTP API. It makes more sense to use a existing lite server side framework such as Flask.
Another limitation of the current implementation is that you can’t directly access the hardware from the client side, i.e. you have to build the page using the python API only, which is not very nice for most developers. This calls for a neat javascript based API which will give developers a neat way to control the BBB via a web interface. Such as
1 2 |
|
Additionally we propose to create an API for data streaming via web-sockets/web-rtc. This will be useful for sensor data graphing and video camera display.
Finally developers would like to have ready to use UI components at their hands, and for this purpose we will be integrating BBIO-Server with Freeboard and also adding our custom UI components!
Note : A similar project is Web-IO-Pi which enables web page based hardware control on the Raspberry PI.