[GSoC2014] [Personal Idea] BeagleEye: A visual programming toolbox for the BoneScript

Dear all,

I am Hoang, a Vietnamese student at National Economy University. I have deep interests in the field of web technologies such as HTML, JavaScript or CSS and also the Internet of Things subject. I always want to build a visual programming framework for developing physical things’ applications and when I come through the BoneScript, I have an idea for which I hope could gain some interests.

A picture worth hundreds of word so that I just want to show what my idea looks like:
image.png

This is a Blockly version of the BoneScript PIR Motion Sensor demo. I think a visual programming toolbox for the BoneScript would be interesting. A similar project has been done for the Arduino: https://github.com/gasolin/BlocklyDuino/wiki

So, that’s my idea and at the end of my project (if accepted to GSoC) would be a web app with a visual programming toolbox that user can use to create BoneScritp application without having to write a line of code.

There will be some challenges:

  • We need to define/design new block types that is customized to the BoneScript.
  • There seems lack of a Object oriented design for the Blockly so that we need to figure out a proper way.
  • Some Javascript functions also need to be “Blockified” such as setInterval
  • The design should taken into account support for interacting with capes
  • There is a trade off between the block’s details and the flexibility in program design, for example, we could you two blocks: the “set pirPin” and the “pirPin” block to represent the pin “P8_19” or we could design a new block called “pin” that possesses a drop down list to chose the pin from.

And I think with the current number of BoneScript functions (12?), A corresponding BeagleEye toolbox can be done within a summer term.

Thank you for your time reading and please let me know if this is of enough fun :slight_smile:

Dear all,

I am Hoang, a Vietnamese student at National Economy University. I have deep interests in the field of web technologies such as HTML, JavaScript or CSS and also the Internet of Things subject. I always want to build a visual programming framework for developing physical things’ applications and when I come through the BoneScript, I have an idea for which I hope could gain some interests.

A picture worth hundreds of word so that I just want to show what my idea looks like:
Inline images 2

This is a Blockly version of the BoneScript PIR Motion Sensor demo. I think a visual programming toolbox for the BoneScript would be interesting. A similar project has been done for the Arduino: https://github.com/gasolin/BlocklyDuino/wiki

Nice. Have you seen my initial hack at Blockly BoneScript?

I probably should have checked out BlocklyDuino.

So, that’s my idea and at the end of my project (if accepted to GSoC) would be a web app with a visual programming toolbox that user can use to create BoneScritp application without having to write a line of code.

I like it and suggest it be integrated into http://github.com/beagleboard/bone101 (http://beagleboard.github.io/bone101).

There will be some challenges:

  • We need to define/design new block types that is customized to the BoneScript.

Some general JavaScript components need to be added as well.

  • There seems lack of a Object oriented design for the Blockly so that we need to figure out a proper way.

Do you have specific concerns and thoughts here? How would use use objects if you had them? Is it not modular enough?

  • Some Javascript functions also need to be “Blockified” such as setInterval

Right. I’m commenting as I read. I’m glad you recognized this need.

  • The design should taken into account support for interacting with capes

Can you enumerate specific capes that should be covered? Many Capes “just work”. What type of functions are you thinking of exposing?

  • There is a trade off between the block’s details and the flexibility in program design, for example, we could you two blocks: the “set pirPin” and the “pirPin” block to represent the pin “P8_19” or we could design a new block called “pin” that possesses a drop down list to chose the pin from.

That’s kinda what I did. Still, being able to label pins is very helpful, so I think that functionality should be included.

And I think with the current number of BoneScript functions (12?), A corresponding BeagleEye toolbox can be done within a summer term.

If it is just the BoneScript functions, I think you can just evaluate what it takes to clean up what I already did. Getting a set of higher-level blocks similar to BlocklyDuino seems necessary to me to make it useful.

Thank you for your time reading and please let me know if this is of enough fun :slight_smile:

It seems like great fun to me. I think you need to try to send a message to the Google Blockly mailing list and lists like BlocklyDuino to find developers willing to mentor that are sufficiently knowledgable. I have good knowledge on BoneScript, but I think presenting this properly to users new to building hardware and having it nicely modular to have the largest developer community extending it are important aspects. If it is really a one-time effort that people can use, that’d be great, but I worry that it’ll require on-going maintenance and extension and therefore needs to attract other developers for post-summer work.

Thoughts?

Hi Jason,

Thanks a lot for your interest. I am seeking on Blockly and BlocklyDuino for help. Your initial work is very helpful, I did not see that earlier. Then it would be great for me to based on your work to build higher-level blocks as you said.

The notion of object oriented design is that I found it is difficult to define objects that can be reusable. For example, in your work you define the BoneScript-family functions such as digitalRead, pinMode, … and the generated code matches those functions directly to the BoneScript object - b. If I want to define a custom object that can be reuse (for example, an Ajax Request), I need to modify the Blockly source code to generate a totally new category, which is impossible.

Regarding the capes, my initial though is that we can abstract the capes into a higher level as a collection of resources (instead of pins) that can be read and write. For example, in the Beacon cape demo, if we make a Blockly version of such source code in pin-level abstraction, it will be too complicated and have too many blocks. Instead, we abstract the Beacon cape into high level function blocks such as watch(BUTTON, callback), watch(POT, callback), set(BEACON, 5), get(LED, callback) and so on (think RESTful web).

And the verbs like watch, set, get can be reused with all other capes. Moreover, since the interface between a specific cape and the board is fixed (please correct me), we could help the developers to do the initial pin setup.

This is an example:

var b = require(‘bonescript’);

var bc = require(‘beacon’);

bc.initiate();

bc.watch(bc.BUTTON, onButtonClicked);
function onButtonClicked(buttonStatus){
// do something
}

and inside the beacon.js we implement the watch, get, set functions accordingly.

This kind of resource abstraction can be done even at the BoneScript itself instead of Blockly and let the cape manufacturers or community developers to implement the concrete function. I believe this could blur the line between embedded design and web-based application development.

I’ll keep you updated on the progress.

Hi Jason,

Thanks a lot for your interest. I am seeking on Blockly and BlocklyDuino for help. Your initial work is very helpful, I did not see that earlier. Then it would be great for me to based on your work to build higher-level blocks as you said.

The notion of object oriented design is that I found it is difficult to define objects that can be reusable. For example, in your work you define the BoneScript-family functions such as digitalRead, pinMode, … and the generated code matches those functions directly to the BoneScript object - b. If I want to define a custom object that can be reuse (for example, an Ajax Request), I need to modify the Blockly source code to generate a totally new category, which is impossible.

Regarding the capes, my initial though is that we can abstract the capes into a higher level as a collection of resources (instead of pins) that can be read and write. For example, in the Beacon cape demo, if we make a Blockly version of such source code in pin-level abstraction, it will be too complicated and have too many blocks. Instead, we abstract the Beacon cape into high level function blocks such as watch(BUTTON, callback), watch(POT, callback), set(BEACON, 5), get(LED, callback) and so on (think RESTful web).

And the verbs like watch, set, get can be reused with all other capes. Moreover, since the interface between a specific cape and the board is fixed (please correct me), we could help the developers to do the initial pin setup.

This is an example:

var b = require(‘bonescript’);

var bc = require(‘beacon’);

bc.initiate();

bc.watch(bc.BUTTON, onButtonClicked);
function onButtonClicked(buttonStatus){
// do something
}

and inside the beacon.js we implement the watch, get, set functions accordingly.

This kind of resource abstraction can be done even at the BoneScript itself instead of Blockly and let the cape manufacturers or community developers to implement the concrete function. I believe this could blur the line between embedded design and web-based application development.

I’ll keep you updated on the progress.

I saw you posted to the Blockly list. Any luck getting some additional mentorship?

Hi Jason, there are some progresses. However, can we do parallel mentoring, i.e, can a mentor work on two projects? It is not possible in student case but I am not sure about the mentoring case. I’ll ask Carol about it.

Hi Jason, there are some progresses. However, can we do parallel
mentoring, i.e, can a mentor work on two projects? It is not possible in
student case but I am not sure about the mentoring case. I'll ask Carol
about it.

It is possible in the mentor case, although it is discouraged. In the case
that there are additional mentors, I believe it is fine. I'd want to see
the prospective mentor "hanging out" a bit in the BeagleBoard.org circles,
primarily the #beagle-gsoc IRC channel.

Dear Jason,

I have submitted a proposal on the Google melange and complete the cross compile test. Could you please have a look and feedback if possible. I am making connection with Gasolin and hope he will agree before the deadline.

Thank you very much.

Dear Jason,

I have submitted a proposal on the Google melange and complete the cross compile test. Could you please have a look and feedback if possible. I am making connection with Gasolin and hope he will agree before the deadline.

I was disappointed he seems to not be making himself available to backup-mentor on this project. Perhaps you could engage him on whatever he is mentoring or make another proposal here.

Certainly I appreciate any contributions you make and would be happy to merge pull requests you might have and promote your project (if completed successfully) in the future.

Hello Hoang, I am Jongseuk, a PhD student from KAIST, Korea. I saw your post on Blockly group about your project and mentor seek. Although I don’t work on embedded systems as your main topic, I am designing an object-oriented version for Blockly and in my understanding your proposal also includes a notion of object-oriented design in Blockly.

I am not an expert on the Blockly language but I have played with it over a year in my research at KAIST and know it quite well. I am also actively working on a project that uses Blockly as a visual programming language. May be you can consider me to be your mentor if you are running out of options.

Cheer.

Hi Jongseuk,

Thanks for your interest. It’s a bit late I think. Since the proposal deadline has been reached, I’m not sure if I can continue. Jason, can you have a look on my situation, is there any hope? I did submit the proposal though.

It is still possible to assign new mentors and gather additional feedback on already submitted proposals.

Hello Hoang, I think you might want to find some more supportive mentor for your project. I recommend you to go to https://www.npmjs.org and search for beaglebone, bonescript or whatever you feel possible.

better be quick.

hi, thanks for your comments and suggestion. I’ll try my best.