On Wednesday, January 22, 2014 12:23:34 AM UTC-5, [email protected] wrote:
>
> This is actually a very basic question, but I'm kind of lost right now.
> I was working on a school project with the Beagle bone black. It controls 
> a bunch of motors and sensors, etc. We essentially wrote everything in C++ 
> and made them into libraries of functions. They work when a main program 
> calls the libraries and the function needed.
>
> Recently we have been asked to demo our progress so far, that too in just 
> a few days. The main program is far from over, so we were thinking of 
> making a very basic web interface that is just going to call the functions. 
> I personally never did this yet, so have no idea what should I be looking 
> at. Node.js and Javascript ('bonescript') seems to be a popular tutorial 
> around, but can they be used to call C++ libraries? Is it possible to host 
> a webpage on the board so that we can open up the page in another PC over 
> LAN?
>
> I know this is a very basic question, but I don't want to spend too much 
> time looking up the wrong methods. Any points towards the right direction 
> would be appreciated.
>

Others have suggested nodejs, but I think interfacing to your C++ directly 
from Javascript is going to be non-trivial; alternately you would have to 
build some kind of RPC interface to C++ that nodejs can call (e.g. REST or 
0MQ).

You should consider Google's Go (http://golang.org/), it has the ability to 
interface to C directly via cgo (you might need to wrap any C++ APIs in a C 
wrapper), and using open source projects such as Martini 
(https://github.com/codegangsta/martini) you can easily build high 
performance web interfaces with Go.  The language is C/Java like, pretty 
easy to learn and very productive.

Best of all, go will produce arm/linux binaries with no dependencies that 
you can run directly on the BBB.  In fact you can cross compile them from 
your workstation with Go (https://coderwall.com/p/pnfwxg).

Hope this helps,


-W.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to