Which Websocket Implementation to Use?

Create issue
Issue #5 new
Michael Backus repo owner created an issue

So, in trying to figure out how I would get the main program (written in c++) to communicate with the web, I stumbled across the following: http://www.html5rocks.com/en/tutorials/websockets/basics/

Looks like there are many options, and libwebsockets might allow us to keep everything inside a single c++ program.

Comments (13)

  1. Michael Backus reporter

    The OpenROV and the WolfTracker 2014 accomplish the same end goal. Not sure if I want to follow in their footsteps though (I know this can be done without an Arduino, not sure about Node.js and socket.io).

  2. Michael Humphrey

    It is completely possible to perform all tasks from the BBB without the use of an Arduino as I have seen demonstrated from several projects using either C++ or Node.js. Many of these project include Arduino since it is the standard for robots and the massive amount of sample code and support base that the Arduino community has.

    There is one very successful Node.js library for robotics Johnny-Five. The basis of this library is to write your code in node on the host computer and then control motors and sensors through a highjacked Arduino via Firmata Protocol. This does not seem to be what you are wanting, to also have an Arduino in the mix.

    One project has taken this one step further, beaglebone-io demonstrates how we could write a client and server app in Node.js that will use socket.io to communicate between the client and server and then using Johnny-Five to perform all of the robot control on the BeagleBone Black.

  3. Michael Backus reporter

    Thanks for the post on Johnny-Five. I keep coming back to c++ for two reasons.

    1. Performance
    2. It plays nice with OpenCV

    If we use something besides c++ to talk to the web page, we're going to have to figure out a way to pass numbers between the two languages. I haven't seen a good way to pass info between Node.js and c++ yet. Any ideas?

  4. Michael Backus reporter

    Sadly, this might all be a moot point without a solid way to connect to the Beaglebone wirelessly. See issue 6 for details.

    As for which direction to take with respect to this issue, I have come to the realization that trying to integrate a c++ websocket into the main program violates the KISS principal. Even if we get it working, it looks like it's going to be complex, and consequently difficult to convey to students. Let's see what we can do with socket.io.

  5. Michael Backus reporter

    I modified the Wt hello example to show frames generated by cv. Checkout the Wt branch.

  6. Log in to comment